RS232 strangeness
Rayman
Posts: 14,646
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...
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...
Comments
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.
Thanks!
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.
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.
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"...
Would be interesting to see the eye-diagram at the receiving end.
How well terminated is the signal? Do you have any termination?
-Phil
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...
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.