154,10 → 154,9 |
// AVcc = 5V --> 5V = 1024 counts |
// the voltage at the voltage divider reference point is 0.8V less that the UBat |
// because of the silicon diode inbetween. |
// voltage divider R2=10K, R3=1K |
// UAdc4 = R3/(R3+R2)*UBat= 1k/(1k+10k)*UBat = UBat/11 |
// UAdc4 = R3/(R3+R2)*UBat= 3.9k/(3.9k+10k)*UBat = UBat/3.564 |
UBat = (3 * UBat + (69 * Adc4) / 128) / 4; |
// voltage divider R2=10K, R3=3K9 |
// UAdc4 = R3/(R3+R2)*UBat= 3.9/(3.9+10)*UBat = UBat/3.564 |
UBat = (3 * UBat + (64 * Adc4) / 368) / 4; |
DebugOut.Analog[8] = UBat; |
#endif |
ADReady = 0; |