Has anyone used this 24AA256 IC?
I'm using the DS1307 memory locations at the moment and would like to change this due to the battery.
Is there another way to save data other than a SD card?
Imports I2C
Sub Main()
Const I2C_EEPROM As Byte = &HA0 ' target 24LC128 I2C EEPROM device...
Dim Value As Byte ' Value that is read back from device
Dim Address As UShort = 0 ' EEPROM address
' initialise the I2C module...
I2C.Initialize()
' write some data...
I2C.Start()
I2C.WriteByte(I2C_EEPROM)
I2C.WriteByte(Address.Byte1)
I2C.WriteByte(Address.Byte0)
I2C.WriteByte("X")
I2C.Stop()
' allow external EEPROM to write data...
DelayMS(10)
' read the data back...
I2C.Start()
I2C.WriteByte(I2C_EEPROM)
I2C.WriteByte(Address.Byte1)
I2C.WriteByte(Address.Byte0)
I2C.Restart()
I2C.WriteByte(I2C_EEPROM + 1)
Value = I2C.ReadByte()
I2C.Acknowledge(IsNotAcknowledge)
I2C.Stop()
' output the result
Console.WriteLine("Value = ", Value)
End Sub
Users browsing this forum: No registered users and 1 guest