Overview
STM8L15LPBOARD
Doc ID 16160 Rev 2
2.7
MCU consumption auto-measurement circuit (JP1)
For IDD measurement the circuit below is implemented on the STM8L15LPBOARD. This
circuit requires jumper JP1 to be connected between pins 2 and 3.
Figure 4.
IDD measurement circuit
In Run mode, IDD current is measured by MAX9 (U1) connected to the 2 ohm
shunt resistor. In this case ICC_CNT_EN remains high during measurement.
In Halt mode, the operational amplifier MAX9 (U1) is connected to the 2 Kohm
shunt resistor. To measure a current corresponding to the Halt mode the procedure is:
1.
Configure ADC to measure voltage on the ICC_measurement pin.
2.
Configure ICC_WAKEUP as interrupt input on rising edge.
3.
Enter in Halt or Active Halt mode with ICC_CNT_EN low.
4.
ICC_WAKEUP rising edge wakeup the MCU after 300 ms.
5.
start ADC conversion as soon as possible after wakeup in order to measure the voltage
corresponding to Halt mode on 1 uF capacitor C1.
6.
Reset the counter by programming ICC_CNT_EN High to avoid 2 Kohm to be
connected later on VDD_MCU.
In Halt mode, the 2 K resistor is connected when T3 goes off after entering Halt mode.
The Q12 counter output allows connection of the 2 K resistor when the current ICC
becomes very low.
The Halt mode measurement procedure can be used in Low power modes if the IDD current
does not exceed 12 uA; otherwise the Run measurement procedure must be used up to
12 mA.
Table 3.
IDD measurement circuit pinout
Signal
Pin
ICC_Measurement
PF0
ICC_WAKEUP (on rising edge)
PA3
ICC_CNT_EN (active low)
PA2
www.BDTIC.com/ST