Vref question
Posted: Wed Feb 22, 2006 1:54 am
I'm not sure how to handle this little problem. My pic is running on batteries. Board full voltage is 5 volts. Vref is straight off of the +plane so, my vref is 5v. One of my functions is charging a pretty big capacitor. I have a voltage divider to make 400 volts to 1.2 volts which is on ADC. Pretty simple so far. I charge the cap until the A/D input gets to 61, then I shut off the output that charges the cap.
Two problems.
1. Like I said this runs off of batteries. When the batteries get low, the vref changes so, my A/D input value will change.
2. When I charge the cap, my voltage drops to somewhere between 3-4 volts. This also will change the A/D input value.
How can I acurately read 1.2 volts on A/D input with a floating vref. I really don't want to put a 1V voltage regulator on the Vref+ pin.
I thought about sampling the voltage before I start the charging cycle, but If I do that I will get a full scale value no matter what the voltage is.
Any ideas????
Thanks,
Ed Whitfield
Two problems.
1. Like I said this runs off of batteries. When the batteries get low, the vref changes so, my A/D input value will change.
2. When I charge the cap, my voltage drops to somewhere between 3-4 volts. This also will change the A/D input value.
How can I acurately read 1.2 volts on A/D input with a floating vref. I really don't want to put a 1V voltage regulator on the Vref+ pin.
I thought about sampling the voltage before I start the charging cycle, but If I do that I will get a full scale value no matter what the voltage is.
Any ideas????
Thanks,
Ed Whitfield