EEMan
Newbie level 3
- Joined
- Mar 7, 2013
- Messages
- 3
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 1,283
- Activity points
- 1,331
Hi All,
I'm having quite a problem with a RS-232 interface to a PC-104 PC used in an motor control application. I'm trying to upgrade an old PC to a newer PC. The RS-232 link worked fine with the older PC; however the new PC receives data incorrectly with the exact same link. I checked the baud rate, which is the same on both sides, 38400 bps. I checked that nothing in the new PC's bios was different, and didn't see anything.
Looking at the scope, I didn't see any noise or anything else out of the ordinary. Voltage levels, +/-6V, looked good, and the rise time was 13V/us, well under the limit of 30V/us. No large noise spikes either. Checking the logic analyzer, it appears that the proper data is being sent and received. On the software side, it is clear that the data that appears good on the RX line is being misinterpreted by the UART. Sometimes data in the same location in the stream is read with an extra 0 inserted at the LSB end, causing a shift and parity error. It is almost as if the start bit negedge is being detected earlier than it should be. Other times a char at the aforementioned location is shifted and a bit is inverted. More rarely I get a checksum error. I also never saw a overflow flag set and I received the remaining data correctly past the incorrect part. So I don't think it is overflow problems. LSR also showed that the data was available when it was retrieved, so I don't think it is an issue of reading the value too quickly.
To isolate the cause I tested the RS-232 ports on both equipment separately with a laptop and terminal program using the same RS-232 settings. Both the old board and new PC work correctly when tested in this manner. It seems as if only when they are connected there are communication issues.
The only thing I saw that was concerning was variation of the bit period on the RX line from the old board. I saw variations of 4-8 us for a 26us bit period. But even if this were a problem it doesn't explain why the old board worked with the old PC-104 PC and my laptop.
Any help would be greatly appreciated. :wink:
Thanks,
EEMan
I'm having quite a problem with a RS-232 interface to a PC-104 PC used in an motor control application. I'm trying to upgrade an old PC to a newer PC. The RS-232 link worked fine with the older PC; however the new PC receives data incorrectly with the exact same link. I checked the baud rate, which is the same on both sides, 38400 bps. I checked that nothing in the new PC's bios was different, and didn't see anything.
Looking at the scope, I didn't see any noise or anything else out of the ordinary. Voltage levels, +/-6V, looked good, and the rise time was 13V/us, well under the limit of 30V/us. No large noise spikes either. Checking the logic analyzer, it appears that the proper data is being sent and received. On the software side, it is clear that the data that appears good on the RX line is being misinterpreted by the UART. Sometimes data in the same location in the stream is read with an extra 0 inserted at the LSB end, causing a shift and parity error. It is almost as if the start bit negedge is being detected earlier than it should be. Other times a char at the aforementioned location is shifted and a bit is inverted. More rarely I get a checksum error. I also never saw a overflow flag set and I received the remaining data correctly past the incorrect part. So I don't think it is overflow problems. LSR also showed that the data was available when it was retrieved, so I don't think it is an issue of reading the value too quickly.
To isolate the cause I tested the RS-232 ports on both equipment separately with a laptop and terminal program using the same RS-232 settings. Both the old board and new PC work correctly when tested in this manner. It seems as if only when they are connected there are communication issues.
The only thing I saw that was concerning was variation of the bit period on the RX line from the old board. I saw variations of 4-8 us for a 26us bit period. But even if this were a problem it doesn't explain why the old board worked with the old PC-104 PC and my laptop.
Any help would be greatly appreciated. :wink:
Thanks,
EEMan