A simple hello world program would be a quick and dirty way.
temp var byte
main
serout s_out,i9600,"Hello World",13]
serin s_in,i9600,[temp]
goto main
Change the baudrate to whatever baud rate your wireless adapter is set for
A simple hello world program would be a quick and dirty way.
temp var byte
main
serout s_out,i9600,"Hello World",13]
serin s_in,i9600,[temp]
goto main
Change the baudrate to whatever baud rate your wireless adapter is set for
Seems simple enough. After i program the ARC-32 I should be able to connect the Xbee’s and see the data looping using the terminal?
Not as simple as I thought. I was able to program the cardbut I’m not sure how to see the data that is being sent/recieved
Open a terminal at the bottom of Studio. Select the comport for your wireless serial adapter, select the baud rate you are usign in the program and click connect. That should do it if the correct comport is used and the correct baud rate is selected.
ok, I have tested the xbee’s with a loopback and there talking. i can connect using the terminal1 from the studio. As i can use the AT commands and get respones. I must be connecting the wireless incorrectly to the ARC-32. I’m using J4 AUX1 Header. as from the data sheet
ARC-32 -> XBee Explorer Regulated
pin 8 -> 5V
pin 7 -> GND
pin 5 -> DOUT
pin 3 -> DIN
I even tried to swap PIN’s 5 & 3
I left all the UART jumpers connected on JP5
any thing i could be missing?
Thank you for the assistance
Phil
Whats your wiring to the ARC 32 and also please post your code.
This is the code i’m using. I see the Status led blink when i run Debug
temp var byte
main
serout s_out,i9600,"Hello World",13]
serin s_in,i9600,[temp]
toggle p44 ; to see status led activity
goto main
the ARC-32 is connected to the xBee like this
I see the mistake. Your wiring looks good but you are using the wrong pin numbers for serin/serout. In fact since you are wired to the second UART pins you can use the hserial commands.
ENABLEHSERIAL2
sethserial H9600,H8DATABITS,HNOPARITY,H1STOPBITS
temp var byte
main
hserout2 “Hello World”,13]
hserin2 [temp]
toggle p44 ; to see status led activity
goto main
The TXD_2 and RXD_2 pins on the AUX header are the 2nd uart pins on the board. The S_IN and S_OUT pins are the ones going to the onboard USB to serial adapter(FTDI chip) which are the 1st UART pins.
Also, if you use software serial(serin/serout) which doesn’t use the uart functionality at all(eg no buffering) you need to use pins P36(TXD_2) and P38(RXD_2) with your current wiring.
OK, went back step by step. Using the code you posted above i wasn’t able to get it to work. so i tried the other option you said. I was able to get it working while being hard wired to the ARC-32. with and without the serin
using this code
[code];temp var byte
main
serout s_out,i9600,“Hello World”,13]
toggle p44
pause 10
; serin s_in,i9600,[temp]
goto main[/code]
I was able to connect wireless only using “NoFlow CT” I connected the xbee to JP5 - UART, Pin 1=FTDI -TXD -> DOUT and Pin 4=BAP -TXD -> DIN this was the only combination i was ble to get to work.
I need to see what i’m doing wrong for not getting serin to work
Thanks
EDIT
Changed the baud rate to 38400 and xbee pins to JP5 - UART, Pin2=BAP -RTXD -> DOUT and Pin 4=BAP -TXD -> DIN and the code below works now
temp var byte
main
serout s_out,i38400,"Hello World",13]
toggle p44
pause 10
serin s_in,i38400,[temp] :D
goto main
I’m now able to communicate wirelessly using the the 2nd UART Pins. had to change sethserial to sethserial2
[code]ENABLEHSERIAL2
sethserial2 H38400,H8DATABITS,HNOPARITY,H1STOPBITS
temp var byte
main
hserout2 “Hello World”,13]
hserin2 [temp]
toggle p44 ; to see status led activity
goto main[/code]
The light finally came on. I can now communicate wirelessly. Lesson learned
When using SERIN/SEROUT connect to JP5 UART PINS 2(BAP-RXD) & 4(BAP-TXD)
When using ENABLEHSERIAL HSERIN/HSEROUT connect to JP5 UART PINS 2(BAP-RXD) & 4(BAP-TXD)
When using ENABLEHSERIAL2 HSERIN2/HSEROUT2 connect to J4 AUX1 PINS 3(TXD2) & 5(RXD2)
Acidtech and Kurte
Thanks for your help!
When using serin/serout you can use any input/output capable pins. For example you can use P0 and P1 with serin/serout.
The JP5 header allows you to bypass the FTDI USB to Serial adapter on board the ARC-32. For ease of use I do recommend always using the TXD2 and RXD2 pins on the AUX1 header instead of pulling the jumpers off of JP5 to access the TXD and RXD pins.
I tried to see if i was comminicating whit my ARC32 and 2 XBee modules as I did previously and used the same code as in a previous post. the odd thing is now just the LED toggles and no text is displayed I tried reinstalling the Studio IDE versions 32-35 with the same results. I’m going try a full uninstall and reinstall of version 35 to include the drivers.
ripped out all traces to any previous installations. Reinstalled studio .35 and a clean driver installation. Same results.
swapped out xbee module from the PC side an everything worked. Found that the xbee module was not resetting all the setting during a restore.
reflashed the module and now everything is back to normal
So for us that don’t use XBees much if at all, the fix was to reset the settings on the XBee module attached to the ARC-32?
Yes restored to defaults.