|
|
View previous topic :: View next topic |
Author |
Message |
sraiderk
Joined: 09 Feb 2005 Posts: 48
|
Internal EPPROM time need |
Posted: Thu Dec 18, 2008 2:32 am |
|
|
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
|
|
Posted: Thu Dec 18, 2008 5:25 am |
|
|
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
|
|
Posted: Thu Dec 18, 2008 6:15 am |
|
|
OK, Ttelmah
I understood |
|
|
rnielsen
Joined: 23 Sep 2003 Posts: 852 Location: Utah
|
|
Posted: Thu Dec 18, 2008 9:44 am |
|
|
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 |
|
|
|
|
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
|