PD7 [out] BLUE LED (1s alive blink)
PD6 [in] ICP; ADXL x-axis (8535:pin20)
PD5
PD4 [out] BUZZER_OUT
PD3 [in] INT1. _WAKEUP (8535:pin17)
PD2 INT0. (8535:pin16)
PD1 [out] UART TXD (8535:pin15)
PD0 [in] UART RXD (8535:pin14)
PC7 [in] 32678 Hz Crystal
PC6 [out] 32678 Hz Crystal
PC5 [i/o] I2C Data (8535:pin27)
PC4 [i/o] I2C Clk (8535:pin26)
PC3 [out] LCD_PWR (8535:pin25)
PC2 [out] LCD_CHARGE_PUMP2 (8535:pin24)
PC1 [out] LCD_CHARGE_PUMP1 (8535:pin23)
PC0 [out] LCD_CHARGE_PUMP0 (8535:pin22)
PB7 [in] SCK (8535:pin8)
PB6 [out] MISO (8535:pin7)
PB5 [in] MOSI (8535:pin6)
PB4 _SS
PB3 [in] AIN1;(ADXL Power / 2) (8535:pin4)
PB2 [in] AIN0; ADXL y-axis (8535:pin3)
PB1 [out] ADXL Power (8535:pin2)
PB0 [out] RED LED (on if CPU clock is on, off is CPU is in power save)
PA7
PA6 (8535:pin34)
PA5
PA4
PA3
PA2 [out] Vref supply (8535:pin38)
PA1 [ain] VLCD Meas (8535:pin39)
PA0 [ain] Vcc measure (8535:pin40)
|
Wait for interupt (oscillator and core is running).
|
|
Go to powersave. Oscillator and core is stopped. Only Async Timer 2 and Int0/Int1 can wake CPU.
|
|
Go to idle (oscillator is running, core is sleeping).
|
|
Init all port to input with enabled pull up to avoid current draw at power down.
|
|
Init CPU.
|
|
+-----o Vbatt | R1 # - # } Vr1 | + +---------o Vmeas | R2 # +- # | | --- Vlcd o---+ GND ADC_LCD_V_MEAS = ADC_VBATT + ADC_LCD_V_R1 ADC_LCD_V_R1 = (ADC_LCD_V_LCD - ADC_VBATT) * (ADC_LCD_R1 / (ADC_LCD_R1 + ADC_LCD_R2)) => (ADC_LCD_R1 + ADC_LCD_R2) * (ADC_LCD_V_MEAS - ADC_VBATT) = ADC_LCD_R1 * (ADC_LCD_V_LCD - ADC_VREF) => ADC_LCD_V_LCD = ((ADC_LCD_R1 + ADC_LCD_R2) * (ADC_LCD_V_MEAS - ADC_VBATT)) / ADC_LCD_R1 + ADC_VBATT
|
|
Waits for the transmitter to be ready then outputs the character |
|
Waits until a character becomes available then sets |
|
mV
|