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

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

Block diagram of the LCSC showing internal registers, comparator, and external connections.

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:

External Interface Block:

Other signals:

MSv58340V3

Block diagram of the LCSC showing internal registers, comparator, and external connections.

Figure 32. LCSC connection to DAC, COMP, VCMBUFF, GPIOs

Schematic diagram of the LCSC connection to DAC, COMP, VCMBUFF, and GPIOs. The diagram shows three LC networks (LCA, LCB, LCT) connected to a common node VBAT/2. Each network is connected to a GPIO pin (PB1, PA14, PB2) via 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.

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.

Schematic diagram of the LCSC connection to DAC, COMP, VCMBUFF, and GPIOs. The diagram shows three LC networks (LCA, LCB, LCT) connected to a common node VBAT/2. Each network is connected to a GPIO pin (PB1, PA14, PB2) via 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:

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:

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:

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.

Because the wheel is rotating, the LCs do not always see the same surface, in fact we can even describe 4 different positions:

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

Figure 33: LC oscillation damping. The diagram shows a wheel divided into four quadrants, with the right half shaded gray to represent a metallic surface. Two LC networks are shown: LC1 (L1, C1) on the left and LC2 (L2, C2) on the right. Below each network is a graph of voltage versus time. The graph for LC1 shows a blue oscillation that decays slowly, indicating normal damping. The graph for LC2 shows a red oscillation that decays very rapidly, indicating faster damping due to the proximity to the metallic surface.
Figure 33: LC oscillation damping. The diagram shows a wheel divided into four quadrants, with the right half shaded gray to represent a metallic surface. Two LC networks are shown: LC1 (L1, C1) on the left and LC2 (L2, C2) on the right. Below each network is a graph of voltage versus time. The graph for LC1 shows a blue oscillation that decays slowly, indicating normal damping. The graph for LC2 shows a red oscillation that decays very rapidly, indicating faster damping due to the proximity to the metallic surface.

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

Figure 34: Tamper LCT diagram. A circle represents a wheel, divided into four quadrants by a vertical and a horizontal dashed line. The top-right quadrant is shaded gray. Three LC networks are shown: LC1 (bottom-left) with capacitor C1 and inductor L1; LC2 (bottom-right) with capacitor C2 and inductor L2; and LC3 (top-right) with capacitor C3 and inductor L3. The shaded quadrant is positioned between LC1 and LC2, while LC3 is positioned next to the wheel.
Figure 34: Tamper LCT diagram. A circle represents a wheel, divided into four quadrants by a vertical and a horizontal dashed line. The top-right quadrant is shaded gray. Three LC networks are shown: LC1 (bottom-left) with capacitor C1 and inductor L1; LC2 (bottom-right) with capacitor C2 and inductor L2; and LC3 (top-right) with capacitor C3 and inductor L3. The shaded quadrant is positioned between LC1 and LC2, while LC3 is positioned next to the wheel.

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. 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. 2. Configure PB4 as an analog pin using GPIO registers through the GPIOB port mode register (GPIOB_MODER).
  3. 3. Enable VCMBUFF output (VDD33/2, also termed VBAT/2) on PB4 pin setting VCMEN bit in the DAC control register (DAC_CR).
  4. 4. Connect DACOUT_COMPINMINUS to COMP_INMINUS by setting the CMPEN bit in the DAC control register (DAC_CR).
  5. 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. 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. 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.

  1. 8. Program LCSC configuration registers (see LCSC register map).
  2. 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.

  1. 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).
  2. 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.

  1. 12. LCSC enables the LCSC comparator count sub-block (see Figure 31).
  2. 13. LCSC selects the first LC to be measured, LCA.
  3. 14. LCSC waits for two slow clock cycles.
  4. 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.
  5. 16. LCSC receives the outputs of the COMP and increments the LCSC comparator count value for each value received.
  6. 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.
  7. 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.
  8. 19. LCSC waits for \(T_{\text{interCapture}}\) delay (see Figure 35).
  9. 20. LCSC generates a pulse low on LCB (see see LCSC pulse configuration register (LCSC_PULSE_CR)) and \(T_{\text{capture}}\) starts.
  10. 21. LCSC receives the outputs of the COMP and increments the LCSC comparator count value for each value received.
  11. 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.
  12. 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:
    1. a) If a tamper detection is required by the software through the TAMP_PSC[7:0] bits, see step 24.
    2. 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.
    3. c) If there is no need to detect any tamper, and the measurement period \(T_{\text{measurement}}\) is not reached, jump to step 30.
  13. 24. LCSC selects LCT
  14. 25. Wait for a \(T_{\text{interCapture}}\) delay
  1. 26. LCSC generates a pulse low on LCT whose width is programmable (see the LCSC pulse configuration register (LCSC_PULSE_CR)).
  2. 27. LCSC receives the outputs of the COMP and increments the LCSC comparator count value for each value received.
  3. 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.
  4. 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:
    1. 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.
    2. b) The measurement period \(T_{\text{measurement}}\) is not reached yet, continue to step 30.
  5. 30. Ensure that there is not any LC selected (all the LC selection signals at 0)
  6. 31. Disable DAC, VCMBUFF, COMP
  7. 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

