Question about storing and retrieving data from EEPROM
Trying to use the i2c object to do some communication with the 24LC256 EEPROM.
I have written into the eeprom a bunch of bytes in groups of two representing a word.
I read and display the data. This works until mrkr exceeds 255.
Obviously a problem with 8bit something? mrkr is declared as a word.
From reading other i2c posts it appears there is a 256 byte limit? Page? Don't know what that means.
I don't understand what the $A0 is. I know it is the device address (this does not help me)
Is there a document that explains (deviceAddress, deviceRegister, addressbits, databits).
My thought is $A0 can only hold 256 bytes but I don't know where the next address would be?
$A1??????
thx
boyd
<subject added by Moderator>
Post Edited By Moderator (Paul Baker (Parallax)) : 1/23/2008 10:34:25 PM GMT
I have written into the eeprom a bunch of bytes in groups of two representing a word.
I read and display the data. This works until mrkr exceeds 255.
Obviously a problem with 8bit something? mrkr is declared as a word.
From reading other i2c posts it appears there is a 256 byte limit? Page? Don't know what that means.
I don't understand what the $A0 is. I know it is the device address (this does not help me)
Is there a document that explains (deviceAddress, deviceRegister, addressbits, databits).
My thought is $A0 can only hold 256 bytes but I don't know where the next address would be?
$A1??????
repeat eepromdata.byte[noparse][[/noparse]0]:=i2c.readLocation($A0,mrkr,16,8) waitcnt(clkfreq/200 + cnt) eepromdata.byte:=i2c.readLocation($A0,(mrkr+1),16,8) waitcnt(clkfreq/200 + cnt) mrkr := mrkr + 2 LOOK AT EEPROMDATA
thx
boyd
<subject added by Moderator>
Post Edited By Moderator (Paul Baker (Parallax)) : 1/23/2008 10:34:25 PM GMT
Comments
Are you sure that mrkr is declared as a word? Your problem would make perfect sense if mrkr were declared
as a byte.
Download a datasheet for the EEPROM you're using (24LC256). There's a section that describes the meaning of
each of the bytes transferred from the Propeller to/from the EEPROM including the $A0. You should also read the
comments in the I2C object.
The notion of page applies only to writing, not reading. The datasheet goes into detail on this.
If page stuff refers to writing perhaps therein lies my problem. I write more than 256 bytes.
The loop below writes 50 two byte datasets three times for a total of 300 bytes (offset by header).
Paged writes are not used by writeLocation.· Essentially they let you write a block of data in one 5-10ms write cycle.
·
THX Mike
I still need to read the documentation, always good to have an understanding...
boyd
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
A0 is used as bit 17, when transmitting the device address.
I am not aware of specific differences wrt the 24C512...