Evening all...
I find myself having a bit of a head scratcher with Serout/Serin between a 14M2 and an 08M2
The initial idea involves an IR transmitter /receiver and I thoguht I was having problems with that.
So, I stripped everything back to what i sbasically a slightly modified version of the example code for the serout and serin command, with the Serout and Serin pins connected via a single wire.
And despite stripping it down, I'm still having problems.
Basically, it looks like the receiver code/chip is only picking up on every third byte. And everything is simplified all the way down.
I've had a look through the forum and not had much luck finding anything, so here we go:
14M2 code:
and the output to the terminal (included for debug)
And receiver chip code:
And the terminal output for the receiver:
Edit:
Found this this morning: https://picaxeforum.co.uk/threads/solving-serin-serout-problems-with-20m2-and-20x2.20342/ - it looks like it could possibly be a similar issue and that my search criteria were a litte too stringent so I'll give this a shot tonight and see how it goes.
I find myself having a bit of a head scratcher with Serout/Serin between a 14M2 and an 08M2
The initial idea involves an IR transmitter /receiver and I thoguht I was having problems with that.
So, I stripped everything back to what i sbasically a slightly modified version of the example code for the serout and serin command, with the Serout and Serin pins connected via a single wire.
And despite stripping it down, I'm still having problems.
Basically, it looks like the receiver code/chip is only picking up on every third byte. And everything is simplified all the way down.
I've had a look through the forum and not had much luck finding anything, so here we go:
14M2 code:
Code:
symbol LED = B.0
setint or %000100,%000100
for b0 = 0 to 63 ; start a loop
write b0,b0 ; write value into b1
sertxd("The value of b0 is ",#b0," b1 is ",#b1,13,10)
next b0 ; next loop
main:
low LED
pause 2000
high LED
pause 200
goto Main
interrupt:
setint off
if pinc.2 = 1 then
;high b.4
;pause 5
;low b.4
for b0 = 0 to 63 ; start a loop
read b0,b1 ; read value into b1
serout B.4,N2400_4,(b1) ; transmit value to serial LCD
;sertxd("The value in memory b0 ",#b0," b1 is ",#b1,13,10)
next b0
endif
setint or %000100,%000100
return
Code:
The value of b0 is 0 b1 is 0
The value of b0 is 1 b1 is 0
The value of b0 is 2 b1 is 0
The value of b0 is 3 b1 is 0
The value of b0 is 4 b1 is 0
The value of b0 is 5 b1 is 0
The value of b0 is 6 b1 is 0
The value of b0 is 7 b1 is 0
The value of b0 is 8 b1 is 0
The value of b0 is 9 b1 is 0
The value of b0 is 10 b1 is 0
The value of b0 is 11 b1 is 0
The value of b0 is 12 b1 is 0
The value of b0 is 13 b1 is 0
The value of b0 is 14 b1 is 0
The value of b0 is 15 b1 is 0
The value of b0 is 16 b1 is 0
The value of b0 is 17 b1 is 0
The value of b0 is 18 b1 is 0
The value of b0 is 19 b1 is 0
The value of b0 is 20 b1 is 0
The value of b0 is 21 b1 is 0
The value of b0 is 22 b1 is 0
The value of b0 is 23 b1 is 0
The value of b0 is 24 b1 is 0
The value of b0 is 25 b1 is 0
The value of b0 is 26 b1 is 0
The value of b0 is 27 b1 is 0
The value of b0 is 28 b1 is 0
The value of b0 is 29 b1 is 0
The value of b0 is 30 b1 is 0
The value of b0 is 31 b1 is 0
The value of b0 is 32 b1 is 0
The value of b0 is 33 b1 is 0
The value of b0 is 34 b1 is 0
The value of b0 is 35 b1 is 0
The value of b0 is 36 b1 is 0
The value of b0 is 37 b1 is 0
The value of b0 is 38 b1 is 0
The value of b0 is 39 b1 is 0
The value of b0 is 40 b1 is 0
The value of b0 is 41 b1 is 0
The value of b0 is 42 b1 is 0
The value of b0 is 43 b1 is 0
The value of b0 is 44 b1 is 0
The value of b0 is 45 b1 is 0
The value of b0 is 46 b1 is 0
The value of b0 is 47 b1 is 0
The value of b0 is 48 b1 is 0
The value of b0 is 49 b1 is 0
The value of b0 is 50 b1 is 0
The value of b0 is 51 b1 is 0
The value of b0 is 52 b1 is 0
The value of b0 is 53 b1 is 0
The value of b0 is 54 b1 is 0
The value of b0 is 55 b1 is 0
The value of b0 is 56 b1 is 0
The value of b0 is 57 b1 is 0
The value of b0 is 58 b1 is 0
The value of b0 is 59 b1 is 0
The value of b0 is 60 b1 is 0
The value of b0 is 61 b1 is 0
The value of b0 is 62 b1 is 0
The value of b0 is 63 b1 is 0
Code:
setint OR %00001000,%00001000 ; check for c.3 going high
symbol LED = C.0
;symbol LED = B.0
main:
low LED
pause 2000
high LED
pause 200
goto Main
interrupt:
setint off
for b0 = 0 to 63 ; start a loop
serin C.3,N2400,b1 ; receive serial value
write b0,b1 ; write value into b0 location
next b0 ; next loop
for b0 = 0 to 63 ; start a loop
read b0,b1
sertxd("The value of b0 is ",#b0," b1 is ",#b1,13,10)
next b0
pause 5
setint OR %00001000,%00001000 ; check for c.3 going high
return
Code:
[00][00]The value of b0 is 0 b1 is 1
The value of b0 is 1 b1 is 3
The value of b0 is 2 b1 is 5
The value of b0 is 3 b1 is 7
The value of b0 is 4 b1 is 248
The value of b0 is 5 b1 is 10
The value of b0 is 6 b1 is 12
The value of b0 is 7 b1 is 248
The value of b0 is 8 b1 is 15
The value of b0 is 9 b1 is 252
The value of b0 is 10 b1 is 18
The value of b0 is 11 b1 is 252
The value of b0 is 12 b1 is 21
The value of b0 is 13 b1 is 252
The value of b0 is 14 b1 is 24
The value of b0 is 15 b1 is 252
The value of b0 is 16 b1 is 27
The value of b0 is 17 b1 is 252
The value of b0 is 18 b1 is 30
The value of b0 is 19 b1 is 252
The value of b0 is 20 b1 is 33
The value of b0 is 21 b1 is 254
The value of b0 is 22 b1 is 36
The value of b0 is 23 b1 is 254
The value of b0 is 24 b1 is 39
The value of b0 is 25 b1 is 249
The value of b0 is 26 b1 is 42
The value of b0 is 27 b1 is 254
The value of b0 is 28 b1 is 45
The value of b0 is 29 b1 is 254
The value of b0 is 30 b1 is 48
The value of b0 is 31 b1 is 254
The value of b0 is 32 b1 is 51
The value of b0 is 33 b1 is 254
The value of b0 is 34 b1 is 54
The value of b0 is 35 b1 is 254
The value of b0 is 36 b1 is 57
The value of b0 is 37 b1 is 254
The value of b0 is 38 b1 is 60
The value of b0 is 39 b1 is 254
The value of b0 is 40 b1 is 63
The value of b0 is 41 b1 is 0
The value of b0 is 42 b1 is 2
The value of b0 is 43 b1 is 4
The value of b0 is 44 b1 is 6
The value of b0 is 45 b1 is 8
The value of b0 is 46 b1 is 10
The value of b0 is 47 b1 is 248
The value of b0 is 48 b1 is 13
The value of b0 is 49 b1 is 248
The value of b0 is 50 b1 is 16
The value of b0 is 51 b1 is 252
The value of b0 is 52 b1 is 19
The value of b0 is 53 b1 is 252
The value of b0 is 54 b1 is 22
The value of b0 is 55 b1 is 252
The value of b0 is 56 b1 is 25
The value of b0 is 57 b1 is 252
The value of b0 is 58 b1 is 28
The value of b0 is 59 b1 is 252
The value of b0 is 60 b1 is 31
The value of b0 is 61 b1 is 254
The value of b0 is 62 b1 is 34
The value of b0 is 63 b1 is 254
[00][00][00][00][00][00][00]
Found this this morning: https://picaxeforum.co.uk/threads/solving-serin-serout-problems-with-20m2-and-20x2.20342/ - it looks like it could possibly be a similar issue and that my search criteria were a litte too stringent so I'll give this a shot tonight and see how it goes.
Last edited: