Reply
Posts: 25
Registered: ‎03-22-2017
Accepted Solution

8051 UART output on EVB garbage

Using an 8051F500 eval board, side "A".

Using example UART code (F50x-51x_UART0_STDIO)..

Using Terraterm to monitor the UART data.

Using the USB output at P3 to monitor the UART output, the data is correct.

However, if I connect the Terminal to P0.4 and P0.5 (rx), the data is garbage.

I have tried two different terminals (Terraterm and Hercules) with the same result. I have verified that the baud rates match (I changed the DVK to 9600 for troubleshooting) using a logic analyzer and scope.

Why would P0.4 be "garbage", while at the same time the output at P5 from the UART --> USB bridge is correct?

I am using a generic USB/Serial adapter for monitoring P0.4. I don't have another one of these to try. But I have used this adapter previously with no problems. I am going to get another one to try but in the mean-time please let me know if you have any other ideas.

Thank you.

 

 

<a href="http://community.silabs.com/t5/Welcome-and-Announcements/Community-Ranking-System-and-Recognition-Program/m-p/140490#U140490"><font color="#000000"><font size="2">Hero</font></font> </a> jmg
Posts: 1,155
Registered: ‎04-27-2004

Re: 8051 UART output on EVB garbage


I have verified that the baud rates match (I changed the DVK to 9600 for troubleshooting) using a logic analyzer and scope. 

It's not easy to follow your exact issue, but if you have a logic analyzer and scope, it should be easy enough to place each piece into loop-back, and verify the actual baud speed.

I have large files of "UUU" here I use with a frequency counter to measure exact Baud speeds.

You can also start with send of 0xff, as that is the most baud-error tolerant - even the "garbage" can contain clues..

Posts: 25
Registered: ‎03-22-2017

Re: 8051 UART output on EVB garbage

Thanks for the reply. It appears that my serial-to-USB dongle has expired. I've used it for years so I suppose it's due. I have my target board wired over to the CP2102 on the DVK, using that for my terminal interface, and it's working great. Funny that when the dongle broke, it isn't really dead. It still gives me data, just garbage data. Sorry for the false alarm.

Posts: 25
Registered: ‎03-22-2017

Re: 8051 UART output on EVB garbage

I am rescinding my "solved" status.

New serial-to-USB adapter and I get garbage with this as well.

So my situation is:

if I use the CP2102 on the 8051 DVK, I get good data.

If I instead use a USB-to-serial (RS232) adapter I get garbage.

Does anyone know why this would be the case?

I have used the serial adapter plenty of times in the past with micros and UARTs with no issues.

Thanks

dan

<a href="http://community.silabs.com/t5/Welcome-and-Announcements/Community-Ranking-System-and-Recognition-Program/m-p/140490#U140490"><font color="#000000"><font size="2">Hero</font></font> </a> jmg
Posts: 1,155
Registered: ‎04-27-2004

Re: 8051 UART output on EVB garbage


if I use the CP2102 on the 8051 DVK, I get good data.

If I instead use a USB-to-serial (RS232) adapter I get garbage.


If you have 'good' and 'bad' cases, you need to play spot the difference.

'get garbage' is too vague, it is likely not garbage at all, but has useful information. 

ie it is trying to do something, so work out what ?

RS232 has different voltages to CP2102 direct.

 

Start with a scope and single characters from high char values, and low baud rates, and see what works/fails.

There are plenty of ways serial links can fail, from large baud skew errors, to more modest baud skews with packed data.

Posts: 25
Registered: ‎03-22-2017

Re: 8051 UART output on EVB garbage

JMG -

Yes, I hear you. I've looked at the characters I get, checked their ascii codes and tried to find a pattern between what I sent and what I got. And the "bad" data is not consistent, implying noise / skew, as you mention. I'm checking to see if it's the voltage levels. I am using a true RS232 to USB adapter. RS232 voltage levels are NOT logic levels. Now, I've used this adapter for years, never had an issue. But it could be that this is the first time I've used it on 3.3V logic. It may work with 5V logic. I'm ordering a USB-to-TTL converter, and I may make a ckt that converts my 3.3V logic to ±5V signals, which should look like true RS232, to see if that makes my converter work.

Posts: 3,021
Registered: ‎02-07-2002

Re: 8051 UART output on EVB garbage

RS232 levels are not compatible with 3V3 or 5V logic levels. If you're lucky it just didn't work. If not, you have destroyed one of them.

 

Further RS232 levels are inverted from logic levels. MARK is -5V to -15V on RS232 and +3V3 or +5V on UART pins. SPACE is +5V to +15V vs. 0V.