• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Binary to ASCII

Pommie

Well-Known Member
Most Helpful Member
That would be decimal not binary.

Mike.
Edit, you need a print decimal routine.
 

Les Jones

Well-Known Member
Most Helpful Member
Here is a program I use to display the output of an IN219 as ASCII text. It contains subroutines to do what you want but is is written to run on a PIC12F1840 so may require slight changes to run on a PIC16F877. It also contains code to display HEX values in ASCII


Les.
 

Attachments

Les Jones

Well-Known Member
Most Helpful Member
Can you clarify want you want ? You say 8 bit binary to 8 character ASCII. 8 bit binary has a maximum value or 255 decimal (Or FF hex) so you would only need 3 ASCII characters. I'm not sure I have written a version that will give 8 ASCII character output (This would be 28 binary bits) for a PIC16F877. I tend to use these routines quit a lot and just modify them to run on different PICs (Or Atmel Attiny chips.) and different number of bits as required. I will have to look though my projects that use PIC16F877s and see if I have one that meets your exact requirements as you do not want to modify the one I posted in post #13

Les.
 
Last edited:

Ian Rogers

User Extraordinaire
Forum Supporter
Most Helpful Member

Les Jones

Well-Known Member
Most Helpful Member
Is this homework ? The way you state the question in post #18 is ambiguous. It could mean convert it into a decimal value and convert that into ASCII to display it in decimal format. It could also mean just display it in hexadecimal as ASCII characters.

Les.
 
Last edited:

Latest threads

EE World Online Articles

Loading

 
Top