toxicmouse
Senior Member
Simple serial problem:
I just want to send a serial message between 2 picaxe 18M2s.
Transmitting picaxe is on a breadboard with nothing but the components for programming it (22k, 10k,socket), one LED to let me know it is working and a 15cm twisted pair of wires, one is grounded, the other is connected to c.3 (I also tried c.0)
For the receiver I have a CHI030 project board with a 18M2 with the incoming wire connected to c.4
both chips use the same power supply, 5V from the same USB port.
the part that baffles me is that with this arrangement the receiving picaxe does not sertxd any message to the terminal window. When I disconnect the wire between the picaxes then the receiver displays "Nix #b1" nicely (the no_serial: part of the code).
Any idea what I am doing wrong?
I just want to send a serial message between 2 picaxe 18M2s.
Transmitting picaxe is on a breadboard with nothing but the components for programming it (22k, 10k,socket), one LED to let me know it is working and a 15cm twisted pair of wires, one is grounded, the other is connected to c.3 (I also tried c.0)
Code:
'transmitter
b0 = 0
main:
low c.3 'bring the line low momentarily
pause 25
serout c.3,N1200_4, (b0)
b0 = b0 + 1
'flash the LED once
low b.4
pause 100
high b.4
pause 100
goto main
Code:
'receiver
b1 = 0
main:
b0 = 0
serin [250,no_serial], c.4,N1200_4, (b0) 'if no serial message received then goto no_serial
sertxd ("received:",#b0,cr,lf)
goto main
no_serial:
sertxd ("Nix ",#b1,cr,lf)
b1 = b1 + 1
goto main
the part that baffles me is that with this arrangement the receiving picaxe does not sertxd any message to the terminal window. When I disconnect the wire between the picaxes then the receiver displays "Nix #b1" nicely (the no_serial: part of the code).
Any idea what I am doing wrong?