lilayta
Joined: 26 Feb 2004 Posts: 3
|
Codification Binay to BCD |
Posted: Fri Feb 27, 2004 12:07 pm |
|
|
Hello,
I am making a conversion binary to BCD in C, and I don't know how to allocate the value of the four bits less significants (0-3) of a 8 bits variable, to the four first bits of the port D of the PIC, only from 0 to 3. I don't want to modify the others bits of the port.
For example: my variable is centenas= 0000 0001 and I want the state of the port D is the following:
port D =xxxx0001,
Also say that I don't know the value of centenas because it depends of the program.
thanks |
|