Continue to Site

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.

  • 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 Ahhhhh!

Status
Not open for further replies.

dons21

New Member
I am trying to get my head around converting a binary number to ASCii characters for an LCD display.

I am currently converting a 10 bit number into ones,tens,hundreds,thousands. Then using a lookup table to find the correct number in ASCii then forward it to the display.

What is the formula to convert binary to ascii?

Thanks
 
I am trying to get my head around converting a binary number to ASCii characters for an LCD display.

I am currently converting a 10 bit number into ones,tens,hundreds,thousands. Then using a lookup table to find the correct number in ASCii then forward it to the display.

What is the formula to convert binary to ascii?

Thanks

hi,
If you are using assembler, look at Nigels tutorials link near my signature on this post

EDIT:
Or this option.
 

Attachments

  • Bin2Ascii.asm
    1.2 KB · Views: 351
Last edited:
If you're coding in ASM, why not just use -

movlw a'insert ascii value here'

Say you want to load character "N" into W -

movlw a'N'
 
Hi thanks for all your replies,
If you're coding in ASM, why not just use -

movlw a'insert ascii value here'

Say you want to load character "N" into W -
I am coding in ASM and have used the above example for displaying text. I as I am displaying numbers I have realised I can
add 48 to the digit I wish to display.

so 0+48 =48(0 in ascii) or 4+48=52 (4 in ascii)

thanks again
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top