I suggest you use a data array to send your bytes, and then you need to construct the ControlByte and address as in this example:
PeterCode:Dat VAR byte[16] i var word j var Byte SDA var PORTA.2 SCL VAR PORTA.3 CntrB var Byte Addr var byte for i = 0 to 15 lookup i, [$01,$01,$01,$3c,$3c,$3c,$3c,$3c,$3c,$08,$08,$08,$21,$21,$21,$FF], j Dat[i] = j next for i = 0 to $7F0 step 16 'End at 2048-16 = $7F0 CntrB = %10100000 CntrB.3 = i.10 CntrB.2 = i.9 CntrB.1 = i.8 Addr = i.lowbyte i2cwrite SDA,SCL,CntrB,Addr,[str Dat\16] pause 10 next




Bookmarks