Hello all.
My ultimate goal is a volt meter for my power supply and I learning along the way.
Anyway I have a written a code which take the result of the ADC and displays it on a 7 segment display.
MOVFW ADRESH
MOVWF TEMP
SWAPF TEMP,W
andlw 0x0F
CALL Table
The code takes the top 4 bits swaps them to the lower and makes sure bits 3 to 7 read 0. This then allows me to display 0 to F (HEX) on the display.
I wish It to read 0 to 9. So I would need to divide the adc result by 25 to get 10 even steps.
Is my method correct or have I been barking up the wrong tree???
Advices and suggestions please.
Don
My ultimate goal is a volt meter for my power supply and I learning along the way.
Anyway I have a written a code which take the result of the ADC and displays it on a 7 segment display.
MOVFW ADRESH
MOVWF TEMP
SWAPF TEMP,W
andlw 0x0F
CALL Table
The code takes the top 4 bits swaps them to the lower and makes sure bits 3 to 7 read 0. This then allows me to display 0 to F (HEX) on the display.
I wish It to read 0 to 9. So I would need to divide the adc result by 25 to get 10 even steps.
Is my method correct or have I been barking up the wrong tree???
Advices and suggestions please.
Don