Shop OBEX P1 Docs P2 Docs Learn Events
Propeller Serial Communications — Parallax Forums

Propeller Serial Communications

SCGrant327SCGrant327 Posts: 10
edited 2007-02-26 17:11 in Propeller 1
I have been looking and cannot seem to wrap my mind around the idea of doing serial (ascii AND/OR binary) comm with the propeller.

How many serial ports can we have on the serial? I see that there is one for programming, but do not see where any more are referenced. Also, looking through the forums, I see where others have more than one port....

I want to use the Propeller as a intermediate data processor for remote GPS units. In short I need two serial ports, on to talk binary to the GPS and the other to talk ASCII to an RF device.

Forgive my 'Newbie-ness'...

Comments

  • bambinobambino Posts: 789
    edited 2007-02-26 15:03
    The fullduplex object asks for tx and rx lines as part of its start method. Along with baud rate and com settings. The object can be assigned to any pins that are not being used, and to as many ports as cog resources will allow! Just look at the fullduplex object, it should clear up a lot of the mystery for you.

    Good luck.
  • SCGrant327SCGrant327 Posts: 10
    edited 2007-02-26 15:11
    Ok, Thanks for pointing me in the right Serial direction.

    Now, I am a SW Engineer and have worked with various systems from Windows to Unix to DEC to VAX with some Motorola embedded programming.

    What all do I need to get/buy to be able to get a demo unit set up for my Remote GPS project?

    I already have the RF Radio and OEM GPS units... After looking through the Propeller BUY options, I am not sure what all I need to get. Any guidance will be greatly appreciated.
  • bambinobambino Posts: 789
    edited 2007-02-26 15:19
    Depends on your prototyping habits. Do you need to breadboard or just jump in and start soldering.
  • SCGrant327SCGrant327 Posts: 10
    edited 2007-02-26 15:23
    I have not been into doing hardware, so I am not sure....

    Guess I should sit down with my hardware guy and see what he suggests we do.

    Thanks again for the serial info.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-02-26 15:24
    The Propeller can have an arbitrary number of serial ports, limited by what else you need to do. There is the FullDuplexSerial object that is in the Propeller Object Exchange. This implements a full duplex serial port and, like most Spin objects, can have multiple instances, each one occupying a cog and running independently. In addition to the cog running the "main program", you have 7 others. If you don't need them for anything else, they can all be running copies of the FullDuplexSerial driver. The "main program" interprets and transfers the data between the two serial ports (between their buffers).

    The Propeller really has no "serial ports" nor does it have a keyboard or mouse port nor a video driver. Everything is done in software. The I/O pins are all equivalent and just provide either a logic high/low output or an input depending on how they're configured by the software. There happens to be a growing library of software that implements various devices including a full-duplex serial port (good up to at least 115Kbps), a standard PS/2 keyboard interface, a standard PS/2 mouse interface, an NTSC/PAL video display for text and/or graphics, several different VGA displays (various resolutions, one with mixed text/graphics), a driver for up to 32 standard servos, floating point library, etc. These can be combined as needed (including multiple copies). For example, when I'm debugging a program that uses a keyboard, VGA display, and servo controller, I may add a TV display for debug output. As long as I have a spare cog and the necessary I/O pins, it's trivial to do.
  • bambinobambino Posts: 789
    edited 2007-02-26 15:35
    The protoboard is great for solder and a good deal price wise. All you need to program them with is the prop Clip or Plug.

    The demoboard·is quicker to get apps up and running. They use your·usb port to program with, but limit you to 8 I/O lines to customize your app with.

    The·Propstic(once soldered) can fit into a breadboard enviroment or soldered, and uses it's serial port for programing. Plus all I/O are available.
    Same goes for the PropUSB. It's basically a Propstic with USB replaced serial.

    And the PE kit is very versatile, and attractive when you consider the labs that are coming out for them. Design your circuit there and just buy the Chip by itself when your ready to build a PCB.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-02-26 15:38
    I would suggest you get a Propeller Protoboard with the accessory kit and PropPlug USB-serial adapter. Your "hardware guy" can add the two serial connectors and any necessary voltage level conversion parts (like a MAX3232 or equivalent to convert RS232 to the +3.3V signals the Propeller needs). At that point it's all software development.

    The accessory kit gets you the sockets and small parts for a VGA display and PS/2 keyboard input which will help during debugging (and even could be used for a status display in the working prototype).
  • SCGrant327SCGrant327 Posts: 10
    edited 2007-02-26 15:42
    Thanks Mike.

    I want to just jump in and get things going, but like I said, I am more into the SW side of the house than the HW... I thought that the Propeller would be the perfect platform for my project as it appears to be readily expandable.

    I downloaded the Propeller Tool and have started looking through the source included. I see where the FullDuplexSerial will be beneficial.

    Here is a quick synopsis of what I plan on doing. The GPS units can provide me with 'raw' GPS data when asked (via serial). The 'main' program will gather the raw data from the GPS, do some processing on it, and store it. There will be a Host Server that will request the processed data from the remote GPS via an RF Radio.

    Simple, but gets complex very quickly if I think too much about it.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-02-26 15:47
    The nice thing about the Propeller is that all this simultaneous processing becomes linear when you have several computers available each doing a piece of the work.
  • Martin HebelMartin Hebel Posts: 1,239
    edited 2007-02-26 15:49
    You may want to check out this thread, I posted some sample code using Extended_FDSerial illustrating how to accept and parse the GPS string.· It may help.·

    -Martin



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    StampPlot - GUI and Plotting, and XBee Wireless Adapters
    Southern Illinois University Carbondale, Electronic Systems Technologies
  • SCGrant327SCGrant327 Posts: 10
    edited 2007-02-26 15:56
    Would the Propeller starter kit be a good one to get? Looks like a good starter kit...
  • Martin HebelMartin Hebel Posts: 1,239
    edited 2007-02-26 15:58
  • SCGrant327SCGrant327 Posts: 10
    edited 2007-02-26 16:22
    Martin,

    Looks good to me. I am sure I could use your Extended_FD code to my advantage...

    I assume that with the Starter Kit, I can use any of the 'exported' pins (P0-P7) for my serial IO????
  • Martin HebelMartin Hebel Posts: 1,239
    edited 2007-02-26 16:54
    Correct, you can use any pin you like, just define which and what baud rate (4800 I think?).

    -Martin

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    StampPlot - GUI and Plotting, and XBee Wireless Adapters
    Southern Illinois University Carbondale, Electronic Systems Technologies
  • Mike GreenMike Green Posts: 23,101
    edited 2007-02-26 16:55
    Yes you can. The reason I suggested the Protoboard is that there are more uncommitted I/O pins. Although most serial ports these days use only a few handshake lines (CTS, RTS, DTR, DSR, RING, etc.), with 2 ports, that leaves only an RX, TX, and two handshake lines for each port if you're using the Demo board in the Starter Kit. If that's OK, then by all means, the Starter Kit is fine. My personal bias on a project like this, where the external hardware is simple and unlikely to change (particularly where there are cables running off into the distance), is to "nail it down" so that loose wires don't complicate the debugging process. On the other hand, it's easy enough to make two "piggyback" 3.3V logic to RS232 converters that solidly plug into the little breadboard on the Demo board and can be connected to the "exported" pins socket with short jumpers.
  • TrevorTrevor Posts: 8
    edited 2007-02-26 16:57
    I am working on a project that includes similiar functionality. As many others have stated you will need to dedicate 2 pins (1 Rx, 1 Tx) for 2-way serial communication per device that you would like to communicate with.

    For my RF communications we are using a MaxStream 9xStream RF modem, and the 2 I/O pins from the Rropeller are wired to 2 pins of a serial DB-9F connecter which is thusly connected to the RF modem, however not all serial communication is done with serial ports like the serial programming interface. My propeller communicates with several other serial devices just through wired connections to the Tx and Rx pins without using DB-9s.

    In either case, for your GPS the number of pins you will need depends on which model you plan on using. I am using a U-Blox SAM-LS GPS unit wich has 20 pins, but fortunately only 4 pins are for serial communication and there are 2 sets of Tx and Rx, so once again only 2 additional I/O pins are required on the propeller.

    As for communicating with your GPS in binary, that could be something that you want to do for your particular model, however dependent on the type of GPS you use there are often other communication protocols. The SAM-LS for example can communicate to the Propeller in standard ASCII NMEA (www.kh-gps.de/nmea-faq.htm) protocol.

    Also, Martin your extended FD code looks like it will be very helpful to me, thanks!
  • SCGrant327SCGrant327 Posts: 10
    edited 2007-02-26 17:11
    Everyone...THANKS!

    Right now, I am using the CL4490-1000 from Aerocomm...and am quite happy with it. I have not integrated it into the final product yet...just some initial setup to make sure things are working ok.

    I am not interested in using the NMEA data, as I want to do my own math on the raw GPS data.

    I suppose I will look into getting one or two of the Starter Kits and go from there.

    Trevor, I would love to see how you have things set up...software and hardware.


    The more I look at things, the more I like the looks of the PE Kit....wow, talk about possibilities!

    Post Edited (SCGrant327) : 2/26/2007 5:53:59 PM GMT
Sign In or Register to comment.