CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

looking for code: FM25c256

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Guest








looking for code: FM25c256
PostPosted: Wed Nov 16, 2005 8:29 am     Reply with quote

Did anyone wrote SPI driver for this device ?
Where I can find a working code for it ??
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Wed Nov 16, 2005 9:28 am     Reply with quote

@treitmey had posted the required code.

It is in the Code Library:

http://www.ccsinfo.com/forum/viewtopic.php?t=24099

Humberto
treitmey



Joined: 23 Jan 2004
Posts: 1094
Location: Appleton,WI USA

View user's profile Send private message Visit poster's website

PostPosted: Wed Nov 16, 2005 9:44 am     Reply with quote

My code is I2C, and it is for the FM24C256.

not the FM2 5 C256


Last edited by treitmey on Wed Nov 16, 2005 9:46 am; edited 1 time in total
Guest








PostPosted: Wed Nov 16, 2005 9:45 am     Reply with quote

It's I2c and not SPI ..
Guest








PostPosted: Thu Nov 17, 2005 6:18 am     Reply with quote

anyone can help here ??
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Nov 17, 2005 2:50 pm     Reply with quote

They don't call it FM25C256. They call it FM25256 or FM25L256.
http://www.ramtron.com/doc/Products/serial.asp

If you look in the CCS driver directory for all drivers starting with "25",
you see these files:
25C080.C
25040.C
25080.C
25160.C
25320.C
25640.C

If you look in the data sheet for the FM25256, you see that it uses
commands such as WREN, RDSR, etc.
http://www.ramtron.com/lib/literature/datasheets/FM25256ds_r2.1.pdf
Then if you look in the CCS driver files above, the first file 25c080.c
doesn't use those commands. So that's not it. The other ones do.

So then browse all those files and pick the one that has the EEPROM_SIZE
that's closest to the FM25256. That would be the 25640.C file.
It's eeprom size = 8192. That's important because in the FM25256,
the address field requires 2 bytes. So you want a driver that is for
a compatible eeprom that has a 2 byte address field.

Then go to Microchip data sheet finder, select Serial eeproms, and
select 25LC640.
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=2046
Then download the data sheet for it.
http://ww1.microchip.com/downloads/en/DeviceDoc/21223G.pdf

Compare the data sheets between 25LC640 and FM25256. They look
mostly the same. One obvious difference is the Status Register.
In the 25LC640, bit 0 is the WIP bit. If it's = 1, the eeprom is busy.
In the FM25256, this bit is always a constant 0. ie., for the Ramtron
chip, you don't have to wait for the eeprom to be "ready".

The timing diagrams for the read and write operations look similar.

Then take a quick look at the CCS driver, 25640.C. Check to see
if they're doing any masking operations on the address which might
cause us problems, because the FM25256 uses all 16 address bits.
We don't want any of them to be masked off, as people sometimes
do before they output the address for eeproms that don't use all 16
address bits. Looking at the code, it looks OK. No masking is done.

Then next, look at this CCS routine in 25640.C: ext_eeprom_ready()
This routine reads the status register and returns the inversion of
the WIP bit. ie., if the eeprom is ready, the routine returns a 1.
The Ramtron chip is always "ready". So this routine could be left in place.
It will slow down the code somewhat, because you don't need to check
the WIP bit for the Ramtron part. To increase the driver speed, you
could comment out all checks for eeprom ready. There are a couple
places where it has this statement:
while(!ext_eeprom_ready());
Just comment them out.

So based on this analysis, the 25640.C driver will probably work with
the FM25256.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group