I'm trying to read serial data with a 20X2 set-up as an I2C slave, the master 28X2 reads the data when it is required. every 4-5 valid data sets I get 255 in place of the data. Does anybody knows why? Thanks
Slave Code:
#picaxe 20x2
init:
hi2csetup i2cslave, %10100000
main:
serin b.1,n9600,("#A"),b0,b1,b0,b2
'b0 is for the commas in the text string, #A is the qualifier
pause 50
put 0,b1,b2
pause 50
goto main
Master Code:
#picaxe 28x2
init:
hi2csetup i2cmaster, %10100000, i2cslow, i2cbyte
Read_Data:
hi2cin 0,(b0,b1)
pause 100
sertxd (#b0," ",#b1,13,10)
goto Read_Data
Slave Code:
#picaxe 20x2
init:
hi2csetup i2cslave, %10100000
main:
serin b.1,n9600,("#A"),b0,b1,b0,b2
'b0 is for the commas in the text string, #A is the qualifier
pause 50
put 0,b1,b2
pause 50
goto main
Master Code:
#picaxe 28x2
init:
hi2csetup i2cmaster, %10100000, i2cslow, i2cbyte
Read_Data:
hi2cin 0,(b0,b1)
pause 100
sertxd (#b0," ",#b1,13,10)
goto Read_Data