ON 20080211@3:45:51 PM at page: http://www.piclist.com/microchip/math/radix/b2a-4b1a.htm#39487.5128703704 James Newton[JMN-EFP-786] Published and replied to post 39487.5128703704 by hvymtlsteve |Insert 'No, because the ASCII values above "9" are ":", ";", "<", "=", ">", and "?" rather than "A" thru "F". To convert a nibble to hex, you need to add "A"-10 (55 or 0x37) if it is 10 (0x0A or 1010b) or more and "0" (48 or 0x30) if it is 9 (0x09 or 1001b) or less. Or you can add "0" as you suggest, then test to see if it is ":" or greater and then add 7 more ("A" - ":") if it is.' at: '' hvymtlsteve@charter.net asks: " Can't you convert a 4-bit nybble to ASCII by simply adding 0x30 to it?" |Delete 'P-' before: '' but after: ' Nevermind, the ASCII table is in a slightly different order than I was thinking. I see. |Delete 'P-' before: '' but after: '