Shop OBEX P1 Docs P2 Docs Learn Events
BS2pe Motherboard Networking — Parallax Forums

BS2pe Motherboard Networking

jamesksujamesksu Posts: 22
edited 2011-10-06 10:42 in BASIC Stamp
Hello, I had posted a similar question on here earlier, but I would like to start a new thread addressing the problem in a different way:

I want to network 8-12 Bs2pe motherboards in a master/slaves arrangement using possibly RS485 or any alternative. Can I use the USB programming/debugging port to connect these boards in any way? I have looked at USB to 485 converters that have transceivers built in I already have my sensing robot built with the bs2pe mobo, so I would like to stick with it. I also am not interested in trying to solder any pins. Any suggestions?

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-08-19 14:48
    jamesksu,

    How immediate is your need? Do you want to power the MoBos over the network, too? The reason I ask is that I have an RS485 daughterboard that's been in development for awhile. It's not done yet, but I could fast-track it if necessary.

    -Phil
  • jamesksujamesksu Posts: 22
    edited 2011-08-19 15:29
    Phil- the need for this is somewhat immediate, and that daughterboard sounds perfect for this application. However, an issue I see is that both daughterboard sockets are filled in my prototype. A PWR-I/O that serves 3 servos and a PING))) and the TCS-230 color sensor. Any ideas?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-08-19 16:10
    That leaves two PWR-I/O headers left over, which are enough to accommodate a simple RS485 board's signal and power requirements. Just how averse are you to soldering?

    -Phil
  • jamesksujamesksu Posts: 22
    edited 2011-08-19 16:26
    If it is a necessity, then I will have to learn! Could you point me towards where the "simple RS485" board can be found and exactly how I should connect it to my PWR headers?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-08-19 17:18
    Let me get back to you tomorrow. My first idea didn't pan out: it was 3.3V only, and the headers provide 5V. I've got company coming for dinner this evening, and much remains to do.

    -Phil
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-08-20 11:12
    jamesksu,

    What Vdd are you using? 5V or 3.3V? If 5V, will your system run on 3.3V?

    -Phil
  • jamesksujamesksu Posts: 22
    edited 2011-08-20 13:00
    I believe the system can run on 3.3, as long as standard servos, the TCS230, and the PING can run on 3.3V... Can the PWR-I/O put out 3.3V? The power supply I am using is 7.5V.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-08-20 14:14
    The power provided to the 3-pin headers is always 5V, regardless of Vdd. The TCS230/TCS3200 can run at 3.3V without issue. Standard servos, running at 5V should accept a 3.3V signal without a problem. The Ping)) is more problematic, since it returns a +5V signal, and you will have to interpose a series resistor in the cable in its Sig line (white wire) to protect the BS2pe chip.

    Anyway, one solution I had in mind requires these parts:
    Parallax Proto-DB
    Samtec SQT-106-03-F-D
    Sparkfun RS485 Breakout Board
    2 ea. #4 x 1.4" spacers
    2 ea. #4-40 x 1/2" pan-head machine screws
    Hookup wire

    The Samtec socket would be installed in the Proto-DB in lieu of the one provided. You would have to be careful soldering it not to get any solder on the legs and to keep fillets to an absolute minimum. This allows the Proto-DB to be stacked between the MoBo and the PWR-I/O-DB:

    attachment.php?attachmentid=84299&d=1313874009

    That way, you can make connections to the signals (Vdd, Gnd, Rx, Tx, and RTS) required by the RS485 board. It's also possible to multiplex Rx and Tx onto one pin by connecting a 1K resistor between them and then from Tx to the Stamp pin.

    BTW, the Samtec part is the same as the "elevator socket" included in Parallax's MoBo Extrusion and Panel Set. Though not typically sold separately, Parallax may be willing to do so if they have extras in their parts inventory. If not, you can always get them direct from Samtec -- possibly even as samples. Anyway, it never hurts to ask.

    Also, an alternative to running at 3.3V would be to run at 5V and include a 3.3V regulator on the Proto-DB to power the Sparkfun board. This would require the addition of a regulator IC and a couple caps, and is very simple to do. It would obviate any issues with the Ping))) Sig line in the process, keeping the cable a clean straight-through connection.

    Does this sound like something you'd want to attempt?

    -Phil
    523 x 254 - 35K
  • jamesksujamesksu Posts: 22
    edited 2011-08-20 20:34
    Phil, first of all, thank you very much for taking the time to think this through. This definitely seems like a very plausible option. I have a few questions:

    1. To ensure I am understanding correctly, I would need to install the ProtoDB directly to the A socket on the Mobo. Then, instead of using the extender provided with the proto, I would use the other extender provided by Samtec or in the extrusion set. The extrusion socket would have to be soldered to the proto board with 12 points, correct? Then, on the proto, I'd have to solder the 5 points you describe above to the RS485 board. Finally, the PWR-I/O board would then be mounted on top of the ProtoDB. Let me know if this doesn't seem correct.

    2. So if I am occupying pins 11,12,8,9 right now with the PWR-I/O board using the 3 servos and the PING))), which pin(s) should I use for the RS485 board? Do I need to switch some of the servos or PING))) to pins A0 or A1?

    3. You mention two alternatives for getting around the 3.3V to 5V signal disparity. Which of these in your mind is an easier solution? Using the series resister on the signal line from the PING))) or adding a voltage regulator on the proto-db for the RS485 board? Again, I don't have much experience with soldering, so the easier installation the better.

    4. Where does the 485 card sit in the arrangement you attached? Would it lie directly on top of the ProtoDB? I'm not sure how familiar you may be with the Sparkfun card, but is it possible to tie into it with an RJ45/Cat5 cable?

    5. Finally, if I were to need a large quantity of these RS485 devices, say around 80-100, could Parallax possibly create these daughtercards with the RS485 mounted with the 3.3V regulator included and everything soldered for a plug and play alternative? Any increase in cost is not a huge concern.

    Thanks again.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-08-20 21:11
    1. Yes., you've got the details correct.

    2. You can use the shared pins, P2 and P3, since the TCS230/3200 board does not.

    3. If I were doing it, I'd put a 3.3V regulator on the Proto-DB and run the MoBo at 5V. It's just neater that way, instead of adding a resistor inline with the Ping))) cable.

    4. I'm not familiar with the Sparkfun card, so I can't really say if it would fit under the PWR-I/O-DB. It also depends on what kind of connector you decide to use for your RS485 cable. It does have pads to solder an RJ45 socket, and Sparkfun sells the sockets.

    5. I could do that for you. If one is available, I'd opt for an RS485 chip that was multi-voltage compatible, though, to obviate the need for an additional regulator. Let me think about that for awhile. In those volumes, there may be other viable options.

    One thing I should mention: if the additional height on the "A" side gets in the way of the color sensor, you can always put the Proto-DB under it instead of the PWR-I/O. By using P2 and P3, no wiring or programming would change.

    -Phil
  • jamesksujamesksu Posts: 22
    edited 2011-08-21 07:10
    Thanks again Phil, I guess my last question would be if I were to use the 3.3V regulator on the ProtoDB, could you possibly point me towards some sort of wiring schematic for the regulator/caps/RS485 board and which holes on the Proto-board I should use? Also, where can I purchase the regulator/caps? (Let's assume I would simply use P2 and P3, and would attach the Proto to the B-socket underneath the TCS230).

    Also, please let me know if you decide anything on mass producing these RS485 daughtercards...

    Thank you
    -Jamie
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-08-21 11:50
    Jamie,

    The regulator is an LP2950-3.3. The capacitors are 10 uF tantalums. Here's a layout you can follow, if you like:

    attachment.php?attachmentid=84355&d=1313952506

    The pink lines are connections that are made on the bottom.

    -Phil
    500 x 625 - 71K
  • jamesksujamesksu Posts: 22
    edited 2011-08-21 13:44
    Phil- that looks great, I can definitely work with that. Thanks for spelling it out for me. One last thing: there are about a billion 1k resistors on digikey, which model have you found works best for you? Thanks... Jamie
  • jamesksujamesksu Posts: 22
    edited 2011-10-05 18:53
    Phil,

    I have made recent progress with this project, mostly with the fact that I have decided to use Xbee in lieu of an RS485 setup. However, I am having issues with the BS2pe Mobo talking to pins 2 and 3. There seems to be no communication happening at all. Could this possibly be an AVR firmware issue? I am using the PWR-I/O daughtercard, and pins 8,9,11, and 12 all function properly. Thanks in advance.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-10-05 19:16
    I'm not sure what you mean by "pins" 2 and 3. There's P2 and P3, which are shared between the two DB sockets, but are not brought out on the PWR-I/O-DB. Then there's A2 (P11) and A3(P12), and B2(P7) and B3(P5), which are shared with the AVRs. If an AVR is loaded with something other than the GPIO3 firmware, it could be commandeering the A2/A3 or B2/B3 pins, preventing the Stamp from using them to communicate with the daughterboard directly.

    Can you post your entire test program, please?

    -Phil
  • jamesksujamesksu Posts: 22
    edited 2011-10-05 20:43
    I may not have explained my situation correctly. I simply have a PWR-I/O daughterboard in the A socket of the Mobo, and I have a standard servo connected to the far left set of pins (labelled A1). From the schematic, it seems that this is Port/pin 2. However, when I do a simple PULSOUT command on the servo to port/pin 2 (PULSOUT 2, 600), nothing is registered. Can the two left set of pins on the PWR-I/O (labelled A1 and A0) not function for servo control? Could they function for serial communication? If I am needing a different firmware for this situation could you point me in a direction to find it? Thank you, Jamie.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-10-05 21:12
    A0 and A1 (and B0 and B1) are connected to the AVR only. There is no direct connection to the Stamp. Since no AVR firmware for the MoBo has yet been written for controlling servos, I would recommend attaching your servos to different pins. In the same vein, there is no AVR firmware for serial I/O either. The preferred pin assignment in your case would be P8/P9 for serial I/O, and A2/A3 for servo control.

    BTW, A0 and A1 can be controlled by the GPIO3 firmware for general-purpose input and output and for 10-bit analog input.

    -Phil
  • jamesksujamesksu Posts: 22
    edited 2011-10-06 06:23
    That is unfortunate... Can firmware be written for the A0 and A1 pins to control servos or have serial I/O, or is this a process that may be too difficult for a semi-beginner like myself?

    In my setup I have a TCS-230 consuming the B socket, and then 3 additional servos, a PING))), and then 1-2 serial I/O from the Xbee device in the A socket (I can get away with simply using the serial out for the xbee, but serial in would be nice). Any other options you could think of? Could I splice together 2 servos on one control pin? I realize they would move simultaneously, but that may be an option. I would like to avoid going to a different BS2 board all together as I've investing time/money into the BS2pe Mobo, but that may be my only choice.

    Let me know and thanks in advance.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-10-06 08:12
    There are a couple simple options I can think of:
    1. On the PWR-I/O-DB cut the traces going to A0 and A1, and rewire them to connect to P2 and P3. These are common to both daughterboards, but the color sensor does not use them, so there won't be any interference.

    2. For the servos, use a ServoPAL. This will allow one pin to control two servos, and it doesn't require constant updating by the BS2pe. Although the ServoPAL typically plugs into two 1x3 headers, the row with the "Alarm" pin doesn't need to be plugged in and can simply overhang one end of the array of header pins on the PWR-I/O-DB. (See my next post.)

    Although it would certainly be possible to write a program for the on-board AVR to accommodate servos or serial I/O, and the software to do so is free, some experience with C or AVR assembly would be necessary to get the job done efficiently.

    -Phil
  • jamesksujamesksu Posts: 22
    edited 2011-10-06 09:52
    Option 2 seems to be a good solution, however I may try and work with option 1 for now. What do you see as the easiest way to solder to P2 and P3 on the Mobo?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-10-06 09:59
    #2 above is a little more complicated than that. The reason is that, on the ServoPAL, Vdd is connected in the row that includes the control input, and Vss is connected in the row that includes the Alarm output. (The assumption is that the two Vdd pins and the two Vss pins are connected on the host board.) So simply letting it overhang the headers on one end will not work by itself, since there would be no ground connection to the ServoPAL's controller. But there's a simple remedy. All you have to do is solder a jumper (e.g. a piece of resistor wire) onto the ServoPAL that connects the two grounds together, as shown in the photo below. Then it will work as I suggested.

    attachment.php?attachmentid=85723&d=1317920360

    attachment.php?attachmentid=85724&d=1317920361

    -Phil
    578 x 470 - 38K
    595 x 582 - 47K
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-10-06 10:12
    If you use option 1, make the mods to the cheap board (i.e. the PWR-I/O-DB) not the MoBo. In the photo below, cut the two traces marked with X's. Then, to each of the pins inside the rectangle, solder a length of wirewrap wire, run the wire through the circled hole to the bottom of the board, and solder the other end to it's respective A0 or A1 pin on the servo header.

    attachment.php?attachmentid=85725&d=1317921068

    (Actually, if you're careful not to output from the AVR on A0 and A1, you don't really have to cut those traces, since the respective AVR pins default to inputs with the GPIO3 firmware. If it were me, I wouldn't bother with the trace cutting, making it easier to restore the board to its pristine state at a later time.)

    -Phil
    506 x 532 - 59K
  • jamesksujamesksu Posts: 22
    edited 2011-10-06 10:42
    Perfect, this is exactly what I was looking for. I was confused by the schematic of the PWR-I/O but understand it now. Thanks for all your help again. I will upload some pictures of my project when it is complete.
Sign In or Register to comment.