EEPROM Page write - I need some clarification ?

Buzby

Senior Member
Hi All,

I'm starting another project, this one will use a 24LC64 I2C EEPROM to hold random length records, none greater than 32 bytes.

What I'm unsure about is the way the page write buffer works. I've read the manuals, but I'm still not clear.

If I do :
Code:
hi2cout 92, ( "a" )   ' Puts "a" in addr 92
pause 10
or if I do :
Code:
hi2cout 92, ( "a","b","c","d" )   ' Puts "a","b","c","d" in addrs 92,93,94,95
pause 10
I know these will be OK, because I'm only writing 1 byte, or multiple bytes in the same page write buffer range.

But what if I do :
Code:
hi2cout 94, ( "a","b","c","d" )   ' Puts "a","b","c","d" in addrs 94,95,96,97
pause 10
This write crosses a multiple of the page write buffer size. ( 3 x 32 = 96 )

Does the PICAXE recognise this and do something about it ?

Or will it fail and write "cd" to addrs 64,65 ?

Or have I got it completely wrong !! ?

Thanks,

Buzby
 

hippy

Ex-Staff (retired)
The addresses for each page are -

0 to 31
32 to 63
64 to 95
96 to ...

So trying to write "a", "b", "c", "d" to 94 will put "a" to 94, "b" to 95, "c" to 64, "d" to 65 because it crosses the page boundary and wraps back round to start of that page.

The PICAXE does nothing about this because it doesn't know what page sizes an Eeprom may have. You have to ensure your code doesn't try to write across page boundaries.
 

Buzby

Senior Member
Thanks hippy, thats made it perfectly clear.

As you say, I'm going to have to keep track of the boundarys as I write different lengths each time.
 

Buzby

Senior Member
A quick question, does the i2c simulation in PE accurately reproduce this behaviour ?
 

westaust55

Moderator
AS hippy indicates, the 24LC64 has a 32 byte page write buffer.

For completeness and information of all:

EEPROM - page size
24LC16 = 16 bytes
24LC32 = 32 bytes
24LC64 = 32 bytes
24LC128 = 64 bytes
24LC256 = 64 bytes
24LC512 = 128 bytes

I am sure folks can look this up for other EEPROM and F-RAM variants for themselves. :)
 
Top