0
\$\begingroup\$

I am using 24LC256 EEPROM which have addresses from 0x0000-0x7fff. But I would like to predefine certain address from EEPROM to specific tasks, like from 0-100 for task-1 and so on.

Does predefining those addresses in the C code work?

Like:

const int add[31] =   {0,4,8,12,16,20,24,28,32,36,40};

Will it work or should we point address as 0x0000 - 0x7fff?

And my other question is, how much delay must be done after writing operation (simple write/Page write) in an EEPROM.

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

The first is a programming issue and the rest of your code will decide how you want to designate the sections of the device.

For the second, the datasheet gives a maximum of 5ms to program a byte or page, but you can use acknowledge polling to check if the device has completed the operation before that time has elapsed; see section 7.0, "Acknowledge Polling" of the Microchip 24AA256/24LC256/24FC256 datasheet for details.

\$\endgroup\$
6
  • \$\begingroup\$ So the first case would work i trust.By declaring address locations as numbers instead of hexadecimal \$\endgroup\$
    – Rookie91
    Commented Nov 6, 2013 at 5:01
  • 2
    \$\begingroup\$ Oh, is that what that was about? The compiler doesn't care what radix you use for your numbers. \$\endgroup\$ Commented Nov 6, 2013 at 5:04
  • \$\begingroup\$ What would the time needed to read a byte from eeprom? \$\endgroup\$
    – Rookie91
    Commented Nov 6, 2013 at 6:03
  • \$\begingroup\$ No more time than however long it takes to perform the transaction. The data should be available immediately, it's just a question of how quickly you can get it out of the chip on the bus. \$\endgroup\$ Commented Nov 6, 2013 at 6:05
  • 1
    \$\begingroup\$ @Rookie91: Reading from EEPROM is a much faster operation than writing, so much so that I2C will be the bottleneck, not the EEPROM. \$\endgroup\$ Commented Nov 6, 2013 at 6:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.