Shop OBEX P1 Docs P2 Docs Learn Events
Baud Rate for serial communication to terminal — Parallax Forums

Baud Rate for serial communication to terminal

DFDF Posts: 10
edited 2010-07-30 17:45 in Propeller 1
What's the fastest baud rate for serial communication with the terminal using spin?
I have been able to use 250000, but nothing higher.
Also is 250000 any different than using 230400? I was under the assumption that the baud rates had to be multiples of 1, 2, 4 or 8 of 115200

Comments

  • Dave HeinDave Hein Posts: 6,347
    edited 2010-07-30 14:59
    DF,

    The answer to your question depends on what the Spn code is doing.· If the spin code sits in a tight loop calling ser.rx and then storing it in a buffer then the answer is somewhere between 57,600 and 115,200.· Of course, this assumes there are gaps between each block of data so you can actually do something with the received data.· If you process the data in the receive loop the rate will be lower.

    I have looked at this in the past, and it is possible to get much higher throughput by doing a block read.· The serial objects in the OBEX don't have this feature, but I could provide you with a routine to do if you want.· A block read will allow burst transfers of greater than 1 mbps.

    Dave

    ·
  • kwinnkwinn Posts: 8,697
    edited 2010-07-30 15:08
    There is no reason a baud rate has to be any specific unit or multiple of a unit. It can be any rate you want as long as the sending and receiving units use the same rate. The baud rates in use now are industry standards that allow devices from various manufacturers to be connected.
    Most standard serial devices I have worked with use a baud rate that is a power of 2 multiple of 300 (ie 300, 600,1200, .... 38400) then continue from 115200. There may be devices that use baud rates between 38400 and 115200 but I have never encountered one.
  • Bobb FwedBobb Fwed Posts: 1,119
    edited 2010-07-30 15:32
    I use fullduplexserial in prop-to-prop communication that runs at clkfreq / 296. So at 80MHz that is 270270. But I think you can run up to about 274K or so. I've run 337837 baud at 100MHz.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    April, 2008: when I discovered the answers to all my micro-computational-botherations!

    Some of my objects:
    MCP3X0X ADC Driver - Programmable Schmitt inputs, frequency reading, and more!
    Simple Propeller-based Database - Making life easier and more readable for all your EEPROM storage needs.
    String Manipulation Library - Don't allow strings to be the bane of the Propeller, bend them to your will!
    Fast Inter-Propeller Comm - Fast communication between two propellers (1.37MB/s @100MHz)!
  • DFDF Posts: 10
    edited 2010-07-30 15:48
    Dave Hein said...
    DF,


    I have looked at this in the past, and it is possible to get much higher throughput by doing a block read. The serial objects in the OBEX don't have this feature, but I could provide you with a routine to do if you want. A block read will allow burst transfers of greater than 1 mbps.



    Dave

    Dave, my spin code will be reading information from another cog and outputting it. The income data sets are from an A/D and are around 600 bytes long. I'm looking to output each data set as quickly as possible so I can collect another. Ideally I'm looking to collect around 30 data sets a second. Will a block write transfer data as quickly as a block read? The routine you mentioned sounds very helpful if it will.
  • Dave HeinDave Hein Posts: 6,347
    edited 2010-07-30 17:45
    600*30*8 = 144,000 bits/second for the raw data.· With a start and stop bit per byte this is 180,000.· So, according to Bobb's numbers FullDuplexSerial should be able to handle this.· To handle this rate in Spin you will need to do a block read or write.· This uses bytemove to transfer multiple bytes at a time into and out of the serial buffers.· The serial driver uses circular buffers, so you will have to handle the wrap-around.

    Dave
Sign In or Register to comment.