Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Need code to make the converter to BCD nibbles (HC08)

Status
Not open for further replies.

john2020

Full Member level 5
Joined
Nov 13, 2005
Messages
292
Helped
12
Reputation
24
Reaction score
8
Trophy points
1,298
Activity points
4,911
motorola HC08

Hi everybody,

I am working with the HC08 microcontroller using the ADC8bits and i need
to show the data out in seven segments BCD.
Please, could you send me any code to make the converter from
binay8bits to BCD nibbles?

Thanks

Best Regards
john
 

motorola HC08

Hi
I want to use hc08. please send me info about programmer and jtag circuit.

Nandu
 

Re: motorola HC08

john2020 said:
Hi everybody,

I am working with the HC08 microcontroller using the ADC8bits and i need
to show the data out in seven segments BCD.
Please, could you send me any code to make the converter from
binay8bits to BCD nibbles?

Thanks

Best Regards
john

Please take a look at this:
**broken link removed**

Regards
 

Re: motorola HC08

Will it work,

Code:
unsigned char by = 255;
unsigned char bcd[4] = "";
unsigned char i;


i = 0;
while(by != 0)
{
    bcd[i] = by % 10;
    by = by / 10;
    i++;
}
by[i] = '\0';

Cheers
idlebrain
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top