serin Xbee

ColinP

New Member
Hi – Decided it was time to try wireless so I bought the xbee starter kit from Revolution and some xbee’s. I used the max3232 board to check xbee's function/settings – no problems. Then used a simple counter increment program to generate numbers to transmit from the 18M2 chip to the max3232 board and used the serial terminal to view it – again no problems. The fun started when I replaced the max3232 with another 18M2 (in the correct socket!) and wrote a simple program to receive and display the counting data on a serial LCD on output 5. See code below

high 7 - Transmit code
pause 2000
loop1:
serout 7,t2400,(#b0)
pause 500
inc b0
goto loop1

pause 500 - Receive code
serout 5,n2400,("Receiving")
pause 1000
loop1:
serin 7,t2400,b6
serout 5,n2400,(254,1)
serout 5,n2400,(#b6)
goto loop1

The LCD worked fine but the receiver failed to read the incoming data properly. It starts counting immediately power is connected at 49 reaches 57 then back to 49 and it stays there! Other times it will simply display only one number between 49 and 57 and freeze on it. If I put the MAX chip back into this receiving board and use the serial terminal to view, the data is fine.

I have tried swapping/using different boards / chips /xbee units and still no change. I am using the latest version of the programming software.

Am I not using serin properly? As serout seems to work OK.

Any thoughts gratefully received.

Colin
 

hippy

Ex-Staff (retired)
Not sure why it's freezing but the numbers confirm you are sending ASCII characters. For transmit try -

high 7 - Transmit code
pause 2000
loop1:
for b0 = 10 To 20
serout 7,t2400,(b0) ' note; no #
pause 500
next
goto loop1
 

polor

New Member
Hello,
I have exactly same problem as colin, same components, same program... I checked signals, and the "electric" signal sending by picaxe emittor is different that the signal received by the other picaxe. In my opinion, XBEE changes the signal. Could you inform us about your application and the good way to follow? At the moment, I don't undersand what's happen and I'm unable to continue tests and unfortunatly I have stopped this application
thanks in advance
polor
 

ciseco

Senior Member
I hope this isn't considered advertising (i work for them), I mention because it might assist.

Your code to me looks ok, perhaps this could help debug

If you scroll right to the bottom of this page http://www.ciseco.co.uk/content/?page_id=1646

There's an X232 module, it plugs into an xbee style socket and will enable you to directly monitor what's going on with a picaxe cable.

Miles
 

ColinP

New Member
Hi - been away for a few days. Just tried your code hippy and it works fine, but still not sure why mine doesn't! But I can now make progress on my project idea's - so many thanks.
The X323 module looks very useful (and cheap!) so I will be having one - thanks ciseco.

Colin
 
Top