My first serin-serout between two picaxe

Benjie

Senior Member
I made my first serial connection between two 28X1 via a 330 ohm resistor.
The transmitter has a line code:"serout 0,N2400_8,("ABC",#b6,#b8,#b3,#b7)"
intended to transmit 4 byte variables.
The receiver has a code:
[/code]
serin 3,N2400,("ABC",b1,b2,b0,b4)
sertxd (#b1," ",#b2," ",#b0," ",#b4,CR,LF)
pause 200
[/endcode]
intended to store the received variables into b1,b2,b0 and b4 and display them on the computer.
Both circuits operate at 8MHz and have common supply.
The problem is that the sertxd does not give any output.

Are the used pins (outpin 0 and input pin3) suitable for serial communication or should I use input pin 7 and 6 respectively with the hserin hserout commands?
 

Jamster

Senior Member
Possibly:

1) you send data as asci
2) you receive as a number
3) you send as asci

so send A you get 65 at the receiving PICAXE and then it trys to put 65 in to asci. which probably is what is wrong.

try:
Code:
serin 3,N2400,("ABC",b1,b2,b0,b4)
sertxd (b1," ",b2," ",b0," ",b4,CR,LF)
pause 200
 

westaust55

Moderator
Also note that with the SERIN command only the qualifier part is within the brackets, not the variables for data being received

serin 3,N2400,("ABC"),b1,b2,b0,b4
 
Last edited:

hippy

Technical Support
Staff member
Westaust55 has found the main problem of there being nothing received, and Jamster has noted the other problems. Start with something simpler ...

Transmitter:
Do
SerOut 0, N2400, ( "ABC", b0 )
b0 = b0 + 1
Pause 1000
Loop

Receiver:
Do
SerIn 3, N2400, ( "ABC" ), b0
SerTxd ( #b0, CR, LF )
Loop
 

Benjie

Senior Member
Hippy,
I copied your code suggestion but nothing comes from sertxd. Just checked also the wiring:
the transmitter uses outpin 0 for sertout connected via a series 330 ohm resistor to input pin 3 of the receiving 28X1.
Both units operate correctly when loaded with their respective codes.
Later in the day I will check with a scope if something comes out of the transmitter and I'll refer back.
 

Benjie

Senior Member
Hippy and Westaus,
found the problem.....a stupid cold solder joint. Now I have a servo problem that I will address in a new thread.
 
Top