CommanderLake
Member
I'm trying to use the serial terminal to get a 08M2 to relay commands to an I2C device but it wasn't transmitting anything so to troubleshoot I'm trying to output the exact data it received back to the terminal and the data the 08M2 transmits is completely unexpected and makes no sense.
I'm also decoding the serial data with a Picoscope to verify the data.
This is the program:
I'm trying to send it 36,1,1 in the terminal and it sends back:
which I can verify with the Picoscope, then the 08M2 restarts.
Why is serout corrupt after using serin?
I'm also decoding the serial data with a Picoscope to verify the data.
This is the program:
Code:
;C.0 = display out
;C.1 = I2C SCL
;C.2 = I2C SDA
;C.3 = button
;C.4 =
;C.5 =
#picaxe 08M2
high C.0
pause 2000
setfreq m32
;pullup %00001110
symbol baud=T38400_32
serout C.0,baud,(128)
pause 1
serout C.0,baud,("DAC ")
pause 12
serout C.0,baud,(192)
pause 1
serout C.0,baud,("DAC ")
pause 12
main:
serin C.5,N38400_32,b0,b1,b2
pause 4000
serout C.0,baud,(128)
pause 1
serout C.0,baud,("DAC ",b0,b1,b2)
pause 12
;hi2csetup i2cmaster, b0, i2cfast_32, i2cbyte
;hi2cout b1, (b2)
goto main
Code:
000 000 000 000 000 000 000 000
000 000 000 000 000 000 000 000
000 000 000 000 000 000 000 000
000 000 000 000 000 000 000 000
000 000 000 000 000 000 000 000
000 000 000 000 000 000 000 000
000 000 000 000 000 000 000 000
000 000 000 000 000 000 000 128
128 000 128 000 128 000 128 000
Why is serout corrupt after using serin?