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

modifying 24LC256 driver

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



Joined: 28 Jul 2005
Posts: 23

View user's profile Send private message

modifying 24LC256 driver
PostPosted: Mon Jan 02, 2006 4:12 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Jan 02, 2006 1:03 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Jan 05, 2006 5:56 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Jan 05, 2006 3:26 pm     Reply with quote

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: 1909

View user's profile Send private message

PostPosted: Thu Jan 05, 2006 3:49 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Jan 05, 2006 11:55 pm     Reply with quote

Quote:

It seems its no problem until the end of the memory i.e 64k limit,for which id cater. Is my observation correct?


Smile 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 Smile )
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Jan 06, 2006 1:01 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Jan 06, 2006 4:32 am     Reply with quote

Thanks again. it ll surely help !
Regards,
EF
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