Timing diagram for LCSC PB1, PA14, PB2, PB4 control. The vertical axis is 'V+ COMP magnitude' with levels VDD3/2, VTHRES, and VDD33. The horizontal axis is time 't'. The diagram shows a sequence of events: t0, ton, tLCA, tPLCA, tLCB, tPLCB, tLCT, tPLCT, tf, ti, and tLCA+1. Key timing intervals are labeled: T_startInit, T_startVCM, T_CaptureWindow, T_InterCapture, T_Scan, T_Measurement, and T_RecoveryVCM. A red box labeled 'Sometimes Tamper Scan window' is shown between tLCT and tPLCT. A green box labeled 'PW' is shown between tLCA and tPLCA.
Timing diagram for LCSC PB1, PA14, PB2, PB4 control. The vertical axis is 'V+ COMP magnitude' with levels VDD3/2, VTHRES, and VDD33. The horizontal axis is time 't'. The diagram shows a sequence of events: t0, ton, tLCA, tPLCA, tLCB, tPLCB, tLCT, tPLCT, tf, ti, and tLCA+1. Key timing intervals are labeled: T_startInit, T_startVCM, T_CaptureWindow, T_InterCapture, T_Scan, T_Measurement, and T_RecoveryVCM. A red box labeled 'Sometimes Tamper Scan window' is shown between tLCT and tPLCT. A green box labeled 'PW' is shown between tLCA and tPLCA.
  1. 1. \(T_{\text{intercapture}}\) is equal to LCSC_CR0.TICAP + 2 slow clock cycles
  2. 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

A diagram showing a horizontal line representing 'comparator_output value'. Above the line, there are three vertical dashed lines: an orange one labeled 'min bound', a purple one labeled 'Damping count threshold', and a blue one labeled 'max bound'. Between the min bound and the damping threshold, there are orange dots representing 'metallic surface reported'. Between the damping threshold and the max bound, there are blue dots representing 'non-metallic surface reported'. Below the line, there are two labels: 'min LCA/ LCB count' with an arrow pointing to the min bound, and 'max LCA/ LCB count' with an arrow pointing to the max bound. A red arrow points from the text 'out of bound wakeup and IRQ' to the min bound line.
A diagram showing a horizontal line representing 'comparator_output value'. Above the line, there are three vertical dashed lines: an orange one labeled 'min bound', a purple one labeled 'Damping count threshold', and a blue one labeled 'max bound'. Between the min bound and the damping threshold, there are orange dots representing 'metallic surface reported'. Between the damping threshold and the max bound, there are blue dots representing 'non-metallic surface reported'. Below the line, there are two labels: 'min LCA/ LCB count' with an arrow pointing to the min bound, and 'max LCA/ LCB count' with an arrow pointing to the max bound. A red arrow points from the text 'out of bound wakeup and IRQ' to the min bound line.

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

Figure 37: Wheel quarter status. Four circular diagrams labeled Q1, Q2, Q3, and Q4 show the position of a wheel relative to two sensors, L1 and L2. In Q1, the wheel is in the top-left quadrant. In Q2, it is in the top-right quadrant. In Q3, it is in the bottom-left quadrant. In Q4, it is in the bottom-right quadrant. The sensors are represented by coils at the bottom of each circle.
Figure 37: Wheel quarter status. Four circular diagrams labeled Q1, Q2, Q3, and Q4 show the position of a wheel relative to two sensors, L1 and L2. In Q1, the wheel is in the top-left quadrant. In Q2, it is in the top-right quadrant. In Q3, it is in the bottom-left quadrant. In Q4, it is in the bottom-right quadrant. The sensors are represented by coils at the bottom of each circle.

15.6 LCSC interrupts

Two LCSC interrupts are available:

The first one (LCSC interrupt see Table 7: Interrupt vectors) can be generated when:

The second one (LCSC LC_ACTIVITY interrupt) (see Table 7: Interrupt vectors) can be generated when:

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:

15.8 LCSC registers

15.8.1 LCSC control register 0 (LCSC_CR0)

Address offset: 0x00

