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 support@ccsinfo.com

Internal EPPROM time need

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



Joined: 09 Feb 2005
Posts: 48

View user's profile Send private message

Internal EPPROM time need
PostPosted: Thu Dec 18, 2008 2:32 am     Reply with quote

I want to learn the following

read_eeprom(1); and
write_eeprom(1,1);

for these two statements in 18f452 internal eeprom area using,
How many time do you need separately, 1ms or 100us....
Ttelmah
Guest







PostPosted: Thu Dec 18, 2008 5:25 am     Reply with quote

Not quite sure what you are asking?.
However, guessing that you are asking about the times these operations take. Then the answer to 1mSec, or 100uSec, is 'neither'.
The _read_ operation itself is almost instantaneous. The actual time needed for this, will depend on your clock rate. Basically, the compiler has to load the address needed into a couple of registers, set a flag, and read the result. A total of perhaps half a dozen instructions, so if your chip is running at 40MHz, under 1uSec.
The write, takes typically 4mSec. This is in the chip's data sheet. However this will vary, with supply voltage, temperature, and from chip to chip, so is not an 'exact' time.

Best Wishes
sraiderk



Joined: 09 Feb 2005
Posts: 48

View user's profile Send private message

PostPosted: Thu Dec 18, 2008 6:15 am     Reply with quote

OK, Ttelmah

I understood
rnielsen



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

PostPosted: Thu Dec 18, 2008 9:44 am     Reply with quote

Simply place the two commands in your code and after you compile it look at the List (.lst) file to see what assembly code has been generated. The Read command is straight forward. The Write command checks the WR bit inside the EECON1 register to see if the eeprom is finished writing. If it's not, it loops until it is. So, you can have a command immediately after the Write command and the eeprom will be successfully written before your code continues on.

Ronald
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