travisgoodspeed / goodwatch

Replacement board for Casio Calculator Watches using the CC430F6147

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Measuring Battery Voltage

travisgoodspeed opened this issue · comments

To avoid glitching out on a low battery, we need to be able to at least roughly measure its voltage through the ADC.

Known thresholds:

  • Above 3V, everything seems to be fine.
  • At 2.74V, powering the radio triggers a reboot.

Close this issue when a voltmeter is included and in use.

A skeletal battery voltage application is now implemented and functional. I'll hold off on closing this issue until a low battery warning is displayed in the clock.

A fresh Energizer ECR2016 reads as 3.38V by the applet, 3.30V by a voltmeter.

The voltage applet has not been merged into the clock. Press '1' to get the current voltage in millivolts.

I'll close this issue when a few more features are added.

  • Voltage ranges for the buzzer.
  • Voltage ranges for the radio.
  • Low voltage warning in POST.

The CC430F6147 does not contain an ADC12 device at 0x700, but rather an ADC10 device at 0x740. For now, this causes the voltage to be read as 000 on 6147 devices and the ADC to appear as always on.

  • Check this box when the CC430F6147 is properly supported by the ADC module.

I have a patch with support for the REF and ADC10 modules. I'll merge it after verifying that it doesn't break anything in the LCD or radio.

Both chips are now properly supported, accurately measuring voltage while keeping the reference off at other times.

We now reliably measure voltage in both the CC430F6137 and the CC430F6147. Closing issue.