Shop OBEX P1 Docs P2 Docs Learn Events
Connecting 2 backpacks together using sio — Parallax Forums

Connecting 2 backpacks together using sio

Kevin BrownKevin Brown Posts: 44
edited 2012-08-23 20:11 in Propeller 1
I have 2 backpack modules that I would like to connect using the single serial line.I have one backpack module with a XBee module on it. It is working fine I've tested it with a little serial pass through program and everything works fine when communicating with the XB connected to the computer using the serial terminal. I'm trying to use the second backpack module as a remote video driver. I works just fine when I use the BS /demo what am I missing when I try to use the backpack SIO/p27 to drive it.

Comments

  • Kevin BrownKevin Brown Posts: 44
    edited 2012-08-22 16:39
    This is the code I am using, on the xbee/backpack and the stock firmware on the other backpack/terminal



    {{
    ***************************************
    * Serial_Pass_Through *
    * Martin Hebel *
    * Version 1.0 Copyright 2009 *
    ***************************************
    * See end of file for terms of use. *
    ***************************************


    Provides serial pass through for XBee (or other devices)
    from the PC to the device via the Propeller. Baud rate
    may differ between units though FullDuplexSerial can
    buffer only 16 bytes.

    }}


    CON
    _clkmode = xtal1 + pll8x
    _xinfreq = 10_000_000


    ' Set pins and Baud rate for XBee comms
    XB_Rx = 7
    XB_Tx = 6
    XB_Baud = 9600


    ' Set pins and baud rate for PC comms
    PC_Rx = 31
    PC_Tx = 27 '30
    PC_Baud = 9600

    Var
    long stack[50] ' stack space for second cog

    OBJ
    PC : "FullDuplexSerial"
    XB : "FullDuplexSerial"


    Pub Start

    PC.start(PC_Rx, PC_Tx,%1100, PC_Baud) ' Initialize comms for PC
    XB.start(XB_Rx, XB_Tx, 0,XB_Baud) ' Initialize comms for XBee
    cognew(PC_Comms,@stack) ' Start cog for XBee--> PC comms


    PC.rxFlush ' Empty buffer for data from PC
    repeat
    XB.tx(PC.rx) ' Accept data from PC and send to XBee

    Pub PC_Comms


    XB.rxFlush ' Empty buffer for data from XB
    repeat
    PC.tx(XB.rx) ' Accept data from XBee and send to PC


    {{
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-08-22 17:01
    Martin,

    Your description is a bit unclear. Could you explain in more detail exactly what is connected to what, using which ports? A connection diagram would be even better.

    Thanks,
    -Phil
  • Kevin BrownKevin Brown Posts: 44
    edited 2012-08-22 17:43
    backpack.png


    I want to connect the two backpack boards using the 3 pin header. I know I am missing something simple

    thanks
    Kevivn
    816 x 1056 - 30K
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-08-22 18:32
    Kevin,

    My apologies! For some reason I saw Martin's name in this thread.

    Anyway, the good news is that you don't need two Backpacks to do what you want. Save the extra one for another project! All you need is an XBee Adapter Board and a Proto-DB.

    The XBee adapter can be soldered into the Proto-DB sideways, making contact with Power and ground. You will want to clip off the IO0 and IO1 header pins, along with Vdd and Vss at the other ends of the two headers. Then you can connect wires between the XBee DOUT and DIN pins to pins on the daughterboard connector. The Proto-DB then simply plugs into the Backpack.

    -Phil
  • Kevin BrownKevin Brown Posts: 44
    edited 2012-08-22 19:02
    I have other uses for the second backpack and need to keep it in place.......That is how I have the xbee hooked up works great. I have a single pair cable I am trying not to replace $$$$......and ideally would just run rs485 but require new cable
  • Kevin BrownKevin Brown Posts: 44
    edited 2012-08-22 19:05
    this is more like a remote terminal / smart mux
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-08-22 19:53
    Your program should work okay. I guess I would have to see what data you're sending to it over the XBee link, since I suspect that's where the problem lies.

    BTW,

    attachment.php?attachmentid=78421&d=1297987572

    -Phil
  • Kevin BrownKevin Brown Posts: 44
    edited 2012-08-22 20:05
    just simple text typed into the parallax serial terminal running on the PC, Stop, go , right , left, up, down etc
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-08-22 20:17
    Do you have a scope or any other way to verify that data is being passed over the three-wire cable? And, BTW, how are you powering the two Backpacks?

    -Phil
  • Kevin BrownKevin Brown Posts: 44
    edited 2012-08-23 17:02
    Checked it with a scope it was dead I must have killed the pin some how.... used diff pin works fine
  • TumblerTumbler Posts: 323
    edited 2012-08-23 20:11
    Phil,
    Anyway, the good news is that you don't need two Backpacks to do what you want. Save the extra one for another project! All you need is an XBee Adapter Board and a Proto-DB.

    The XBee adapter can be soldered into the Proto-DB sideways, making contact with Power and ground. You will want to clip off the IO0 and IO1 header pins, along with Vdd and Vss at the other ends of the two headers. Then you can connect wires between the XBee DOUT and DIN pins to pins on the daughterboard connector. The Proto-DB then simply plugs into the Backpack.

    Can you translate that in a schematic? (or maybe a picture) :innocent:
Sign In or Register to comment.