Im tinkering with i2c. I wrote a small program just for testing. It reads adc0 and stores its value in b0, then stores b0 at b1 on my i2cslave(24LC16B). I then try to use readi2c to read the value from the eeprom and display it on my lcd readout.
main:
readadc 0,b0
i2cslave %10100000, i2cslow, i2cbyte
writei2c b1,(b0)
pause 20
i2cslave %10100000 ,i2cslow, i2cbyte
readi2c b1,(b4)
pause 20
serout 7,N2400,(254,128,#b4)
goto main
My problem is it locks up. Even just running this code in the simulator locks it up on the readi2c command. Anyone see this before?
main:
readadc 0,b0
i2cslave %10100000, i2cslow, i2cbyte
writei2c b1,(b0)
pause 20
i2cslave %10100000 ,i2cslow, i2cbyte
readi2c b1,(b4)
pause 20
serout 7,N2400,(254,128,#b4)
goto main
My problem is it locks up. Even just running this code in the simulator locks it up on the readi2c command. Anyone see this before?