Shop OBEX P1 Docs P2 Docs Learn Events
Ethernet or RS232 Communication w/ Propeller — Parallax Forums

Ethernet or RS232 Communication w/ Propeller

QuadrtrFlyrQuadrtrFlyr Posts: 73
edited 2012-06-01 15:27 in Propeller 1
Hello folks,

I am currently working on a big project and am trying to decide what communication protocol I am going to use with my Propeller and a PC. My setup is as follows: A Parallax Propeller chip is going to be hooked up to the PC via either Ethernet or RS232, and it will be sending information such as flight angles and GPS coordinates to MATLAB which quickly processes the data and via my control algorithms and outputs an optimal force vector which is then transmitted to the Propeller which sends PWM signals to motors. This is all going to be done in real time so I want optimal performance.

Using FullDuplexSerial I can communicate with MATLAB via RS232 and depending on my settings (baud rates,etc) I believe I can send and receive all of these sensor/force data packets pretty fast. However I also have the option to send/receive data via Ethernet and was wondering if there are any advantages to doing this if that is even possible with the propeller. Maybe I am making things to complex, but was just curious to know if RS232 was accurate enough for my application. I would be using a 15pin RS232 cable, not to sure of the wiring just yet.

Also does anyone have any good links to the following topic: Introduction to Serial Communication with basic TX/RX for micro-controllers/PC - how protocol works, when to send, when to receive, etc/

Best,
Robert

Comments

  • jmgjmg Posts: 15,183
    edited 2012-05-24 16:31
    I would do some tests, but serial can go fast. USB granularity will be one issue, but MATLAB is likely to be slower still.
    If you focus on leading edge devices like FT2232H, that uses 480Mbd USB and can send 12MBd UART speeds, or it has a Async FIFO mode that will cost more Prop pins, but go faster still. ( 25MBytes/sec ?)
    MATLAB is likely to be the weak-link, so some PC loop-back tests with a FT2232H should give you some numbers.

    Added : I found an example of a FT232H + FPGA, which will use one of the parallel modes, and that claims 60MB/s (may be a little 'rounded up' as there is some USB overhead)

    http://www.lab-tools.com/instrumentation/soft-firm-hard-ware/FPGA_interface_to_PC/help.html
  • Mike GreenMike Green Posts: 23,101
    edited 2012-05-24 16:38
    Start with the Wikipedia article on RS232. What do you mean by "accurate" with regards to RS232?

    Ethernet is fine. You'll need some kind of interface. You could use a Spinneret or use the Spinneret as a model design for a wired Ethernet interface. For a wireless Internet connection, you're best to start with a commercial device like Roving Networks' WiFi adapters. These can connect to a WiFi access point and establish a Telnet link to another microcontroller or computer. Telnet looks to the clients on each end just like a wired bidirectional serial port. If you use a wired Ethernet connection, you'd also use Telnet as the protocol. Look at the Wikipedia article on this as well.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-05-24 17:34
    The Spin methods of the common serial drivers can't load data into a buffer faster 115200 baud (or somewhere around that speed), so it doesn't do you much good to use a faster communication protocol unless you can get the data to a cog faster than the normal serial drivers.
  • QuadrtrFlyrQuadrtrFlyr Posts: 73
    edited 2012-06-01 15:27
    Alright great thank you folks! I decided to stick with RS232 because it is simpler and Duane Degn has a good point.

    Best,
    Robert
Sign In or Register to comment.