Forum Update - Announcement about May 10th, 2018 update and your password.

RS232 strangeness

RaymanRayman Posts: 8,533
edited July 10 in Propeller 1 Vote Up0Vote Down
I'm trying to push RS232 at 115200 baud over 100 ft cables... I realize now, this baud is way to high for 100 ft...

But, the strange thing is that it works when I increase the fullduplexserial baud setting to 115300.
Why on earth should that make it work? Actually, I've tested from 115300 to 116000 and they all work.

I'm using a Maxim MAX3233E line driver.
Talking to a Spellman power supply.

I'm getting packets of data that are up to ~15 or so bytes long.
At 115200, the first 4 or 5 bytes are correct, but the rest are wrong.
At 115300, all better.

Transmit side seems to work at any baud, it's just receiving back into Prop that needs higher baud.
Whatever transmit chip they have must not be as powerful as MAX3233E...

Anyway, this is puzzle with a solution that doesn't seem to make sense...

Prop Info and Apps: http://www.rayslogic.com/

Comments

  • 9 Comments sorted by Date Added Votes
  • Peter JakackiPeter Jakacki Posts: 7,331
    edited July 10 Vote Up0Vote Down
    80MHz divided by 115200 is 694.444 so the actual baud rate is a divide by 694 or 695 = 115,274 or 115,108 baud. Also you will have slew rate problems affecting the shape of the signal too and if the receiver samples too far away from the center then there will be errors as in the case that both sides are not exactly the same baud rate and one higher and one lower.

    Your baud rate ticks may just be being nudged to 693 with the higher baud rate so that the actual baud rate would become 115440 which might might be closer to the Spellman baud rate :) Baud rates are only as precise as the master clock and divider.

    BTW, if you happen to drive the transmit to the Spellman at 3.3V or 5V from a logic output (inverted) you might find it works better. That's because all RS232 receivers (since around the 80's) don't actually care about a negative voltage only a high and low positive threshold of around 1.6V or so. RS232 transmitters have 300 ohms driving resistance to limit slew rate by design. CMOS outputs do not.
    Tachyon Forth - compact, fast, forthwright and interactive
    useforthlogo-s.png
    --->CLICK THE LOGO for more links<---
    Tachyon Forth News Blog
    P2 SHORTFORM DATASHEET
    TAQOZ documentation
    Brisbane, Australia
  • Interesting. ..
    Thanks!
    Prop Info and Apps: http://www.rayslogic.com/
  • Peter JakackiPeter Jakacki Posts: 7,331
    edited July 10 Vote Up0Vote Down
    BTW, Just FYI, I doubt very much that the MAX3233 is a "better" chip as the Spellman may just be a better receiver instead.

    I detest having to use so-called RS232 chips (for compliance) because IMO they are useless. Far better just to run logic levels at low impedance than the unnecessary and ineffective +/-6V typical. I have had much more success with unipolar low voltage low impedance signals than I have had with 300 ohm bipolar signals that end up with less noise immunity because of the de facto unipolar receivers from the 1488/1489 days. These receivers just switch at around 1.5V with a little bit of hysteresis.
    MAX3233%20rx%20thresholds.png

    While a proper RS232 receiver (if there is such a beast) with a negative threshold and 6V of hysteresis would have better noise immunity, it would still be crippled compared to modern solutions that can operate at much higher baud rates over much longer distances. If you don't need RS232 for compliance then don't ever use it, just make your logic input receiver capable of handling the voltage input by using a large value resistor to limit the current plus a pull-up for when it is left floating.
    1007 x 206 - 35K
    Tachyon Forth - compact, fast, forthwright and interactive
    useforthlogo-s.png
    --->CLICK THE LOGO for more links<---
    Tachyon Forth News Blog
    P2 SHORTFORM DATASHEET
    TAQOZ documentation
    Brisbane, Australia
  • Thanks. I may try this before abandoning serial for the network interface.
    So far, it looks like it may work at the higher baud, for whatever reason.

    There was one large packet that came missing several bytes.
    But, I just realized that I should be using "fullduplexserialextended" because I probably just overflowed the 16 byte input buffer on the regular "fullduplexserial"...
    Prop Info and Apps: http://www.rayslogic.com/
  • JonnyMacJonnyMac Posts: 6,036
    edited July 10 Vote Up0Vote Down
    I don't know if it will be helpful, but I've attached spin-off of FDS that I use in a laser-tag product. In that case, with XBee radios that don't have flow control (not enough pins), I need a bigger RX buffer than TX buffer. Both sizes can be set independently using constants.
    Jon McPhalen
    Hollywood, CA
    It's Jon or JonnyMac -- please do not call me Jonny.
  • Rayman wrote: »
    I'm trying to push RS232 at 115200 baud over 100 ft cables... I realize now, this baud is way to high for 100 ft...

    But, the strange thing is that it works when I increase the fullduplexserial baud setting to 115300.
    Why on earth should that make it work? Actually, I've tested from 115300 to 116000 and they all work.

    I'm using a Maxim MAX3233E line driver.
    Talking to a Spellman power supply.

    I'm getting packets of data that are up to ~15 or so bytes long.
    At 115200, the first 4 or 5 bytes are correct, but the rest are wrong.
    At 115300, all better.

    Transmit side seems to work at any baud, it's just receiving back into Prop that needs higher baud.
    Whatever transmit chip they have must not be as powerful as MAX3233E...

    Anyway, this is puzzle with a solution that doesn't seem to make sense...

    Would be interesting to see the eye-diagram at the receiving end.

    How well terminated is the signal? Do you have any termination?
  • Get you set the transmitting device to send two stop bits instead of one? It might just be a synchronization issue.

    -Phil
    “Perfection is achieved not when there is nothing more to add, but when there is nothing left to take away. -Antoine de Saint-Exupery
  • RaymanRayman Posts: 8,533
    edited July 10 Vote Up0Vote Down
    I can't adjust baud or stop bits on Spellman transmitter.
    Spellman says I could adapt to RS-485 on both ends and maybe that's a good idea...
    I do have RX and TX on separate twisted pairs, now with grounds, but I could change that and have it be differential...

    I don't have any termination anywhere...

    More testing today shows it working flawlessly at 115500 baud. So, I'm not yet feeling overwhelming pressure to do anything. The transmit and receive packets contain a simple checksum, so maybe I'm OK as is...
    Prop Info and Apps: http://www.rayslogic.com/
  • Hello!
    I've been using the MAX serial chips (RS232 type) in projects for a quite a while now. And I've noticed that sometimes there are problems exactly as advertised Ray, typically on the side of the target that's connected to the MAX232 part that I'm using. In my case the problem was solved by inserting a hardware stage to act as a delay between each TX and RX points on the chip and the target.

    We'd need to see the documentation on the Spellman rig to see why its behaving strangely like that.
Sign In or Register to comment.