1. Calculate the 8-bit binary values in ADRESH and ADRESL if an analog voltage of 0.707 Volts is converted by the 10-bit ADC in an PIC-18 with +5V as the positive reference voltage. Use Right Justify and Left Justify format.
The 10 bit value can be found out using the quantization formula.
Digital Value = full scale * voltage /reference voltage.
In this case
Digital Value = 1023*0.707/5 = 145 = 0b0010010001 ( as approximated by ADC)
The left justified value will be stored as
ADRESH = 0b00100100
ADRESL = 0b01000000
While the right justified value will be stored as
ADRESH = 0b00000000
ADRESL = 0b10010001
Notice that 0b is just for the sake of clarity that it's a binary representation of the number.
Get Answers For Free
Most questions answered within 1 hours.