Hi Roger,
With a voltage divider of 22k and 10k, when the batt voltage is 6.5, the divider output will be 2.031 volts.
But the VRCON setting is for 2.5V. So it would switch at a batt voltage of 8 volts instead of 6.5
If VRCON were %10101010 it would give a reference of 2.08 V, and the comparator would switch at 6.66V.
<hr>
For the comparator you can use this configuration...
<img src=http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1700&stc=1&d=118082173 6>
With CIS set to 1 it puts the GP0 input on the "-" input of the comparator.
Then as long as the batt is greater than 6.66V, the comparator output will be 0
In that case, CMCON should be %00001110.
HTH,
PS: Do you play Half-Life? Roger(SWE)?
<br>
Bookmarks