15. LC sensor controller (LCSC)
15.1 Introduction
The STM32WL33xx embeds an LC Sensor controller (LCSC). The LCSC is not available on STM32WL30xx and STM32WL31xx devices.
The LC sensor controller (LCSC) controls DAC, COMP, VCMBUFF power-on/power-off and dedicated GPIOs (PB1, PA14, PB2) for the measurement of LC networks damping times.
In this kind of application, the flow of a fluid in a pipe forces the rotation of a wheel, whose number of revolutions permits quantification of the amount of fluid consumed. Three external LC networks, positioned on top of the wheel, allow counting of the number of revolutions. These networks are to be connected to identified GPIOs. Two of them (PB1 and PA14) allow the position of the rotating wheel to be determined, whereas the other (PB2) is necessary to detect tampering.
15.2 LCSC main features
- • Management of the sequence of measurement of the 3 available LC networks, knowing that the third LC, for tamper, is not intended to be measured at each sequence. PB1, PA14 and PB2 GPIO connected to LC network are driven by LCSC (additional functions), as soon as the LCSC is enabled, independently of General-purpose I/O (GPIO) registers configuration.
- • Management of the power-on/power off of COMP, DAC, VCMBUFF, as soon as the LCSC is enabled, independently on how are configured EN bit in Comparator control and status register (COMP_CSR) and EN and VCMON bits in DAC control register (DAC_CR).
- • Count the number of Comparator (COMP) output edges for each LC to determine the wheel position or if there is any tamper.
- • Count the number of wheel revolutions (a full revolution means that the wheel has started rotating from a defined initial position up to returning to this position).
- • Wakeup from low power modes (SLEEP or Deepstop) (see Section 5.8: Programmer's mode) and notify the system through an interrupt (see Section 2.3.2: Interrupts) when the total number of wheel revolutions reaches a given threshold fixed by the application user.
15.3 LCSC functional description
15.3.1 LCSC block diagram
Figure 31 shows the block diagram of the LCSC, while Figure 32 shows connections of LCSC to DAC, COMP, VCMBUFF and PB1, PA14, PB2 and PB4 GPIO.
Figure 31. LCSC block diagram

The diagram illustrates the internal structure and external interfaces of the LCSC. It is divided into two main sections: a core functional block and an external interface block.
Core Functional Block:
- LCSC register: A central register block that receives Slow_clock, SCRST, and APB0 clk inputs. It outputs LCA, LCB, LCT driving signals to the external interface and enable signals to the LCSC comparator count block.
- LCSC comparator count: A block that receives enable from the LCSC register and COMP_OUT from the external interface. It outputs Measurement and status back to the LCSC register.
- LCSC register (Internal): A block that receives enable and Measurement and status from the LCSC register. It outputs LCSC_MEASUREMENT_CONFIGX to the LCSC register.
- LCSC register (External): A block that receives enable and Measurement and status from the LCSC register. It outputs enable to the LCSC register.
External Interface Block:
- APB0: A block that receives enable from the LCSC register and outputs APB0 to the AHB2APB block.
- Interrupt: A block that receives enable from the LCSC register and outputs Interrupt to the AHB2APB block.
- AHB2APB: A block that receives APB0 and Interrupt from the LCSC register and outputs APB0 to the SOC bus matrix.
- SOC bus matrix: A block that receives APB0 from the AHB2APB block and outputs Wakeup event to the LCSC register.
Other signals:
- COMP_OUT: An external input signal that feeds into the LCSC comparator count block.
- Wakeup event: An external output signal that feeds into the LCSC register.
MSv58340V3
Figure 32. LCSC connection to DAC, COMP, VCMBUFF, GPIOs

The diagram illustrates the internal connections of the LCSC. On the left, three LC networks (LCA, LCB, LCT) are shown in parallel, connected to a common node labeled VBAT/2. This node is also connected to a capacitor Cext and ground. Each LC network is connected to a GPIO pin (PB1, PA14, PB2) through a switch. A VCMBUFF block is connected to the common node and outputs to a DAC. The DAC is controlled by DACEN and outputs to a COMP block. The COMP block is controlled by COMPEN and outputs to COMP_OUT. The COMP block also receives input from DACOUT_COMPEN and COMP_INMSEL=100.
15.3.2 Overview
The purpose of the LCSC is to control the COMP, DAC, VCMBUFF and PB1, PA14, PB2 in order to implement the LCSC feature.
Before detailing the behavior of the LCSC, it's useful to describe the feature and define the different keywords in order to guide the reader through the specifications.
First of all, the LCSC feature is dedicated to the fluid metering (often simplified in water metering). Indeed, this feature is deployed in order to measure the fluid consumption, for instance the water consumption in a house.
The fluid consumption measurement is based on two mechanisms:
- • A rotating wheel, which is driven by the fluid movement inside a pipe
- • A combination of LC networks allowing to detect the position of the wheel, and finally to allow to count the number of full rotations of the wheel, which is directly linked to the water consumption.
LC network is the name given to the combination of an inductor (L) and a capacitor (C), that are integrated passive electronic components. These two components are placed in parallel to form a LC network and in this case the LC network may be considered as an oscillator (see Figure 32).
This notion of oscillator is very important, it is this behavior that is used by the LCSC feature to measure the water consumption. Indeed, the idea is to measure the LC oscillation damping time and to use this damping time to determine what the wheel position is.
There are two important things to note to understand the concept:
- • The rotating wheel is half covered with a metallic surface (see Figure 33)
- • The LC oscillation damping time is faster if the LC network is placed near a metallic surface.
Back to the LC networks to understand how to use the above information. The idea is to use two LC networks to detect the wheel position, and a third LC network that are described later. In the whole documentation we consider:
- • The first LC network as LCA
- • The second LC network as LCB
- • The third LC network as LCT
We first focus on the LCA and LCB networks, they are positioned external to the SoC and driven by LCSC.
We can divide the rotating wheel half-covered with a metallic surface in 4 quarters.
- • LCA is located near a first quarter
- • LCB is located near a second quarter.
Because the wheel is rotating, the LCs do not always see the same surface, in fact we can even describe 4 different positions:
- • LCA and LCB facing a metallic surface
- • LCA and LCB facing a none-metallic surface
- • LCA facing a metallic surface but LCB not
- • LCA not facing a metallic surface but LCB yes.
Figure 33 shows the wheel, divided in quarters, with the two LC networks (LCA shown as LC1 on the lower left, and LCB shown as LC2 on the lower right) with the LC oscillation damping for each:
Figure 33. LC oscillation damping

In this wheel-position example, LC1 is not facing a metallic surface, so the blue oscillation is damped “normally”, whereas LC2 faces a metallic surface, so the red oscillation damps much faster.
Finally, the LCSC uses these two LC networks to repeat the LC oscillation damping time measurement, and so determine the position of the wheel (which should be rotating if a fluid is moving inside the pipe) throughout the LCSC process. Depending on the wheel position, the LCSC counts the number of wheel revolutions (full rotations) and finally alerts the user if a defined number of revolutions has been counted.
LCT means LC tamper (shown as LC3 in Figure 34), because this LC network is solely dedicated to tamper detection. It allows the prevention any fraudulent activity, for example, an attempt to “hack” the system by introducing a metallic surface above the water meter. This would cause each measurement to have a faster oscillation damping time, equivalent to a measurement made for an LC facing the two metal-covered quarters. Forcing the two LCs to see a metallic surface would cause the measurement to indicate that the wheel is no longer rotating. The third LC is not placed near a quarter such as LC1 and LC2, but next to the wheel. This means that LC3 (LCT) should always measure an oscillation damping time corresponding to an LC that is not facing a metallic surface. However, if a tamper occurs, LCT sees an oscillation damping time that is shorter than expected. This is used as a tamper-detect indication to generate a user-alert of fraudulent usage.
Figure 34. Tamper LCT

15.3.3 LCSC reset and clocks
The LCSC clock provided by the clock controller is synchronous with the APB0 clock and can be enabled through LCSCEN bit inside APB0 macrocell clock enable register (RCC_APB0ENR).
Since LCSC must work also in Deepstop mode, another clock is provided to LCSC which is the slow clock selectable through CLKSLOWSEL bits inside Clock configuration register (RCC_CFGR).
The Reset of the LCSC is controlled by LCSCRST bit inside APB0 macrocell reset register (RCC_APB0RSTR) and it's status can be read through LCSCRSTF inside Clock Interrupt flag register (RCC_CIFR), this flag can also generate a PWR interrupt in case bit LCSCRSTIE is set inside This register controls the enable and variable rate multiplier for SMPS clock.
15.3.4 LCSC programming
To make the LCSC work, some steps need to be configured by software before the block is enabled via the LCSC_EN bit in the LCSC enable register (LCSC_ENR):
- 1. Configure PB4 as output pin using GPIO registers through GPIOB port mode register (GPIOB_MODER) and output data zero on PB4 pin through GPIOB port output data register (GPIOB_ODR), this allows to discharge residual voltage on external capacitor, Cext.
- 2. Configure PB4 as an analog pin using GPIO registers through the GPIOB port mode register (GPIOB_MODER).
- 3. Enable VCMBUFF output (VDD33/2, also termed VBAT/2) on PB4 pin setting VCMEN bit in the DAC control register (DAC_CR).
- 4. Connect DACOUT_COMPINMINUS to COMP_INMINUS by setting the CMPEN bit in the DAC control register (DAC_CR).
- 5. Configure the DAC DHR[6:0] register to chose DAC analog output level of DACOUT_COMPINMINUS using the DAC channel data holding register (DAC_DHR).
- 6. Configure bitfield DACDHR[5:0] in the DAC channel data holding register (DAC_DHR) to chose the DAC analog output level of DACOUT_COMPINMINUS.
- 7. Configure PWRMODE, HYS to and INMSEL bits (see Section 13.6.1: Comparator control and status register (COMP_CSR)) to configure COMP and to connect DACOUT_COMPINMINUS to the COMP (see Figure 32: LCSC connection to DAC, COMP, VCMBUFF, GPIOs).
Caution: If APC bit is set, the user has to disable the PUB1, PUB2, PUA14, PUB4 and PDB1, PDB2, PDA14, PDB4 bits by software inside the , I/O Port A pull-down control register (PWR_PDCRA), I/O Port B pull-up control register (PWR_PUCRB) and I/O Port B pull-down control register (PWR_PDCRB) for the feature to work properly. Otherwise, if APC is reset, the pull-up, pull-down of PB1, PB2, PA14 and PB4 are automatically disabled.
- 8. Program LCSC configuration registers (see LCSC register map).
- 9. Enable LCSC through the LCSC_EN bit. These 9 first steps are managed by software.
Caution: Once the LCSC is enabled PB1, PA14, PB2 are configured as additional functions and they are driven by LCSC independently of GPIO configuration registers settings.
- 10. LCSC enables the DAC, COMP, VCMBUFF allowing to switch-on them. (In this case LCSC takes priority on DACEN, VCMON bits of the DAC and EN bit of the COMP).
- 11. LCSC waits for a Startup time (\(T_{\text{StartInit}}\)), (see Figure 35) this time allows the DAC, COMP and VCMBUFF to be switched-on correctly (3 slow clock cycles) and to ensure that VCMBUFF voltage has reached VDD3/2 (\(T_{\text{StartVCM}}\)).
Note: The startup time, such as the other durations to wait in this description, is expressed as a number of slow clock cycles, not like an absolute time.
- 12. LCSC enables the LCSC comparator count sub-block (see Figure 31).
- 13. LCSC selects the first LC to be measured, LCA.
- 14. LCSC waits for two slow clock cycles.
- 15. LCSC generates a pulse low on LCA whose width is programmable (see the LCSC pulse configuration register (LCSC_PULSE_CR)) and \(T_{\text{capture}}\) starts.
- 16. LCSC receives the outputs of the COMP and increments the LCSC comparator count value for each value received.
- 17. LCSC compares comparator count sub-block with LCAB_DAMP_THRES previously configured by the software in the LCSC control register 1 (LCSC_CR1), in order to decide if LCA is near a metallic surface or not.
- 18. Once the \(T_{\text{capture}}\) is elapsed (see Figure 35), LCSC reset comparator sub-block counter and selects the second LC to be measured, LCB, whereas the LCA is unselected.
- 19. LCSC waits for \(T_{\text{interCapture}}\) delay (see Figure 35).
- 20. LCSC generates a pulse low on LCB (see see LCSC pulse configuration register (LCSC_PULSE_CR)) and \(T_{\text{capture}}\) starts.
- 21. LCSC receives the outputs of the COMP and increments the LCSC comparator count value for each value received.
- 22. LCSC compares comparator count sub-block with LCAB_DAMP_THRES previously configured by the software in the LCSC control register 1 (LCSC_CR1), in order to decide if LCB is near a metallic surface or not.
- 23. Once the \(T_{\text{capture}}\) is elapsed (see Figure 35), the LCB is released, the LCSC comparator count uses the comparisons of 17 and 22 steps to conclude on the position of the wheel. At the same time there are multiple possibilities:
- a) If a tamper detection is required by the software through the TAMP_PSC[7:0] bits, see step 24.
- b) If there is no need to detect any tamper, but the measurement period \(T_{\text{measurement}}\) (where \(T_{\text{scan}} = T_{\text{measurement}} + T_{\text{recoveryVCM}} + 3\) slow clock cycles) is already reached, select LCA, wait for a \(T_{\text{interCapture}}\) delay and redo the process from step 13.
- c) If there is no need to detect any tamper, and the measurement period \(T_{\text{measurement}}\) is not reached, jump to step 30.
- 24. LCSC selects LCT
- 25. Wait for a \(T_{\text{interCapture}}\) delay
- 26. LCSC generates a pulse low on LCT whose width is programmable (see the LCSC pulse configuration register (LCSC_PULSE_CR)).
- 27. LCSC receives the outputs of the COMP and increments the LCSC comparator count value for each value received.
- 28. LCSC compares comparator count sub-block with LCT_DAMP_THRES previously configured by the software in the LCSC control register 1 (LCSC_CR1), in order to decide if LCT is near a metallic surface or not.
- 29. Once the \(T_{\text{capture}}\) is elapsed, the LCT is released and the LCSC comparator count shall use the comparison of step 28 to conclude on the detection of a tamper or not. There are two possibilities:
- a) The measurement period \(T_{\text{measurement}}\) is already reached, wait for a \(T_{\text{interCapture}}\) delay and LCSC redo the process from step 13.
- b) The measurement period \(T_{\text{measurement}}\) is not reached yet, continue to step 30.
- 30. Ensure that there is not any LC selected (all the LC selection signals at 0)
- 31. Disable DAC, VCMBUFF, COMP
- 32. Wait for reaching the end of the measurement period \(T_{\text{measurement}}\), plus \(T_{\text{recoveryVCM}}\) + 3 slow clock cycles, and redo the process from step 10.
Note: In all cases, if LCSC_EN is released, the process executes step 30 to properly shutdown the DAC, COMP and VCMBUFF.
Figure 35. LCSC PB1, PA14, PB2,PB4 control timing

