Dear Sir
I want to write and read a 24LC256, but looks that the BASIC only supports i2c
memory with 8 bits address.
How i do to write 65 to 512 i2c address and read the data back from this address
?
Miguel
large serial memories
-
- Posts: 1462
- Joined: Fri Oct 19, 2012 5:11 am
Re: large serial memories
#include ' source in /Program Files/Coridium/BASIClib
SUB I2CIN ( DATApin, CLKpin, addr, OUTcnt, BYREF OUTlist as string, INcnt, BYREF
INlist as string)
The addr is the i2c device address, not the address into the serial Flash.
The memory address would be contained in the first 2 values of OUTlist
So to read location 1 location at $1234
OUTlist(0)=$12
OUTlist(1)=$34
I2CIN (DATApin, CLKpin, $A0, 2, OUTlist, 1, INlist)
SUB I2CIN ( DATApin, CLKpin, addr, OUTcnt, BYREF OUTlist as string, INcnt, BYREF
INlist as string)
The addr is the i2c device address, not the address into the serial Flash.
The memory address would be contained in the first 2 values of OUTlist
So to read location 1 location at $1234
OUTlist(0)=$12
OUTlist(1)=$34
I2CIN (DATApin, CLKpin, $A0, 2, OUTlist, 1, INlist)