Dear forum,
I'm sending simple single byte from a 28x2 to a 20x2 using hi2cout which works without any problems. I can't however seem to read the status of a memory location when using hi2cin.
The code below is just for test and I have proven the byte variable changes in the slave. Is there something I'm missing?
Just for completeness I have both clock and data lines tied high with 10k resistors also.
Many thanks in advance.
Master code
Slave code:
I'm sending simple single byte from a 28x2 to a 20x2 using hi2cout which works without any problems. I can't however seem to read the status of a memory location when using hi2cin.
The code below is just for test and I have proven the byte variable changes in the slave. Is there something I'm missing?
Just for completeness I have both clock and data lines tied high with 10k resistors also.
Many thanks in advance.
Master code
Code:
#picaxe 28x2
setfreq m8
hsersetup B38400_8, %001
hintsetup %00000111
hi2cSetup i2cMASTER, %10100000, i2cSLOW, i2cBYTE
Main:
pause 300
bptr=60
hi2cin b1,(@bptrinc,@bptrinc,@bptrinc,@bptrinc,@bptr)
pause 100
hserout 0,("bptr=",#@bptr,13,10)
goto Main
Code:
#picaxe 20x2
let dirsC=%00001111
pinsC=$FF
hI2cFlag = 0
init: hi2csetup i2cslave, %10100000
let pinsC = %11111111 'Relays OFF
main:
'bptr=57
pause 1000
let pinsC = %11111111 'Relays OFF
b1=0
pause 1000
let pinsC = %11111110 'Relay 1 ON
b1=1
'@bptr=1
pause 1000
let pinsC = %11111101 'Relay 2 ON
b1=2
'@bptr=2
pause 1000
let pinsC = %11111011 'Relay 3 ON
b1=3
'@bptr=3
pause 1000
let pinsC = %11110111 'Relay 4 ON
b1=4
'@bptr=4
goto main