- 1. \(T_{\text{intercapture}}\) is equal to LCSC_CR0.TICAP + 2 slow clock cycles
- 2. \(T_{\text{recoveryVCM}}\) is equal to LCSC_CR1.TREC_VCM + 3 slow clock cycles
15.4 LCSC comparator count statistics and monitoring
The number of oscillations of a LC network is dependent of the environmental conditions and may change over time (Temperature, Voltage, Aging, Process, ...), then the damping count threshold should be tuned during the runtime of the application and the LCSC. In order to help the software to adapt the value of the LCAB_DAMP_THRES during runtime, the LCSC allows the software to achieve active monitoring of the comparator count min and max values (MIN_LCAB_CNT and MAX_LCAB_CNT), or it can monitor by itself passively comparing the min and max count values to the given bounds (MIN_LCAB_CNT_BOUND, MAX_LCAB_CNT_BOUND). The maximum number of oscillations counted during the LCA and LCB measurements can be reported in the LCSC statistics register (LCSC_STAT) register through MAX_LCAB_CNT. The minimum number of oscillation counted during the
LCA and LCB measurements can be reported in the LCSC statistics register (LCSC_STAT) register through MIN_LCAB_CNT. In order to save power, the both MAX_LCAB_CNT and MIN_LCAB_CNT are reported only if bit CNT_OFB_WKP_IE has been previously set by software. The MAX_LCAB_CNT is reset when the software writes 1 in the CNT_OFB_F bit (even when the value is already 1). The MIN_LCAB_CNT is set to 0xFF when the software writes 1 in the CNT_OFB_F bit (even when the value is already 1).
Note: the CNT_OFB_F bit can be written at anytime to 1 to reset the min and max values, whatever its current value.
In addition, the LCSC is monitoring the minimum and maximum values (MAX_LCAB_CNT and MIN_LCAB_CNT) and comparing these values to values given by the software in the MIN_LCAB_CNT_BOUND and MAX_LCAB_CNT_BOUND inside LCSC statistics register (LCSC_STAT) register.
When the software has set the CNT_OFB_WKP_IE, the LCSC set the CNT_OFB_F when either the MAX_LCAB_CNT value is strictly greater than the MAX_LCAB_CNT_BOUND value stored in the LCSC_STAT register or the MIN_LCAB_CNT value is strictly lower than the MIN_LCAB_CNT_BOUND value stored in the LCSC statistics register (LCSC_STAT) register (see Figure 36).
Figure 36. LCAB counters out-of-bound example

