![](templates/subSilver/images/CCSLogo.jpg) |
![CCS C Software and Maintenance Offers](templates/subSilver/images/forumAd6.jpg) |
View previous topic :: View next topic |
Author |
Message |
binu kr Guest
|
how much time takes to read a character from eeprom |
Posted: Fri Aug 08, 2008 8:15 am |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
rnielsen
Joined: 23 Sep 2003 Posts: 852 Location: Utah
|
|
Posted: Fri Aug 08, 2008 8:34 am |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah Guest
|
|
Posted: Fri Aug 08, 2008 9:05 am |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
|
|
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
|