large serial memories

Questions on control of serial busses
Post Reply
YahooArchive
Posts: 1463
Joined: Fri Oct 19, 2012 5:11 am

large serial memories

Post by YahooArchive » Sun Feb 10, 2013 8:45 pm

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



YahooArchive
Posts: 1463
Joined: Fri Oct 19, 2012 5:11 am

Re: large serial memories

Post by YahooArchive » Sun Feb 10, 2013 8:46 pm

#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)

Post Reply