Software description
2
Software description
2.1
STM32L1x peripherals used by the application
This application example uses the following STM32L1x peripherals with the settings
described below:
ADC
ADC performs analog-to-digital conversions of the internal reference voltage (V
display) and of the voltage coming from the operational amplifier that is the image of I
current.
•
ADC resolution: 12-bit
•
ADC conversion mode: single
•
ADC sampling time: 192 cycles
SYSTICK Timer
The Systick timer is used to generate the delay needed for display or wait loops.
GPIOs
Port C and Port E are connected to the USER push-button and the LEDs.
•
PB1 set as an input floating pin with interrupt connected to the USER push-button
•
PB7 (green LD3) and PB6 (blue LD4) set as an output push-pull
•
PA0 set as a wake-up pin configured either as an input floating pin with interrupt with
detection on rising edge or as an alternate function AFIO0 (WKUP1) during Standby
mode.
•
PA6, PA7, PC4, PC5, PB0, PB1 are used for linear touch sensor or touchkeys during
the touch sensor demonstration.
•
During the low power modes, I/Os are placed in analog input mode to reduce power
consumption except for a few pins related to the hardware interface (PB7 - green LD3
PB6 - blue LD4, PA4 - I
timer enable). This means that all Schmitt triggers on unused standard I/O pins are
disabled to reduce power consumption.
LCD controller
The different functions available in the firmware library for LCD are used to initialize, clear,
display strings and scrolling messages needed in the application code. For some low power
mode measurements, the LCD controller is turned OFF to minimize the current consumption
of the STM32L152.
Clock
The MSI (the multi speed internal oscillator) oscillator is selected as clock source. The
application manages the peripheral clocks depending on the selected power saving mode.
When the device enters low power run mode, MSI is switched to range 0 until the device is
woken-up by an external event. When exiting Low power run mode, the MCU switches the
HSI oscillator back ON. LSE is switched ON during Manufacturing test mode (see
Section
1.5.3) to check its functionality.
10/18
measurement pin, PA0 - LP WakeUp pin and PC13 - IDD
DD
DocID018933 Rev 2
AN3413
voltage
DD
DD
Need help?
Do you have a question about the STM32L1 Series and is the answer not in the manual?
Questions and answers