Note: The default value of MAX_LCAB_CNT_BOUND at 0xFF and MIN_LCAB_CNT_BOUND at 0x00 makes the CNT_OFB_F flag to never being set and the wakeup and IRQ events never occurring with default configuration.
Note: The flag is never set by the LCSC if the CNT_OFB_WKP_IE is not set as the MIN_LCAB_CNT and MAX_LCAB_CNT are not computed.
Note: When an out of bound count is reported to the system the software may decide to update the damping count threshold, the minimum bound or the maximum bound, this is why these register bit fields are considered dynamic.
15.5 LCSC status
The wheel status is reported in the LCSC status register (LCSC_SR) register determining in which quarter the wheel is placed (see Figure 37).
Figure 37. Wheel quarter status

15.6 LCSC interrupts
Two LCSC interrupts are available:
The first one (LCSC interrupt see Table 7: Interrupt vectors) can be generated when:
- the number of wheel clock wise revolution (see the LCSC wheel status register (LCSC_WHEEL_SR)) reaches the programmed threshold (see the LCSC wheel configuration register (LCSC_CONFR)).
- the number of wheel anti clock wise revolution (see the LCSC wheel status register (LCSC_WHEEL_SR)) reaches the programmed threshold (see the LCSC wheel configuration register (LCSC_CONFR)).
- a tamper has been detected (see the LCSC interrupt status register (LCSC_ISR)).
- out of bound has been reached (see the LCSC interrupt status register (LCSC_ISR)).
The second one (LCSC LC_ACTIVITY interrupt) (see Table 7: Interrupt vectors) can be generated when:
- an LC oscillation is ongoing (see the Internal asynchronous interrupt detection status and clear register (INTAI_ISCR))
15.7 LCSC low-power modes wakeup
The LCSC is available and functional down to Deepstop mode.
In Deepstop mode, a wakeup event is generated when:
- the number of wheel clock wise revolution (see the LCSC wheel status register (LCSC_WHEEL_SR)) reaches the programmed threshold (see LCSC wheel configuration register (LCSC_CONFR)).
- the number of wheel anti clock wise revolution (see LCSC wheel status register (LCSC_WHEEL_SR)) reaches the programmed threshold (see LCSC wheel configuration register (LCSC_CONFR)).
- a tamper has been detected (see LCSC interrupt status register (LCSC_ISR)).
- out of bound has been reached (see LCSC interrupt status register (LCSC_ISR)).
15.8 LCSC registers
15.8.1 LCSC control register 0 (LCSC_CR0)
Address offset: 0x00
Reset value: 0x000B 005C
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Res. | Res. | Res. | Res. | Res. | TICAP[2:0] | Res. | Res. | TCAP[5:0] | |||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | |||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Res. | Res. | TMEAS[13:0] | |||||||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | ||
Bits 31:27 Reserved, must be kept at reset value.
Bits 26:24 TICAP[2:0]: Inter Capture Time
The inter-capture duration (also called TinterCapture) is the duration between the end of a first TCAP and the following TCAP and is equal to TICAP + 2 slow clock cycles.
This duration is given in number of slow clock cycles
Bits 23:22 Reserved, must be kept at reset value.
Bits 21:16 TCAP[5:0]: Capture Time
The capture duration (also called Tcapture) is the duration of one LC measurement, starting from the excitation pulse on the LC line and ending once the TCAP number of slow clock cycles has been reached.
This duration is given in number of slow clock cycles
Bits 15:14 Reserved, must be kept at reset value.
Bits 13:0 TMEAS[13:0]: Measurement Time
The measurement duration (also called Tmeasurement) is the duration of an LC measurement sequence (including LCA, LCB and LCT if necessary, and also the time left before the next power-up of analog blocks: DAC, COMP, VCMBUFF).
This period is given in number of slow clock cycles. Set to 0 to perform a one-shot measurement sequence.
Set this bit to 0 to perform a one-shot measurement sequence.
15.8.2 LCSC control register 1 (LCSC_CR1)
Address offset: 0x04
Reset value: 0x3C01 0C80
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Res. | TSTART_VCM[10:0] | Res. | TREC_VCM[8:6] | ||||||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | |||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| TREC_VCM[5:0] | Res. | Res. | LCAB_DAMP_THRES[7:0] | ||||||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | ||
Bit 31 Reserved, must be kept at reset value.
Bits 30:20 TSTART_VCM[10:0]: VCMBUFF Starting Time
Corresponds to the duration \(T_{\text{StartVCM}}\) (in number of slow clock cycles) between the enable of the VCMBUFF and the establishment of the Voltage to the value VDD33/2. This time is only to be considered for the first LC measurement after an enabling of the LCSC feature thanks to the LCSC_EN bit.
Note: TSART_VCM must not be set to values lower of 0x02
Bit 19 Reserved, must be kept at reset value.
Bits 18:10 TREC_VCM[8:0]: VCMBUFF Recovery Time
Corresponds to the duration \(T_{\text{recoveryVCM}}\) (in number of slow clock cycles) between the enable of the VCMBUFF and the establishment of the Voltage to the value VDD33/2. This time is to be considered between each sequence of LC measurement, called TSCAN in the registers. (sequence of LC measurement = LCA, LCB and sometimes LCT).
Note: TREC_VCM must not be set to values lower of 0x02
Bits 9:8 Reserved, must be kept at reset value.
Bits 7:0 LCAB_DAMP_THRES[7:0]: Damping threshold for LCA and LCB
The count threshold used to define if the LCA and LCB is near of not of a metallic surface.
15.8.3 LCSC control register 2 (LCSC_CR2)
Address offset: 0x08
Reset value: 0x0000 8000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| LCT_DAMP_THRES[7:0] | TAMP_PSC[7:0] | ||||||||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
Bits 31:16 Reserved, must be kept at reset value.
Bits 15:8 LCT_DAMP_THRES[7:0]: Damping threshold for LCT
The count threshold used to define if the LCT is near of not of a metallic surface.
Bits 7:0 TAMP_PSC[7:0]: Tamper measurement interval The tamper detection prescaler comparing to the measurement period: - 0x00: the tamper detection and the LCT measurement are never done - others: the LCT measurement is done once every TAMP_PSC sequences of measurements.
15.8.4 LCSC pulse configuration register (LCSC_PULSE_CR)
Address offset: 0x0C
Reset value: 0x0000 0070
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Res. | Res. | Res. | Res. | LCT_PULSEWIDTH[3:0] | PULSETRIM[3:0] | LCAB_PULSEWIDTH[3:0] | |||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | ||||
Bits 31:12 Reserved, must be kept at reset value.
Bits 11:8 LCT_PULSEWIDTH[3:0]: Low Pulse Width for LCT
Pulse width programming for generated pulse.
Bits 7:4 PULSETRIM[3:0]: Low Pulse Trimming
Trimming of the Pulse Generator.
Bits 3:0 LCAB_PULSEWIDTH[3:0]: Low Pulse Width for LCA and LCB
Pulse width programming for generated pulse.
Note: LCAB_PULSEWIDTH must not be set to values lower than 0x5.
15.8.5 LCSC enable register (LCSC_ENR)
Address offset: 0x10
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| LCSC_EN | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. |
| rw | |||||||||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | CNT_OFB_WKP_IE | TAMP_IE | ACLKWISE_IE | CLKWISE_IE |
| rw | rw | rw | rw |
Bit 31 LCSC_EN: LCSC Enable
Enable (start) or Disable (stop) the LCSC Measurement.
Bits 30:4 Reserved, must be kept at reset value.
Bit 3 CNT_OFB_WKP_IE: LCAB Counter Out Of Bound wakeup enable
Enable the IRQ and the Wakeup event generation on a LCAB count out of bounds
Bit 2 TAMP_IE: Tamper Interrupt and Wakeup Enable
Enable the IRQ and the Wakeup event generation on a tamper detection.
Bit 1 ACLKWISE_IE: Anti Clock Wise Interrupt and Wakeup Enable
Enable the IRQ and Wakeup event generation once the ACLKWISE value is equal or greater than the ACLKWISE_THRES bits.
Bit 0 CLKWISE_IE: Clock Wise Interrupt and Wakeup Enable
Enable the IRQ and Wakeup event generation once the CLKWISE has reached the CLKWISE_THRES value.
15.8.6 LCSC wheel status register (LCSC_WHEEL_SR)
Address offset: 0x14
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ACLKWISE[15:0] | |||||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| CLKWISE[15:0] | |||||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
Bits 31:16 ACLKWISE[15:0]: Number of Anti Clock Wise revolutions
Bits 15:0 CLKWISE[15:0]: Number of Clock Wise revolutions
15.8.7 LCSC wheel configuration register (LCSC_CONFR)
Address offset: 0x18
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ACLKWISE_THRES[15:0] | |||||||||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| CLKWISE_THRES[15:0] | |||||||||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
Bits 31:16 ACLKWISE_THRES: Number of Anti Clock Wise revolutions target
Bits 15:0 CLKWISE_THRES: Number of Clock Wise revolutions target
15.8.8 LCSC comparator counter register (LCSC_COMP_CNT)
Address offset: 0x1C
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Res. | Res. | Res. | Res. | CMP_LCT_CNT[7:0] | Res. | Res. | CMP_LCB_CNT[7:6] | ||||||||
| r | r | r | r | r | r | r | r | r | r | ||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| CMP_LCB_CNT[5:0] | Res. | Res. | CMP_LCA_CNT[7:0] | ||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | ||
Bits 31:28 Reserved, must be kept at reset value.
Bits 27:20 CMP_LCT_CNT[7:0]: LCT Comparator last damping count
Bits 19:18 Reserved, must be kept at reset value.
Bits 17:10 CMP_LCB_CNT[7:0]: LCB Comparator last damping count
Bits 9:8 Reserved, must be kept at reset value.
Bits 7:0 CMP_LCA_CNT[7:0]: LCA Comparator last damping count
15.8.9 LCSC status register (LCSC_SR)
Address offset: 0x20
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | LAST_DIR[1:0] | ACLKWISE_STATE[1:0] | CLKWISE_STATE[1:0] | |||
| r | r | r | r | r | r | ||||||||||
- Bits 31:6 Reserved, must be kept at reset value.
- Bits 5:4 LAST_DIR[1:0]: Lhe last direction detected:
0X: unknown (default value when LCSC is enabled)
10: clockwise
11: counterclockwise - Bits 3:2 ACLKWISE_STATE[1:0]:The current state of the LCSC anti clockwise FSM:
00: Q1
01: Q2
10: Q3
11: Q4 - Bits 1:0 CLKWISE_STATE[1:0]:The current state of the LCSC clockwise FSM:
00: Q1
01: Q2
10: Q3
11: Q4

