??? 06/29/05 23:19 Read: times |
#96256 - Still Confused Responding to: ???'s previous message |
Ivan Azuara said:
Yeah, i make a mistake with the question, i get 8 bits and i whant to convert that 8 bit number in 2 bytes decimal. You mean you want to convert the 8-bit number to two ASCII-coded characters. ASCII is a 7-bit code, usually held in a byte with the top bit zero. So, each byte of ASCII code represents a single character - such as '6' or '4' or 'A' if i get 1000000 i whant to send to the serial port 64 1000000 in binary = 100 in Octal = 40 in Hex = 64 in Decimal = LXIV in Roman Numerals See: http://www.8052.com/forum/read.phtml?id=67434 and: http://www.8052.com/forum/read.phtml?id=65390 So, if you want to send the ASCII-coded representations to the serial port, you would need to send: Are you getting the idea...? if the value is 01000011 i get 2 bytes 43 that is the Hex value No. Each Hex digit represents four bits - so 43 hex is just one byte. However, if you want to represent this by sending ASCII-coded characters over the serial port, you need two characters - a '4' followed by a '3' Since each ASCII code for a character requires a byte, that means two bytes. You can look-up the byte values of the ASCII codes for '4' and '3' in an ASCII table - see the link elsewhere. Of course, all of this is just a restatement of http://www.8052.com/forum/read.phtml?id=94478 - have you read it yet? |
Topic | Author | Date |
ASCII TO DECIMAL | 01/01/70 00:00 | |
re: ascii to decimal | 01/01/70 00:00 | |
DS1620 - ASCII??? | 01/01/70 00:00 | |
9 bits | 01/01/70 00:00 | |
So not ASCII, then! | 01/01/70 00:00 | |
The Othe way around | 01/01/70 00:00 | |
Not ASCII | 01/01/70 00:00 | |
Still Confused | 01/01/70 00:00 | |
i whant to do this | 01/01/70 00:00 | |
Re-read Neil's post! | 01/01/70 00:00 | |
It was discused al least..... a lot but: | 01/01/70 00:00 | |
You only forgot ... | 01/01/70 00:00 | |
For Ivan![]() | 01/01/70 00:00 | |
resource | 01/01/70 00:00 |