I need some help please using an ADC input to check battery charging top off levels with respect to air temperatures (compensation)
0.4 represents a measured temperature / voltage level which I move into a label NUMA placed into a defined variable register location as below
MOVLW .4 (sample voltage = 1.44v)
MOVWF NUMA
++++++++++++++++++++++++++++++++++++++++++++++++++
Further on in my program I want to retrieve the value held in NUMA and subtract it from a battery voltage level as below. I'm not sure how to go about doing this as the result I get is not as expected i.e. 0.4 represents a voltage of 1.44v but my ADC samples a result of 1.55v. I'm using PIC 12f675 and MPLAB ASM. A sample of the subtraction code shown below. My programming skills are not good so some guidance would be appreciated
Thanks in advance.
MOVLW NUMA
SUBWF BATTERY VOLT_,0
BTFSS 3,0
GOTO XXXXX
GOTO XXXXX
0.4 represents a measured temperature / voltage level which I move into a label NUMA placed into a defined variable register location as below
MOVLW .4 (sample voltage = 1.44v)
MOVWF NUMA
++++++++++++++++++++++++++++++++++++++++++++++++++
Further on in my program I want to retrieve the value held in NUMA and subtract it from a battery voltage level as below. I'm not sure how to go about doing this as the result I get is not as expected i.e. 0.4 represents a voltage of 1.44v but my ADC samples a result of 1.55v. I'm using PIC 12f675 and MPLAB ASM. A sample of the subtraction code shown below. My programming skills are not good so some guidance would be appreciated
Thanks in advance.
MOVLW NUMA
SUBWF BATTERY VOLT_,0
BTFSS 3,0
GOTO XXXXX
GOTO XXXXX