![]() |
|
|||||||
| Programmer's Corner Discussion forum for all aspects of programming and software engineering. Any software programming language welcome: C, C++, C#, Fortran, Java, Matlab, etc. |
|
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Does anyone have an idea about Hex to BCD conversion routine using pic?
Please let me know Thanks |
|
#2
|
|||
|
|||
|
Is there any subroutine available for converting hex to bcd?????
|
|
#3
|
|||
|
|||
|
What language are you using ?
Have you tried Google or Bing ? Have you had a go yourself ? |
|
#4
|
|||
|
|||
|
i am using assembly language in pic
I tried google but didn't get any satisfying results If you have any idea please let me know Thanks |
|
#5
|
||||
|
||||
|
By hex do you mean a natural number stored in a register (or registers)? If so this should help. If you are not worried about memory, the unpacked BCD is easier to work with.
http://www.piclist.com/techref/micro...adix/index.htm |
|
#6
|
|||
|
|||
|
Unpacked BCD to 16 bit binary conversion by Nikolai Golovchenko
but using the above I would get binary result i am getting the correct frequency but its in hex format so i first need to convert hex to bcd i have bcd to ascii subroutine to display on LCD Thanks |
|
#7
|
|||
|
|||
|
At present when i divide 0x64 (decimal 100) by 0x21 (decimal 33)
I get 3.07 on LCD which is hex but i want to see 3.03 (decimal) |
|
#8
|
|||
|
|||
|
i have still not figured it out
any help would be appreciated Thanks |
|
#9
|
|||
|
|||
|
If you are not worried about memory, the unpacked BCD is easier to work with.
Which unpacked bcd routine are you referring to? |
|
#10
|
||||
|
||||
|
I meant one of the binary to unpacked BCD links.
Unpacked stores each BCD digit in a byte, but packed stores 2 BCD digits in each byte. eg. 93 is stored as b'10010011' in packed but as b'00001001' and b'00000011' in unpacked. I think we need to see your code to be more help. |
|
| Tags |
| bcd, conversion, hex, routine |
Related Site Pages
|
||||
| Section | Title | |||
| Worksheet | Microcontroller principles | |||
| Worksheet | Digital codes | |||
| Worksheet | Numeration systems | |||
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Compilation Error for Microchip IDE , C18 | arikiev | Embedded Systems and Microcontrollers | 4 | 09-20-2010 08:32 PM |
| BCD to HEX in assembly | Jefecito20 | Programmer's Corner | 1 | 05-06-2010 03:56 AM |
| PIC16f877- 16 bit hex to bcd converter | amitesh | Embedded Systems and Microcontrollers | 1 | 03-01-2009 02:02 PM |
| 8086 Microprocessor using Debug (hex to bin conversion) | Reshma | Programmer's Corner | 6 | 12-19-2007 01:16 PM |
| Thread Tools | |
| Display Modes | |
|
|