Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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.

Comments

  • KevinBennettKevinBennett Posts: 1Member
    Hi,
    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.
    Kevin
Sign In or Register to comment.