UM1574 Hardware and layout
Doc ID 023645 Rev 1 29/48
Figure 16. STM8AL board I
DD
measurement circuit
● Run mode
In Run mode, I
DD
current is measured using the operational amplifier MAX9938FEUK+ (U8)
connected to the 2
shunt resistor (R23). In this case IDD_CNT_EN remains high during
measurement, so R24 remains in short-circuit during the measurement because of switch
U5 which remains ON permanently. The jumper JP2 must be connected between pins 2 and
3 of JP2. The measurement range in this case can be up to 30 mA.
● Low power mode
In Low power modes (Halt or Active halt), I
DD
current is measured using the operational
amplifier MAX9938FEUK+ (U8) connected to the 2 K
shunt resistor (R24), controlled by
the switch STS4DPF20L (U5). In this case the counter 74HC4060 (U7) enabled by
IDD_CNT_EN manages the measurement timing according to Figure 17. The measurement
range in this case can be up to 30 µA.
● Low power mode I
DD
measurement principle
The principle used to measure a current when the STM8AL3L68T is in Low power mode is:
1. Configure ADC to measure voltage on the IDD_Measurement pin.
2. Configure PE6 to serve as wakeup pin.
3. Enter Low power mode after setting IDD_CNT_EN (PC4) signal low.
4. IDD_WAKEUP rising edge wakes up the MCU after around 300 ms.
5. Start ADC conversion as soon as possible after wakeup in order to measure the
voltage corresponding to Low power mode on capacitor C14.
6. Reset the counter by programming IDD_CNT_EN high (in less than 70 ms after the
wakeup) to avoid the R24 2 K
resistor being connected later in Run mode.