HT1635A/B Wearable Sports Bracelet LED Display Application
18 / 19
AN0393E
Power Supply Detection Subroutine Flowchart
Start
AC power connected?
Turn off DC-DC
Boost function
Power adapter
connected?
Return
Li-battery power supply,
Set the related flag high
Enable Li-battery
charging
First power-on?
N
Y
Y
Y
N
N
Figure 18 Power Supply Detection Subroutine Flowchart
The MCU uses the IO_ACIN and IO_USBIN ports to detect an AC power connection or
an external 5V DC power adapter connection respectively. If there is no AC power or
power adapter detected, it indicates that the demo is using the Li-battery as its power
supply. If an AC power or an external power adapter is connected, the Li-battery boost
circuit will be turned off. Then, when a 1860 Li-battery is placed in the battery holder, the
battery charging function will be turned on.
Li-battery Power Detection Subroutine Flowchart
Start
Turn off DC-DC boost circuit,
Turn off Li-battery charging,
Clear HT1635A/B RAM data
Li-battery power<3.1V?
Turn on DC-DC boost circuit,
Turn off Li-battery charging
Return
Li-battery power supply?
System On
Mode?
Turn off
Li-battery
charging
Battery placed?
Turn on
Li-battery
charging
Y
N
N
Y
Y
Y
N
N
Figure 19 Li-battery Power Detection Subroutine Flowchart
When the demo uses a Li-battery as its power supply, the Li-battery power detection
subroutine is used to detect the current battery voltage. If the battery voltage is higher
than 3.1V, the DC-DC boost circuit will be turned on. If the battery voltage is lower than
3.1V, this indicates a low battery power, in which case the DC-DC boost circuit and the
LED Matrix display function will be turned off.