View previous topic :: View next topic |
Author |
Message |
EmbdFreak
Joined: 28 Jul 2005 Posts: 23
|
modifying 24LC256 driver |
Posted: Mon Jan 02, 2006 4:12 am |
|
|
hi,
I am using the 24lc256's driver file as a driver to my Atmel's 24c512.
would modifying the two #defines EEPROM_SIZE and EEPROM_ADDRESS be enough to use the 24256.c as the ATMEL24c512's driver.
Moreoever, plz also specify if only page writes (128bytes) are possible, cuz my observation is that writing smaller chunks (5-10 bytes) is no problem either, as the datasheet recommends
Comments welcome !
BTW I have a compiler version ver 3.203.
Regards,
EF |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Jan 02, 2006 1:03 pm |
|
|
The current version of the CCS compiler comes with a driver for the
24LC512. It's called 24512.C. The only change from 24256.C is
the eeprom size definition. In 24512.C, it is changed to this:
Code: | #define EEPROM_SIZE 65535 |
|
|
|
EmbdFreak
Joined: 28 Jul 2005 Posts: 23
|
|
Posted: Thu Jan 05, 2006 5:56 am |
|
|
thanks for the help.
Actually in my application im just incrementing the variable address without having to care about the page write restriction. It seems its no problem until the end of the memory i.e 64k limit,for which id cater. Is my observation correct? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Jan 05, 2006 3:26 pm |
|
|
Quote: | It seems its no problem until the end of the memory i.e 64k limit,for which id cater. Is my observation correct? |
The last two words are garbled. What is "id cater" ? |
|
|
newguy
Joined: 24 Jun 2004 Posts: 1907
|
|
Posted: Thu Jan 05, 2006 3:49 pm |
|
|
PCM programmer wrote: | Quote: | It seems its no problem until the end of the memory i.e 64k limit,for which id cater. Is my observation correct? |
The last two words are garbled. What is "id cater" ? |
I read that as "I'd cater to this feature/limitation." |
|
|
EmbdFreak
Joined: 28 Jul 2005 Posts: 23
|
|
Posted: Thu Jan 05, 2006 11:55 pm |
|
|
Quote: |
It seems its no problem until the end of the memory i.e 64k limit,for which id cater. Is my observation correct?
|
Well, PCMProgrammer, Newguy guessed my hidden apostraphraphe right there ! Anyways heres a restatement with correct punctuation this time.
Can i fill up my memory simply by writing:
Code: |
WRITE_EXT_EEPROM(address,value);
address++;
|
Id be writing a chunk of say 10 bytes every time calling the above code in a loop, without caring for any page writing. Moreover, ive observed it starts overriting from first location once its filled, acting as a circular buffer. Now am i correct ?? ( Umm..No punctuation mistake, here i suppose ) |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Jan 06, 2006 1:01 am |
|
|
If "address" is a 16-bit variable, when it reaches 0xFFFF and you
increment it one more time, it will wrap around to 0x0000.
However, because the EEPROM has a size of 65536 bytes, it's not
an even multiple of 10. So your record offsets would change each
time your address wrapped around. i.e., The offsets would not
stay at fixed values of 0, 10, 20, 30, etc. If you intend for the
address to wrap around, it would be better if you picked a record
size that is a power of 2, such as 8 or 16. |
|
|
EmbdFreak
Joined: 28 Jul 2005 Posts: 23
|
|
Posted: Fri Jan 06, 2006 4:32 am |
|
|
Thanks again. it ll surely help !
Regards,
EF |
|
|
|