not in my viewYou ought to be sending this way
addr var byte
addr= $46
i2cwrite sda,sck,addr,[opecode]
i2cread sda,sck,addr,[dat.highbyte,dat.lowbyte]
not in my viewYou ought to be sending this way
addr var byte
addr= $46
i2cwrite sda,sck,addr,[opecode]
i2cread sda,sck,addr,[dat.highbyte,dat.lowbyte]
Last edited by richard; - 17th May 2022 at 03:56. Reason: got rid of ridiculous alias names
Warning I'm not a teacher
Big thanks Richard! now it works!
here's the code:
Code:adr=$46 x=0 cnt=%0100011 i2cwrite ldta, lclk, adr, cnt pause 200 cnt=%00010001 i2cwrite ldta, lclk, adr, cnt pause 200 maik: cnt=%00010001 i2cwrite ldta, lclk, adr, cnt pause 200 cnt=%0100011 i2cread ldta, lclk, adr, [x.highbyte, x.lowbyte] pause 200 lcdout $fe, $1, dec x pause 200 goto maik
as maybe but you are still incorrect , if you use a logic analyzer you will see the transaction ends abnormallyBig thanks Richard! now it works!
wrong way
i2cwrite ldta, lclk, adr, cnt
correct way
i2cwrite ldta, lclk, adr, [ cnt ]
Warning I'm not a teacher
Well, just added these square brackets - see no difference in readings.
its best to be correct for future reference , not all i2c devices are so forgiving
Warning I'm not a teacher
Bookmarks