Shop OBEX P1 Docs P2 Docs Learn Events
serial communication max speed. — Parallax Forums

serial communication max speed.

DXCDXC Posts: 33
edited 2010-10-26 00:17 in Propeller 1
Hello all,

I have a question according to the rs232 communication.

What is the maximum speed or RS232? Can the prop communicate with a speed of 921600?
I saw the code where the clock speed is devided by the com speed, for example 19200 baud.

by deviding the clock with 19200 the speed will not be accurate. When going to higher speeds like 921600 the timing will be more wrong?

Is it true what I said above?

gr,

Comments

  • kwinnkwinn Posts: 8,697
    edited 2010-10-23 08:23
    It depends on the distance and environment. True RS232 (+/-3V to +/-25V signal levels) has speed and distance limits due to noise pickup, line capacitance, and signal loss. While it might be possible to send data at 921600 baud over very short distances (inches at most) it is not practical for longer runs.
    At 921600 baud the bit time is 1.085uSec so the receiver has to detect the leading edge of the start bit and then sample each of the following bits in the middle of the bit time. That means the first bit needs to be sampled at 1.63uSec, and each following bit sampled 1.085uSec after the previous bit. The timing is tight but the hardware can do this relatively easily (the prop can do it in software), the problem is with the signal. It is very susceptible to noise and distortion.
  • RavenkallenRavenkallen Posts: 1,057
    edited 2010-10-23 08:38
    It also depends on the object you wish to use. Parallax Serial Terminal can transmit/receive at 250Kbaud or transmit only at 1 Megabaud...You will have to choose which serial driver you want.
  • DXCDXC Posts: 33
    edited 2010-10-23 09:18
    Thnx for the fast responce.

    The distance will be less then an inch for shure.
    The speed I can chose from are:
    19200 - 921600

    I could not find the max speed when I use fullduplex for example.
    I looked in the spin software but could not find what the max baudrate is which I could use.

    gr,
  • charleyshfcharleyshf Posts: 165
    edited 2010-10-23 09:53
    Hello,

    I've been trying to get my prop to talk to a another device at 921,600 baud for a while now, the best I have been able to do using FDX is 250,000, I have less than 3 inches of wire between the prop and the device(going to run shorter wire today to test).

    Take at look at this thread here:

    http://forums.parallax.com/showthread.php?t=126471
  • pjvpjv Posts: 1,903
    edited 2010-10-23 10:13
    Hi DXC;

    As Charleyshf confirmed, FDX will not run at 921600. It might sort of run at half that speed, but each byte received is subject to sample timing alignment, and will output a lot of false data. At one quarter things get much better, but still not bullet proof. Slower than that will be OK.

    Read the thread suggested by Charley.

    Cheers,

    Peter (pjv)
  • DXCDXC Posts: 33
    edited 2010-10-23 16:12
    This is why I mailed.
    Finding it hard to believe that the prop can make a good timing with 900Kbaud.

    So 230400baud is the maximum speed with FDS?

    What is the best way to connect the rx and dx.
    33 Ohm resistor is serie?

    gr,
  • BeanBean Posts: 8,129
    edited 2010-10-23 16:32
    I have an application that sends data at 921600 baud to a PC with no problem.
    It is written with PropBasic.

    Bean
  • pjvpjv Posts: 1,903
    edited 2010-10-23 16:55
    Hi DXC;

    As Bean indicated there are other routines that will run at higher speeds. I run some as high as 10Mega bits per second although for that I do not use the standard ASCII protocol.

    However, you referenced Full Duplex, and I took that to mean the Spin program from the OBEX, and that will not run at 921,600.

    I have now altered (but not tested) the Full Duplex assembly portion of the code, and I believe it will now just barely run 921,600, and perhaps not totally reliably.

    See my post about this.

    Cheers,

    Peter (pjv)
  • kwinnkwinn Posts: 8,697
    edited 2010-10-23 17:37
    There seems to be some confusion regarding RS232 and other serial protocols. RS232 is a single ended voltage based protocol that has a ground and a signal line that goes between +-3V to +-25V levels to indicate 0 and 1 bits. There are several other protocols (RS422, RS485, SPI, I2C, Ethernet, etc.) that provide more reliable and higher speeds than RS232. Of these protocols RS232 is probably the worst choice for high speed communications between systems. It is however simple, common, and relatively well understood.
  • Cluso99Cluso99 Posts: 18,069
    edited 2010-10-23 17:55
    As kwinn was getting to... Are you really talking about RS232 or just connecting serial without driver/receivers (i.e. what we used to call TTL). The drivers and receivers have limits to what they run at. The cable and length also impact this. There is RS232 through to RS232E specifications.

    I am presuming you are talking about the TTL equivalent using these short distances - that means, no real drivers/receivers, but just going prop pins to some other processor or device.

    Here, the issue becomes the micros performance which of course includes the software on both ends. Assuming the other end is capable of 1Mb(used instead of the actual multiple) then there are various ways for the prop to achieve this accurately by software.

    The FDX software will not run at this speed because as has been said elsewhere, the software does a pin-pong between transmit and receive. There are better objects available which do higher speeds, but most will likely use 2 cogs, 1 for transmit and 1 for receive at speeds around 1Mb and above.

    As for accuracy of the signal, the prop is not using a multiple divide by 2 to calculate the frequency, so it can be accurate with the right software. For instance, FDX will happily run at 100,000 baud - most UARTs cannot do this speed because it is not a multiple of 300 time 2^n.

    I hope this helps you to rephrase your question if this does not answer it.

    Postedit: fixed the following details - thanks kuroneko to pointing me to link.
    BTW Beau has published an ultra high speed prop to prop comms that runs at 14.5Mb. http://forums.parallax.com/showthread.php?p=691952#post691952
  • HannoHanno Posts: 1,130
    edited 2010-10-24 12:33
    ViewPort has been doing 2Mbps full-duplex to/from the PC for 3 years now. This allows video streaming as well as fast transfer of data. The conduit object is also used by PropScope to provide fast update rates and 12Blocks to support live changes to a program. I've had 3Mbps working but have had issues on the pc side...
    Hanno
  • Cluso99Cluso99 Posts: 18,069
    edited 2010-10-24 17:52
    Hanno: Yes I keep forgetting about your code. Thanks for chiming in.

    BTW I see you are still being shaken over there! (Hanno is in New Zealand and they are still receiving large earthquakes)
  • DXCDXC Posts: 33
    edited 2010-10-25 10:16
    Hello all,

    Well I communicate to another chip next to the prop.
    Layout is allmost finished.
    (the wires are less then 1 inch long.)

    The signal levels are 0V and 3.3V.
    I have tested it with an ft232 at speed I mentioned which worked.

    FDX is what I use now, if I knew about a faster one which would use more cogs that would be better, but I'll stick with FDX.

    I used rs232 communication because the chip which communicates with the prop has rs232 and no other communication.
    Next to rs232 I use I2C to communicate with other chips.

    thnx for all the explanation!

    gr,
  • Bill HenningBill Henning Posts: 6,445
    edited 2010-10-25 10:26
    ViewPort also does 1Mbps full-duplex with:

    SerPlug, Morpheus/Mem+, PropCade and some unreleased boards of mine :)

    The above was with 1Mbps capable USB<->RS232 adapters plugged directly into the DB9F on the above boards.
    Hanno wrote: »
    ViewPort has been doing 2Mbps full-duplex to/from the PC for 3 years now. This allows video streaming as well as fast transfer of data. The conduit object is also used by PropScope to provide fast update rates and 12Blocks to support live changes to a program. I've had 3Mbps working but have had issues on the pc side...
    Hanno
  • HannoHanno Posts: 1,130
    edited 2010-10-26 00:17
    Hey Cluso!
    Yes- still rocking and rolling over here. It's been 6 weeks since the 7.1 quake- and we've had something like 1000 aftershocks that you can feel- magnitude 3+. We've also had roughly one 5.x magnitude per week to keep us on our toes. People are getting very tired of them- but we did manage to throw a pretty cool party- 140,000 people attended a free concert- not bad for a city with population 400,000!
    Hanno
Sign In or Register to comment.