Hi,
As some other threads around the forum about battery monitoring, I want to setup a battery monitoring system based on MICROCHIP's AN1072 "Measuring VDD Using the 0.6V Reference".
In short, it says:
"To measure VDD, VDD should be selected as the reference to the ADC via VCFG, and the 0.6V reference selected as the input using the channel select bits, CHS<3:0>. A measurement of the 0.6V input is taken with the ADC, and the result represents 0.6 Volts as a percentage of VDD. As VDD increases, the resulting number will decrease and vice versa. This yields a direct “1/x” relationship between V DD and the produced digital value as seen in Equation 1. In short, given a specific VDD, the digital value is always the same. Working backwards, if the digital value is known, VDD may be calculated."
It tells you what you have to do and even how. Now guess: I can't make it work
I have a circuit using a 16F690 (great! same one as used in the AN!). For the test, the circuit is connected to my variable power-supply so I can simulate a low battery condition (i.e. from 6VDC, I go down to 5,5VDC*).
According to the AN1072, the ADCON0 register has been set to %10110101.
Now when I vary the voltage on the power-supply, I get always the same ADC reading (no value change at all).
What am I doing wrong?
NB*: Yes, I'm using a LDO voltage regulator so I could use another way to check the battery's condition (i.e. comparator or resistor-divider)...but I want to have a go with the AN1072![]()
Bookmarks