Reset value: 0x000B 005C

31302928272625242322212019181716
Res.Res.Res.Res.Res.TICAP[2:0]Res.Res.TCAP[5:0]
rwrwrwrwrwrwrwrwrw
1514131211109876543210
Res.Res.TMEAS[13:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrw

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

31302928272625242322212019181716
Res.TSTART_VCM[10:0]Res.TREC_VCM[8:6]
rwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
TREC_VCM[5:0]Res.Res.LCAB_DAMP_THRES[7:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrw

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

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
LCT_DAMP_THRES[7:0]TAMP_PSC[7:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

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

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.LCT_PULSEWIDTH[3:0]PULSETRIM[3:0]LCAB_PULSEWIDTH[3:0]
rwrwrwrwrwrwrwrwrwrwrwrw

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

31302928272625242322212019181716
LCSC_ENRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
rw
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.CNT_OFB_WKP_IETAMP_IEACLKWISE_IECLKWISE_IE
rwrwrwrw

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

31302928272625242322212019181716
ACLKWISE[15:0]
rrrrrrrrrrrrrrrr
1514131211109876543210
CLKWISE[15:0]
rrrrrrrrrrrrrrrr

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

31302928272625242322212019181716
ACLKWISE_THRES[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
CLKWISE_THRES[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

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

31302928272625242322212019181716
Res.Res.Res.Res.CMP_LCT_CNT[7:0]Res.Res.CMP_LCB_CNT[7:6]
rrrrrrrrrr
1514131211109876543210
CMP_LCB_CNT[5:0]Res.Res.CMP_LCA_CNT[7:0]
rrrrrrrrrrrrrr

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

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.LAST_DIR[1:0]ACLKWISE_STATE[1:0]CLKWISE_STATE[1:0]
rrrrrr
ST logo
ST logo

15.8.10 LCSC statistics register (LCSC_STAT)

Address offset: 0x24

Reset value: 0xFF00 00FF

31302928272625242322212019181716
MAX_LCAB_CNT_BOUND[7:0]MIN_LCAB_CNT_BOUND[7:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
MAX_LCAB_CNT[7:0]MIN_LCAB_CNT[7:0]
rrrrrrrrrrrrrrrr

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

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.CNT_O
FB_F
TAMP_FACLKW
ISE_F
CLKWI
SE_F
rw1crw1crw1crw1c

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

OffsetRegister313029282726252423222120191817161514131211109876543210
0x00LCSC_CR0(1)ResResResResResTICAPResResTCAPResResTMEAS
Reset value000000000000101100000000001011100
0x04LCSC_CR1(1)ResTSTART_VCMResTREC_VCMResResLCAB_DAMP_THRES
Reset value001111000000000100001100100000000
0x08LCSC_CR2(1)ResResResResResResResResResResResResResResResResLCT_DAMP_THRESTAMP_PSC
Reset value000000000000000010000000000000000
0x0CLCSC_PULSE_CR(1)ResResResResResResResResResResResResResResResResResResResResResResResResResLCT_PULSE_WIDTHPULSETRIMLCAB_PULSE_WIDTH
Reset value00000000000000000000000000011100000
0x10LCSC_ENR(1)LCSC_ENCNT_OFB_WKP_IETAMP_IEACLKWISE_IECLKWISE_IE
Reset value000000000000000000000000000000000000000
0x14LCSC_WHEEL_SR(1)ACLKWISECLKWISE
Reset value000000000000000000000000000000000000000
0x18LCSC_CONFR(1)ACLKWISE_THRESCLKWISE_THRES
Reset value000000000000000000000000000000000000000
0x1CLCSC_COMP_CNT(1)ResResResResCMP_LCT_CNTResResCMP_LCB_CNTResResCMP_LCA_CNT
Reset value000000000000000000000000000000000000000
0x20LCSC_SR(1)ResResResResResResResResResResResResResResResResResResResResResResResResResResResLAST_DIRACLKWISE_STATECLKWISE_STATE
Reset value000000000000000000000000000000000000000
0x24LCSC_STAT(1)MAX_LCAB_CNT_BOUNDMIN_LCAB_CNT_BOUNDMAX_LCAB_CNTMIN_LCAB_CNT
Reset value111111100000000000000000111111111111111
ST logo
ST logo

Table 38. LCSC register map and reset values (continued)

OffsetRegister313029282726252423222120191817161514131211109876543210
0x44LCSC_ISRRes.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_FTAMP_FACLKWISE_FCLKWISE_F
Reset value0000000000000000000000000000000

1. VDD12o power domain.

Refer to Section 2.2.2: Memory map and register boundary addresses for the register boundary addresses.