use Eeprom
Johnnyfumi
Posts: 14
hi I'm trying to use an external eeprom whit my propeller board; this is 24LC1025, now i want to use it for read and write byte on it. Is there anybody can help me? I'm using the object Basic_I2C_Driver.spin i try to write binary value "%101", but i read only value "11111111". where is my fault ? [noparse];)[/noparse]
Johnny
Johnny
Comments
CON
· pippo = %101
··ACK····· =·5
· i2cSCL= 4
OBJ
· eeprom: "Basic_I2C_Driver"
· fullduplex : "fullduplex"
·
Pub Main
· eeprom.Initialize(i2cSCL)
· eeprom.Start(i2cSCL)
· eeprom.Write(i2cSCL,pippo)
· fullduplex.start(0,1,0,57600)
· waitcnt(clkfreq/4 + cnt)
· repeat 4
··· fullduplex.tx(%101)
··· fullduplex.rxflush
tankyou so much for your disponibility
Johnny
thank you for advice, i look at WriteByte and ReadByte methods but i don't understand how to use the method's parameters
WriteByte(SCL, devSel, addrReg, data)
probably SCL is a SCL pin (in my case is 4 pin), but i don't kwon more about "devSel", "addrReg" and "data" can you help me?
I have a second question, can i use this methods (ReadByte and WriteByte) whit an eeprom LC1025 or i have to choose a different device such as LC256?
thanks a lot
johnny
"addrReg" is the EEPROM address value to be used.
"data" is the byte value to be written
All of the above information is in the comments in "Basic_I2C_Driver". Please read the comments. There's a lot of useful information there
including an example of the use of the ReadPage and WritePage routines.