Shop OBEX P1 Docs P2 Docs Learn Events
PST through Xbee — Parallax Forums

PST through Xbee

ThricThric Posts: 109
edited 2010-07-22 00:12 in Propeller 1
Hi all,
I finally got my pcb together today (my first one) and it workedhop.gif ! I have an xbee on it and I just got the Idea of trying to use it to connect it to the Parallax terminal with one xbee connected my computer and another xbee connected to my prop. Would this work? I'm using http://obex.parallax.com/objects/146/·for an xbee controller and it seems to start fine but when I do pst.startrxtx(xbeerx,xbeetx,0,9600) nothing shows on my screen. Any thoughts, suggestions?

Thanks

Comments

  • ThricThric Posts: 109
    edited 2010-07-12 20:55
    Not sure if I gave enought info on my setup, The Xbee I connected to my computer uses a Sparkfun USB board while the one connected on my prop I got the din, dout, gnd, and power pins connected. The xbee module themselves are a pro and I believe they are series one. This is my first time I'm using an xbee and I thought I could just get a wireless connection, the same as using a wire for PST (parallax serieal terminal), however the solution seems to be evading my mind for two days so far. Any insight is greatly appreciated!

    Thanks
  • sylvie369sylvie369 Posts: 1,622
    edited 2010-07-12 21:20
    Everything that you put into the DIN pin of one XBee should come out the DOUT pin of the other one, IF the XBee settings are correct.

    The two modules must have the same:
    CH (Channel)
    ID (Personal Area Network)

    (they should have come out of the box with matching settings, but you could verify)

    The DL of the transmitting XBee must match the MY of the receiving one, OR
    the DL of the transmitting XBee must be set to 0xFFFF (broadcast)

    (DL: Destination address lower 16 bits)
    (MY: Source address)

    You can set these things at run time using your Spin code for the XBee connected to the Prop, but the one connected to the computer must have those settings set and written to the XBee's memory. It's probably easiest for you if you set them both and write the settings to the XBee's memory. You should be able to do that using the Sparkfun board and the XCTU software (free download from Digi.com). You could use a regular terminal program instead if you preferred.

    You seem to already be aware that the XBees come out of the box set to communicate at 9600 baud - make sure that's the current setting for BD, and of course for all of your communications with the XBee (from the Prop and from the XBee to PST).


    Post Edited (sylvie369) : 7/12/2010 9:26:50 PM GMT
  • ThricThric Posts: 109
    edited 2010-07-12 22:03
    Hi, it seems like my error came from a cold joint (actually not enough solder) and I'm starting to see characters on my screen. I'll post back in a few minutes with a quick update just incase something seems to stall my progress again.

    Thanks!
  • ThricThric Posts: 109
    edited 2010-07-12 22:22
    okay back with an update.
    I'm recieving data, which I can see both on the XCTU terminal and the PST terminal however the data I'm recieveing is just random junk incorporated with some letters, mostly just periods. Heres· the program I'm using:
    CON
      _clkmode = xtal1 + pll16x
      _xinfreq = 5_000_000
    OBJ 
        XB : "XBee_Object"       
    Pub Start | value,n
        n:=0
        XB.start(3,2,0,9600)           ' XBee Comms - RX,TX, Mode, Baud
        XB.AT_Init                     ' Initialize for fast AT command use - 5 second delay to perform
        XB.AT_ConfigVal(string("ATMY"),$5) ' Set MY address to 5
        repeat
          XB.str(string("Hello! This is a test!"))
          xb.dec(n)
          N:=n+1
    

    Thanks
  • sylvie369sylvie369 Posts: 1,622
    edited 2010-07-13 03:42
    The data received are correlated with the transmissions? That is, you don't receive data when the transmitting XBee/Prop is turned off?

    Usually garbled data indicate something wrong with the baudrate/data format. Both XBees are at 9600? And the Prop code uses 9600, and the PST is set up for that rate as well?
  • ThricThric Posts: 109
    edited 2010-07-13 21:07
    Hi, thanks for the reply.

    I know that the transmissions from the prop do correlate with what I· am recieveing on either the X-CTU terminal or the PST screen, as the transmissions stop when I power down the prop.

    I double checked the settings on the xbee and both are at 9600, both terminal screens also use 9600.

    Any more pointers appreciated.

    Thanks
  • Martin HebelMartin Hebel Posts: 1,239
    edited 2010-07-22 00:12
    I don't see any delay in sending data. Put a delay in your loop to slow things down a little.

    waitcnt(clkfreq / 1000 * 1000 + cnt ) ' 1 second delay

    Looks ok otherwise.

    -Martin
Sign In or Register to comment.