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

how much time takes to read a character from eeprom

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







how much time takes to read a character from eeprom
PostPosted: Fri Aug 08, 2008 8:15 am     Reply with quote

please help me to know

k=read_eeprom(0);
how much time takes the function to read a character from eeprom of pic micro controller..pic16f877a
rnielsen



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

PostPosted: Fri Aug 08, 2008 8:34 am     Reply with quote

Well, as far as time wise goes, it depends on your crystal speed. Here's the code that was generated in an 18F2525:

Code:
.................... jnk = read_eeprom(0);
5D80:  MOVFF  FF2,6D5
5D84:  BCF    FF2.7
5D86:  CLRF   FAA
5D88:  CLRF   FA9
5D8A:  BCF    FA6.6
5D8C:  BCF    FA6.7
5D8E:  BSF    FA6.0
5D90:  MOVF   FA8,W
5D92:  MOVLB  6
5D94:  BTFSC  xD5.7
5D96:  BSF    FF2.7
5D98:  MOVWF  xD0


Now, you can calculate the time by using your clock speed.

Ronald
Ttelmah
Guest







PostPosted: Fri Aug 08, 2008 9:05 am     Reply with quote

Key is though, that reading is almost instantaneous. You just have to load the address required, trigger the read access bit, and read the data. It is _writing_, that is slow on EEPROM type memory. The code shown, just does the work to load the address, trigger the read, and retrieve the data.
This is basically the same as for the 'flash' memory in the chip, which also takes similar time to write (between 1 and 8mSec, depending on the chip - 4 to 8, on the 877), but reading is done for every instruction, without needing delays, even at 48MHz clock rates. This is why there is not a figure specified in the data sheet for the read.
So, if you need to know the exact time, for something very timing critical, count the instructions, as rnielsen says. However for normal use the time is short enough to not matter.

Best Wishes
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