Atmel 8051 serial data ASCII - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Atmel 8051 serial data ASCII

I have an 8051 microcontroller doing a 8-bit up counter with a 3 second delay between counts and a 300 baud rate. I connect it to my computer threw a serial cable to display the count in hyper terminal.

I know that the 8-bit upcounter program is working fine because I also have an LED train hooked up to it to see it visually.

All I am getting as an output from the microcontroller to the computer is a heck of a lot of ASCII characters, most are in 8-bit chunks of simular characters, but not all. What I need to do is display the 8-bit up counter in decimal form, not ASCII, Any idea on how to do this would be much appreciated, I'm not sure how to shift threw all those ASCII characters. Thank you.


  • KevinBennettKevinBennett Posts: 1Member
    The problem is that the 8bit value from the counter is binary and Hyperterminal will treat each value as an ASCII character. So you need to do a Binary-ASCII conversion.
    If all you want to do is see the values, a routine to test each bit of the binary value and print a '1' or '0' is quit easy. Group them in blocks of eight with a carriage return/line feed to make them more readable.
    Hope this is of some help.
Sign In or Register to comment.