Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PC-104 Uart RX Problems

Status
Not open for further replies.

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
 

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'd also like to add to this that I used another PC as a serial port sniffer and didn't observe the same issue. Apparently the issue is limited to the RX link between the old board and the PC-104 PC. I also ruled out software as I used a third party port sniffer to listen in on the RX data on the troublesome UART with the same results.

And this problem doesn't happen every time either. Also, this issue occurs at certain points in the stream, such as the second byte or last three bytes that form the checksum.

Given that the logic levels, rise times, and signal integrity are good, I'm beginning to believe that timing wasn't that good to begin with and that the new PC has a UART that can't handle the timing variations as much as the old one did. I came to this conclusion because the logic analyzer does show a variance of 20-30us pulse width for a bit period of 26us. This was taken with a sample rate of 4 us, which is the smallest possible while still seeing the entire transaction.

I know that some UARTs only sample once during a bit period while better ones sample about three times and take a majority vote. Any ideas?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top