From: tmk Date: Fri, 19 Sep 2014 21:12:49 +0000 (+0900) Subject: Add FET swtich for battery ADC X-Git-Url: https://git.friedersdorff.com/?a=commitdiff_plain;h=2015027da325e9f9b602af1f36ceeeebbcd6c78d;p=max%2Ftmk_keyboard.git Add FET swtich for battery ADC --- diff --git a/keyboard/hhkb_rn42/MEMO.txt b/keyboard/hhkb_rn42/MEMO.txt index 11f64b8c..2f61574c 100644 --- a/keyboard/hhkb_rn42/MEMO.txt +++ b/keyboard/hhkb_rn42/MEMO.txt @@ -15,12 +15,19 @@ Power saving: - deep sleep MCU and BT module(keyboard is not used for long time) - deep sleep MCU and turn off BT module(keyboard is not used and not connected) - Battery ADC; switching, high resistance + - switching gnd end of divider with PF4 + - high resistor 100K/1M? + capacitor 10nF + http://www.eevblog.com/forum/beginners/measuring-battery-voltage-without-consuming-current/ Improving: - BT LED; connecting, linked, sleeping, deep sleeping - Battry LED; blink(using timer?) - move rn42 to protocol directory when it becomes reusable stack - LUFA sendchar should be buffered and serial_uart.c buffur size is too large(256). +- ADC resolution + AVR120 + AVR32138 Testing: - Factroy reset doesn't work; need to **test again** 10K pull-up is too high? diff --git a/keyboard/hhkb_rn42/rn42/battery.c b/keyboard/hhkb_rn42/rn42/battery.c index c6988fe3..0320e1ba 100644 --- a/keyboard/hhkb_rn42/rn42/battery.c +++ b/keyboard/hhkb_rn42/rn42/battery.c @@ -21,6 +21,10 @@ void battery_init(void) ADMUX = (1<