Shop OBEX P1 Docs P2 Docs Learn Events
Simple RS232 Interface — Parallax Forums

Simple RS232 Interface

hewyhewy Posts: 3
edited 2012-05-02 11:06 in Propeller 1
I hope I'm in the right place with this question. I am new to microcontrollers and am looking for a solution to a small problem. The short version is I need to be able to receive a data stream via RS232 (one way from the source), filter for specific message packets in the data stream, and drive specific relays in response to those specific packets. The purpose for this project is to provide video camera tally light control for a switcher that has no interface for the same. The controller for the switcher communicates with the switcher via RS232 and I have access to the specific data packets that indicate switching from one source to another. The plan is to split the RS232 signal with a buffered split so the tally light controller is receive only and does not interfer with the controller/switcher connection. I am hoping the something like a BASIC Stamp with the appropriate interfaces and programming will fit the bill. Any suggestions or advice will be greatly appreciated. Thanks!

Comments

  • LeonLeon Posts: 7,620
    edited 2012-05-02 05:14
    Serial speed?
  • Mike GreenMike Green Posts: 23,101
    edited 2012-05-02 05:42
    The basic idea is good. The details depend on the serial speed as Leon mentioned and on how much time is available between packets and how complex the packets are. The Stamps are relatively slow and can't do much when there's serial data coming in at 9600 Baud or faster with no idle time to look at the packets and process them. Sometimes using a faster Stamp will do (like the BS2px), but, if the serial speed is faster than 9600 Baud, comes in continuously or nearly so, or the packets are complex, you may need to do this with a Propeller which is much faster and can do several things at the same time (like receive raw data and process it).
  • hewyhewy Posts: 3
    edited 2012-05-02 09:34
    The default for the system I'm working with is 57600 but there is not a continuous stream of data being sent as this is mostly press a button to preview a shot then press a button to take or move the fader bar to switch the preview to program. Also I am not opposed to using a propeller module. Just thought I would start here. If I need to move the question to that forum let me know. Thanks.
  • Mike GreenMike Green Posts: 23,101
    edited 2012-05-02 10:34
    You will need something like a MAX3232 or some other buffer / level converter to convert the RS232 signal levels to 3.3V logic levels.

    How many relays and what kind of rating do they need to have? You can drive 3.3V coil reed relays directly from the Propeller's I/O pins. I've used USRelays (here at DigiKey). You'll need a diode reverse connected across the coil (a 1N914 will do) to absorb the reverse voltage surge when the I/O pin is turned off. This particular relay can handle loads up to 500mA.

    I would get a QuickStart board and a QuickStart Prototyping board for the relay(s) and RS232 interface and connector. You can power the stacked boards via the USB connector that's used for programming and debugging. Once it's done, you could still power it via USB, but use a USB charger instead of the PC's USB port. If you have some other 5V supply, you can connect that directly to the board instead of using the USB power.
  • LeonLeon Posts: 7,620
    edited 2012-05-02 10:35
    You won't manage 57600 baud with a Stamp but virtually any MCU will manage it, including the Propeller.
  • JonnyMacJonnyMac Posts: 9,195
    edited 2012-05-02 11:06
    As Mike and Leon suggest, this project is better suited for the Propeller. If you only have TX and RX lines then a single MAX232-type buffer chip can handle the levels translation and "repeater" action for you. Capturing and parsing the serial data from there is pretty easy.
Sign In or Register to comment.