serin with qualifier

the old fart

Senior Member
Hi Guys,

I have a 40x2 and a 20M2 talking to each other via URF radio units.


If I program this
20M2
serout c.1, n9600_8, ("R05","R",b8,b4,b5,b6,b24,b4,b5,b6,b24,b8)
40X2
SerIn [800], radiorx, baud2, ("R05"),b10,b11,b12,b13,b14,b15,b16,b17,b18,b19,b20,b21
all works fine.


but if I try to send with qualifier from 40X2 to 20M2 it doesn't. without qualifier it does work.
40X2
serout radiotx, baud2, ("ABCS05xxxxxxS05")
40M2
SerIn [1800], c.2, n9600_8, ("ABC"), b10,b11,b12,b13,b14,b15,b16,b17,b18,b19,b20,b21

Been trying all day, but stumped...

TOF
 

hippy

Technical Support
Staff member
I am guessing these are "ERF" modules. These will buffer input then broadcast that packet. The receiver will then take that packet and throw it out as fast as it can to the receiving PICAXE.

It could be that the rate at which the receiving ERF sends data to the 20M2 PICAXE is too fast for it to keep up.

Or it could be that the timeout just happens to have the PICAXE doing something else when data is received and so it never gets anything.

To get things working; the best way is to start simple. Send just one byte at a time, once a second, no timeouts, and check that works in both directions. Then add a single byte qualifier and test again. Build up from there.

If you have a PC connected URF or SRF USB module then you can at least monitor the data being sent to check that it is being sent and is how you expect it to be.
 

the old fart

Senior Member
Thanks Hippy,

further experimenting.

20M2
SerIn [1800], c.2, n9600_8, b10,b11,b12,b13,b14,b15,b16,b17,b18,b19,b20 ; all bytes received fine, every time.

SerIn [1800], c.2, n9600_8, ("S05"),b13,b14,b15,b16,b17,b18,b19,b20 ; never gets the data.

will try reducing data stream.
 

f2cf1g

Member
I have had this sort of behaviour in the past. It may be that the inter-byte gap in quoted strings is too short for the receiver. Upping the clock speed of the receiver is probably worth a try.
 

bpowell

Senior Member
Try having the sending unit put a short pause after the qualifier before the data...The Picaxe needs time to recognize the qualifier.
 
Top