| ??? 02/19/05 13:29 Read: times |
#87956 - ASCII computation Responding to: ???'s previous message |
Alex Anselmi said:
Peter,
Thank you. I have an ASCII table but the character I'm receiving is not standard! I have for example 00001111 saved in R1, how do I transform and send it via serial port in a character from the ASCII table? I read somewhere to do: ORL A, #030H ; Convert to ASCII number (Set upper 4 bits to 0011) but still I receive weird stuff...Any idea? Thanks. Alex The uppercase characters in the ASCII table start at decimal 65. So if you have your 4 bit value stored in R1 you could do:
MOV A,R1 ; mov 4 bit value to acc
CLR C
ADDC A,#65 ; convert to ASCII A
MOV SBUFF,A ; transmitt
Ian |
| Topic | Author | Date |
| Serial port comunication | 01/01/70 00:00 | |
| Like this | 01/01/70 00:00 | |
| Serial comunication | 01/01/70 00:00 | |
| ascii tabel | 01/01/70 00:00 | |
| Ascii table | 01/01/70 00:00 | |
| characters | 01/01/70 00:00 | |
| Serial comunication | 01/01/70 00:00 | |
| Do you get '?' | 01/01/70 00:00 | |
| ASCII computation | 01/01/70 00:00 | |
| not standard | 01/01/70 00:00 | |
| Read the | 01/01/70 00:00 | |
Thank you. | 01/01/70 00:00 |