15.8.10 LCSC statistics register (LCSC_STAT)
Address offset: 0x24
Reset value: 0xFF00 00FF
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| MAX_LCAB_CNT_BOUND[7:0] | MIN_LCAB_CNT_BOUND[7:0] | ||||||||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| MAX_LCAB_CNT[7:0] | MIN_LCAB_CNT[7:0] | ||||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
Bits 31:24 MAX_LCAB_CNT_BOUND[7:0]:The Maximum bound of CMP_LCA_COUNT, CMP_LCB_COUNT used when monitoring the MAX_LCAB_CNT
Bits 23:16 MIN_LCAB_CNT_BOUND[7:0]:The Minimum bound of CMP_LCA_COUNT, CMP_LCB_COUNT used when monitoring the MIN_LCAB_CNT
Bits 15:8 MAX_LCAB_CNT[7:0]:The Maximum of CMP_LCA_CNT, CMP_LCB_CNT reached during the measurement
Bits 7:0 MIN_LCAB_CNT[7:0]:The Minimum of CMP_LCA_CNT, CMP_LCB_CNT reached during the measurement
15.8.11 LCSC interrupt status register (LCSC_ISR)
Address offset: 0x44
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | CNT_O FB_F | TAMP_F | ACLKW ISE_F | CLKWI SE_F |
| rw1c | rw1c | rw1c | rw1c |
Bits 31:8 Reserved, must be kept at reset value.
Bit 4 CNT_OFB_F: Out of Bound Counter Flag
0: Out of Bound not detected
1: Out of Bound detected
Bit 3 TAMP_F: Tamper Flag
0: tamper not detected
1: tamper detected
Bit 2 ACLKWISE_F: Anti Clock Wise Flag
0: counter ACLKWISE has not reached ACLKWISE_THRES
1: counter CLKWISE has reached CLKWISE_THRES
Bit 1 CLKWISE_F: Clock Wise Flag
0: counter CLKWISE has not reached CLKWISE_THRES
1: counter CLKWISE has reached CLKWISE_THRES
15.9 LCSC register map
The following table summarizes the LCSC registers.
Table 38 highlights the registers in the VDD12o power domain, marked with footnote 1. This implies those registers are not reset on Deepstop exit.
Table 38. LCSC register map and reset values
| Offset | Register | 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x00 | LCSC_CR0(1) | Res | Res | Res | Res | Res | TICAP | Res | Res | TCAP | Res | Res | TMEAS | |||||||||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 0 | |||||||
| 0x04 | LCSC_CR1(1) | Res | TSTART_VCM | Res | TREC_VCM | Res | Res | LCAB_DAMP_THRES | ||||||||||||||||||||||||||||||||
| Reset value | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||
| 0x08 | LCSC_CR2(1) | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | LCT_DAMP_THRES | TAMP_PSC | |||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||
| 0x0C | LCSC_PULSE_CR(1) | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | LCT_PULSE_WIDTH | PULSETRIM | LCAB_PULSE_WIDTH | |||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | |||||
| 0x10 | LCSC_ENR(1) | LCSC_EN | CNT_OFB_WKP_IE | TAMP_IE | ACLKWISE_IE | CLKWISE_IE | ||||||||||||||||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
| 0x14 | LCSC_WHEEL_SR(1) | ACLKWISE | CLKWISE | |||||||||||||||||||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
| 0x18 | LCSC_CONFR(1) | ACLKWISE_THRES | CLKWISE_THRES | |||||||||||||||||||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
| 0x1C | LCSC_COMP_CNT(1) | Res | Res | Res | Res | CMP_LCT_CNT | Res | Res | CMP_LCB_CNT | Res | Res | CMP_LCA_CNT | ||||||||||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
| 0x20 | LCSC_SR(1) | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | LAST_DIR | ACLKWISE_STATE | CLKWISE_STATE | |||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
| 0x24 | LCSC_STAT(1) | MAX_LCAB_CNT_BOUND | MIN_LCAB_CNT_BOUND | MAX_LCAB_CNT | MIN_LCAB_CNT | |||||||||||||||||||||||||||||||||||
| Reset value | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | |

Table 38. LCSC register map and reset values (continued)
| Offset | Register | 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x44 | LCSC_ISR | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | CNT_OFB_F | TAMP_F | ACLKWISE_F | CLKWISE_F | |
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1. VDD12o power domain.
Refer to Section 2.2.2: Memory map and register boundary addresses for the register boundary addresses.