PDA

View Full Version : Required Time for WRITE Command



rsocor01
- 30th November 2011, 03:55
Hi all,

I have this code in one of my programs,



FOR I = 1 TO 50
ADDRESS = I

SELECT CASE I
CASE 1
WRITE_VAR = MY_VAR_1
CASE 2
WRITE_VAR = MY_VAR_2
..........
CASE 50
WRITE_VAR = MY_VAR_50
END SELECT

WRITE ADDRESS, WRITE_VAR
PAUSE 10

NEXT I


It writes 50 bytes in EEPROM memory without any problem. The problem than I'm having is that all of this EEPROM writing takes too much time in my program. That is, the total time of the PAUSEs (50 * 10ms = 500ms) plus the time required for the rest of the code. Is there any way to make this code faster? Does the pause after the WRITE command has to be 10 ms like the manual recommends, or can it be smaller than that?

Thank you,

Robert

Darrel Taylor
- 30th November 2011, 05:04
The manual shows a PAUSE 10 after an I2CWRITE to an external EEPROM, but not after a WRITE to internal EEPROM.

Most internal EEPROM Erase/Write cycles take ~5mS, and that is self timed by the chip/PBP.
So removing the pause should speed it up 3x.

rsocor01
- 1st December 2011, 00:21
Darrel,

Removing the pause fixed the problem. Thank you.