SWEET!
I expect to receive 1% of the value of that resistor and capacitor you saved.
<br>
SWEET!
I expect to receive 1% of the value of that resistor and capacitor you saved.
<br>
DT
Hello, I have found this post, because I want to do the same. I have 16F690 battery powered system and I want to detect low battery caase. I have Implemented the code like described here, but it somehow doesn't work:
'read baterry
VRCON.4 = 1 ; Turn 0.6V reference ON
PAUSEUS 200 ; Allow VP6 to settle
ADCIN 13, temp_word ; get VP6 analog reading (10-bit)
VRCON.4 = 0 ; Turn 0.6V reference OFF
VDD = 6138 / temp_word ; convert to voltage ve vdd je 25 = 2,5 V
temp_data[9] = (VDD DIG 1) + $30
temp_data[10] = "."
temp_data[11] = (VDD DIG 0) + $30
temp_data[12] = 13
temp_data[13] = 10
But it somehow doesn't work. If powerred with 3.3 V I have in VDD 42, if powerred from exhausted bateries with total voltage 2.4 V I have there 4 and if powered from new bateries with 3.1 V I have there 4. Do you have any idea, why it is doesn't work?
Bob
I imagine that you are only seeing 2 digits of a much larger number that was calculated wrong because either the A/D wasn't set up right or a variable size is wrong.
Make sure you have these in your program.
Code:temp_word VAR WORD VDD VAR WORD DEFINE ADC_BITS 10 ADCON0.7 = 1
DT
Wow, super, it's working now. I didn't specified the
DEFINE ADC_BITS 10
ADCON0.7 = 1
Thanks a lot, I really apreciated you quick answer and help!!!
bob
Bookmarks