Shop OBEX P1 Docs P2 Docs Learn Events
Propeller to SX48 Serial Comms — Parallax Forums

Propeller to SX48 Serial Comms

djh82ukdjh82uk Posts: 193
edited 2008-08-14 22:52 in Propeller 1
Hi Guys

This may just be me but I have spent the last 30 mins looking for circuit diagrams for interfacing a Propeller protoboard to a SX48 protoboard for serial comms between them.

Basically I want one propeller board sending data to any number of SX48 boards, then having the sx boards listenning and ignoring all data that is not meant for them. I presume this is possible?

Can any one advise on the circuit?

If I wanted the SX boards to reply I guess that would be a potential problem?

DJH

Comments

  • LeonLeon Posts: 7,620
    edited 2008-08-12 10:27
    RS-485? Half-duplex comms only needs two wires (and ground).

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • djh82ukdjh82uk Posts: 193
    edited 2008-08-12 23:15
    Hiya

    Any links to diagrams?· I dont know what components or pins I need

    Thanks

    DJH
  • AribaAriba Posts: 2,687
    edited 2008-08-13 03:05
    Here is a possible circuit.
    As you mentioned, sending from the SXs to the Prop is more difficult: 1) You have to use OpenCollector Outputs, and 2) you must be shure that only 1 SX sends at a time (i.e only as a respond to a command from the prop).
    An OpenCollector output can be done with the SX by sending a LOW as normal LOW output, but a HIGH as "switching to input", the PullUp then makes the line high. This prevents short circuit between SX outputs.

    Andy
    300 x 200 - 2K
  • KenFordhamKenFordham Posts: 12
    edited 2008-08-13 03:15
    For RS-485 information, you should check out a book by Jan Axelson called Serial Port Complete. This book has more information about serial communications than you ever wanted to know.

    One of the great features of RS-485 is that you can have devices separated by long distances. Up to 4000 feet I believe.
  • djh82ukdjh82uk Posts: 193
    edited 2008-08-13 10:42
    but is the 3.3v to 5v not going to cause a problem? does anyone have an actual diagram of components or can you use the serial circuit used for downloading etc?

    really after some help here
  • StefanL38StefanL38 Posts: 2,292
    edited 2008-08-13 18:50
    hello,

    the different voltages is not really a problem

    There is a thread discussing HOW TO SAFELY INTERFACE A 5V SIGNAL TO THE PROPELLER?
    http://forums.parallax.com/showthread.php?p=585920

    If you want to make it really professional use a voltagelevelshifter

    All 32 IO-PINs of the propeller are general purpose and can be used exactly the same way.

    PIN 28,29 and PIN 30,31 have special functions in the bootphase but after that these Pins are all the same like all the others
    So you are free to use PINs however you like. The serial interface is build COMPLETELY in software

    best regards

    Stefan
  • djh82ukdjh82uk Posts: 193
    edited 2008-08-13 19:36
    but are the pins for serial tied low or high? how many pins are needed? etc
  • Mike GreenMike Green Posts: 23,101
    edited 2008-08-13 19:54
    For the simple case of a Propeller sending a serial data stream to a number of SX processors that are physically close (within a few feet), all you need is a Propeller I/O pin with a 330 Ohm resistor attached to it. The other end of the resistor goes to the SX I/O pins and to a 10K resistor tied to +3.3V. There should be a common ground for the Propeller and all the SX processors.

    The 330 Ohm resistor limits the fault current to the Propeller if something should be hooked up wrong or if the SX is mis-programmed so it's trying to output when the Propeller is doing the same. The 10K resistor provides a pullup to +3.3V for the SX input pins.

    For an I/O driver, you can use any Propeller serial I/O driver depending on your other needs. Simple_Serial will work as will FullDuplexSerial or its variations.
  • RobotWorkshopRobotWorkshop Posts: 2,307
    edited 2008-08-13 20:00
    Another option is to run the SX48 at 3.3v as well as the Propeller.
  • djh82ukdjh82uk Posts: 193
    edited 2008-08-14 11:15
    Thanks for that Mike, you say to have the SX pin pulled up with a 10k resistor to 3.3v, but the there are only +5v points on the SX board as it run at 5v.


    Do you mean this 10k reduces the 5v to 3.3v or do you mean it is pulled high on the prop side.

    If so, before or after the 330ohm resistor. (I only have 270R here, but should suffice for a bit of protection?)


    Thanks

    DJH
  • StefanL38StefanL38 Posts: 2,292
    edited 2008-08-14 16:51
    hello,

    if the ground of Prop and SX are connected to each other, any voltage taken from any point of the prop or the SX48-circuit and connected to any point of Prop or SX48 will be the same.
    This is why ground is sometimes called COMMON.
    If the ground of any powersupply is NOT connected to the ground of Prop/SX48 the voltage at +XV of the powersupply could be anything and things are NOT working properly
    This is the same if ground of Prop and SX48 are NOT connected to each other.

    You connect one end of the 10k-resistor to the SX-serial-Inputpin and the other end to the +3.3V.

    This means as long as the Prop-IO-pin is configured as output and switched to LOW =0V the SX48-Pin "sees" LOW
    If you switch the Prop-Pin to HIGH = 3.3V there will be 3.3V at the SX48-Pin and the voltagelevel of 3.3V should
    be enough that the SX48 detects a HIGH. Even if the SX48 is supplied with 5V.

    Connect the 10k-R nearer to the Prop. If the prop-PIN is switched to low=0V there will be 0V at the SX48-pin
    if connected nearer to SX48 you have a voltagedivider built from the 10k and 330-resistor and there will be
    a voltage greater than 0V at the SX48-pin. It is 3.3V / (10k +330) * 330 = 0,105V not much but higher than 0V

    best regards

    Stefan
  • AribaAriba Posts: 2,687
    edited 2008-08-14 22:18
    OK, here an extended version of the above schematic. It is modified for safety. And you don't need OpenCollector outputs at the SX now, that do the diodes for you.

    If an Input Pin of the SX is in TTL mode then the switching level between LOW and HIGH is around 1.4 Volts. The Propeller outputs nearly 3.3V for a HIGH which is much over 1.4V.
    The SX outputs 0V for LOW or 5V for HIGH, but the diodes and the PullUp translates this to 0.7V | 3.3V at the Propeller input. Also for the Propeller the switching Voltage is around 1.4 V, so this shoud work well.

    Andy
    300 x 200 - 2K
  • djh82ukdjh82uk Posts: 193
    edited 2008-08-14 22:21
    thats great thanks

    I will give it a go, with the diodes like that, how can the SX xmit anything past the diodes facing them? Just curious how that part works

    Thanks

    DJH
  • AribaAriba Posts: 2,687
    edited 2008-08-14 22:52
    As you probably know, the diode is a device which lets current flow only in one direction. That is: if the voltage on the Anode of the diode is higher then the volatge of the cathode, the diode lets current flow. If the cathode side is higher, the diode lets no current flow. (Anode is the triangle side of the symbol, and cathode is the bar side).

    So if the SX outputs 0V (a LOW), current flows thru the 4.7k PullUp and the diode, and at the propeller input you have around 0.7 V (which is the saturation voltage of a diode). If the SX outputs 5V (a HIGH), the Cathode is higher then the 3.3V on the Anode, and the diode is like an open switch, so you have 3.3V in this case.

    Andy
Sign In or Register to comment.