37. Audio digital filter (ADF)

37.1 ADF introduction

The audio digital filter (ADF) is a high-performance module dedicated to the connection of external sigma-delta (ΣΔ) modulators. It is mainly targeted for the following applications:

The ADF features one digital serial interface (SITF0) and one digital filter (DFLT0) with flexible digital processing options in order to offer up to 24-bit final resolution.

The ADF serial interface supports several standards allowing the connection of various ΣΔ modulator sensors:

The ADF converts an input data stream into clean decimated digital data words. This conversion is done thanks to low-pass digital filters and decimation blocks. In addition, it is possible to insert a high-pass filter.

The conversion speed and resolution are adjustable according to configurable parameters for digital processing: filter bypass, filter order, decimation ratio. The maximum output data resolution is up to 24 bits. There are two conversion modes: single conversion and continuous modes. The data can be automatically stored in a system RAM buffer through DMA, thus reducing the software overhead.

A sound activity detector (SAD) is available for the detection of sounds or voice signals. The SAD is connected at the output of the DFLT0. Several parameters can be programmed in order to adjust properly the SAD to the sound environment. The SAD strongly reduces the power consumption by preventing the storage of samples into the system memory, as long as the observed signal does not match the programmed criteria.

The digital processing is performed using only the kernel clock. The ADF requests the bus interface clock (AHB clock) only when data must be transferred or when a specific event requests the attention of the system processor.

37.2 ADF main features

37.3 ADF implementation

Table 362. ADF features(1)

Mode or featureADF1
Number of filters (DFLTx) and serial interfaces (SITFx)1
MDF_CKIy/ADF_CKI0 connected to pins-
Sound activity detection (SAD)X
RXFIFO depth (number of 24-bit words)4
ADC connected to ADCITF1ADC3
ADC connected to ADCITF2-
Motor dedicated features (SCD, OLD, OEC, INT, snapshot, break)-
Main path with CIC4, CIC5X
Main path with CIC1,2, 3 or FastSinc-
RSFLT, HPF, SAT, SCALE, DLY, Discard functionsX
Autonomous in Stop modes-

1. ‘X’ = supported, ‘-’ = not supported.

37.4 ADF functional description

37.4.1 ADF block diagram

Figure 373. ADF block diagram

Figure 373. ADF block diagram. This block diagram illustrates the internal architecture of the Audio Digital Filter (ADF). The ADF block is divided into two clock domains: the AHB clock domain (shaded grey) and the adf_ker_ck clock domain (shaded light grey). In the AHB clock domain, the AHB bus connects to the REGIF (Register Interface) block. The REGIF block interfaces with external signals: adf_sad_det, adf_hclk, adf_flt0_it, and adf_flt0_dma. It also connects to the RX FIFO0 block. The adf_trgi signals (adf_trgi0 to adf_trgi7) are multiplexed into a single adf_trgi signal, which is then split to TRIG0 and TRIG_CK blocks. In the adf_ker_ck clock domain, the ADCITF 1/2 (ADC interface) block receives data 'From the ADC' and connects to the Sound activity (1) detector (SAD) and the Digital filter processing (DFLT0) block. The RX FIFO0 block also connects to the DFLT0 block. The TRIG0 and TRIG_CK blocks provide triggers to the DFLT0 block. The DFLT0 block outputs bs_flt0 to the BSMX (Bus Switching Matrix) block. The BSMX block can route data to either the SITF0 (serial interface) block or back to the DFLT0 block. The SITF0 block interfaces with the external ADF_SDIO pin. The CKGEN and control block manages the ADF's clocking, receiving adf_bus_ckreq, adf_ker_ck, and adf_ker_ckreq signals, and providing ADF_CCK0 and ADF_CCK1 outputs. A legend at the bottom identifies the shaded regions as the AHB clock domain and the adf_ker_ck clock domain. The reference ID MSv63650V3 is located in the bottom right corner.
Figure 373. ADF block diagram. This block diagram illustrates the internal architecture of the Audio Digital Filter (ADF). The ADF block is divided into two clock domains: the AHB clock domain (shaded grey) and the adf_ker_ck clock domain (shaded light grey). In the AHB clock domain, the AHB bus connects to the REGIF (Register Interface) block. The REGIF block interfaces with external signals: adf_sad_det, adf_hclk, adf_flt0_it, and adf_flt0_dma. It also connects to the RX FIFO0 block. The adf_trgi signals (adf_trgi0 to adf_trgi7) are multiplexed into a single adf_trgi signal, which is then split to TRIG0 and TRIG_CK blocks. In the adf_ker_ck clock domain, the ADCITF 1/2 (ADC interface) block receives data 'From the ADC' and connects to the Sound activity (1) detector (SAD) and the Digital filter processing (DFLT0) block. The RX FIFO0 block also connects to the DFLT0 block. The TRIG0 and TRIG_CK blocks provide triggers to the DFLT0 block. The DFLT0 block outputs bs_flt0 to the BSMX (Bus Switching Matrix) block. The BSMX block can route data to either the SITF0 (serial interface) block or back to the DFLT0 block. The SITF0 block interfaces with the external ADF_SDIO pin. The CKGEN and control block manages the ADF's clocking, receiving adf_bus_ckreq, adf_ker_ck, and adf_ker_ckreq signals, and providing ADF_CCK0 and ADF_CCK1 outputs. A legend at the bottom identifies the shaded regions as the AHB clock domain and the adf_ker_ck clock domain. The reference ID MSv63650V3 is located in the bottom right corner.
  1. 1. Refer to Section 37.3: ADF implementation to check if the SAD is available.
  2. 2. Refer to Section 37.3: ADF implementation to check if the ADCITF is available, and which ADCs are connected.
  3. 3. The number of trigger inputs depends on the product. Refer to Table 365 for details.

37.4.2 ADF pins and internal signals

Table 363. ADF external pins

Pin namePin typeRemarks
ADF_SDI0InputData signal from external sensors
ADF_CCKy
(y = 0,1)
Input/outputClock outputs for external sensor, or common clock input from external sensors

Table 364. ADF internal signals

Signal nameSignal typeRemarks
adf_trgiInputTrigger inputs to control the acquisition (see Table 365: ADF trigger connections for details)
adf_trgoOutputTrigger output for synchronizing with other MDF instances
Table 364. ADF internal signals (continued)
Signal nameSignal typeRemarks
adf_flt0_dmaInput/outputDMA request/acknowledge signals for the ADF processing chain
adf_flt0_itOutputGlobal interrupt signals
adf_bus_ckreqOutputBus interface clock request output
adf_ker_ckreqOutputKernel clock request output
adf_ker_ckInputKernel clock input
adf_hclkInputAHB bus interface clock input
adf_sad_detOutputSAD sound detection: 1 means that detecting sound
adf_adcitf1_dat[15:0]InputADCITF1 data input
adf_adcitf2_dat[15:0]InputADCITF2 data input
Table 365. ADF trigger connections
Trigger nameDirectionTrigger source/destination
adf_trgiInputFrom exti15
adf_trgoOutputTo mdf_trgi13
Table 366. ADF ADC data connections
ADC data bus nameADC source
adf_adcitf1_dat[15:0]adc3_dat

37.4.3 Serial input interface (SITF)

The SITF0 input interface allows the connection of the external sensor to the digital filter via the bitstream matrix (BSMX). The SITF0 can be configured in the following modes:

The data from the serial interface is routed to the filter in order to perform the PDM to PCM conversion and the sound activity detection.

The serial interface is enabled by setting the SITFEN bit to 1. Once the interface is enabled, it receives serial data from the external ΣΔ modulator.

Note: Before enabling the serial interface, the user must insure that the adf_proc_ck is already enabled (see Section 37.4.5: Clock generator (CKGEN) for details).

The SITF0 is controlled via the ADF serial interface control register 0 (ADF_SITF0CR).

As shown in the Figure 374, ADF_CCK0 or ADF_CCK1 can be selected as clock source, in order to sample the incoming bitstream:

See Table 367 for additional information.

Figure 374. SITF overview

Block diagram of the SITF overview within the ADF. The diagram shows the ADF block containing the SITF0 and CKGEN. The CKGEN receives adf_ker_ck and outputs adf_proc_ck. The SITF0 contains a Serial RX block that receives data from ADF_SDI0 and outputs bs0_r and bs0_f to the BSMX. The Serial RX is controlled by SITFMOD and SCKSRC. The CKGEN also outputs CCK1EN and CCK0EN signals through AND gates to ADF_CCK1 and ADF_CCK0 respectively. A legend indicates that the shaded area is the adf_ker_ck clock domain. Notes (1) and (2) specify SITF0 modes: (1) SITF0 in SPI mode and (2) SITF0 in LF_MASTER SPI mode. The diagram is labeled MSv63651V1.

The diagram illustrates the internal structure of the SITF (Serial Interface for Time-Frequency) within the ADF. The ADF block contains the SITF0 and CKGEN. The CKGEN receives the adf_ker_ck clock and outputs adf_proc_ck. The SITF0 contains a Serial RX block that receives data from ADF_SDI0 and outputs bs0_r and bs0_f to the BSMX. The Serial RX is controlled by SITFMOD and SCKSRC. The CKGEN also outputs CCK1EN and CCK0EN signals through AND gates to ADF_CCK1 and ADF_CCK0 respectively. A legend indicates that the shaded area is the adf_ker_ck clock domain. Notes (1) and (2) specify SITF0 modes: (1) SITF0 in SPI mode and (2) SITF0 in LF_MASTER SPI mode. The diagram is labeled MSv63651V1.

Block diagram of the SITF overview within the ADF. The diagram shows the ADF block containing the SITF0 and CKGEN. The CKGEN receives adf_ker_ck and outputs adf_proc_ck. The SITF0 contains a Serial RX block that receives data from ADF_SDI0 and outputs bs0_r and bs0_f to the BSMX. The Serial RX is controlled by SITFMOD and SCKSRC. The CKGEN also outputs CCK1EN and CCK0EN signals through AND gates to ADF_CCK1 and ADF_CCK0 respectively. A legend indicates that the shaded area is the adf_ker_ck clock domain. Notes (1) and (2) specify SITF0 modes: (1) SITF0 in SPI mode and (2) SITF0 in LF_MASTER SPI mode. The diagram is labeled MSv63651V1.

LF_MASTER and normal SPI modes

The LF_MASTER SPI mode is a special mode allowing the use of an adf_proc_ck clock frequency, only two times bigger than the sensor clock. This mode is dedicated to low-power use-cases, using low-speed sensors.

In LF_MASTER SPI mode, the ADF must provide the bitstream clock to the external sensors via ADF_CCK0 and ADF_CCK1 pins. The ADF receives the bitstream data via the serial data input ADF_SDI0.

For the SITF0, the application must select the same clock than the one provided to the external sensor (ADF_CCK0 or ADF_CCK1), in order to guarantee optimal timing performances. This selection is done via SCKSRC[1:0].

The normal SPI interface is a more flexible interface than the LF_MASTER SPI, but the adf_proc_ck frequency must be at least four times higher than the sensor clock.

The application can select ADF_CCK0 or ADF_CCK1 clock for the capture of the data received via the ADF_SDI0 pin.

The ADF can generate a clock to the sensors via ADF_CCK0 or ADF_CCK1 if needed.

For all SPI modes, the serial data is captured using the rising and the falling edge of the selected clock. The SITF0 always provides the following bitstreams:

According to the sensors connected, one of the two bitstreams may not be available.

The application can select the wanted stream via the BSMX matrix.

Figure 375. SPI timing example

Figure 375: SPI timing example. The diagram shows the timing relationship between ADF_CCK0 or ADF_CCK1, ADF_SDI0, bs0_ck, bs0_r, and bs0_f. ADF_CCK0 or ADF_CCK1 is a clock signal. ADF_SDI0 shows data frames L0, R0, L1, R1, L2, R2, L3, R3. bs0_ck is a clock signal. bs0_r and bs0_f are bitstreams. A sampling point is indicated by a red arrow pointing to the falling edge of ADF_CCK0 or ADF_CCK1. The period F_BS is indicated between the falling edges of ADF_CCK0 or ADF_CCK1. The diagram is labeled MSv63670V1.

The diagram illustrates the SPI timing example. It shows the relationship between the ADF_CCK0 or ADF_CCK1 clock signal, the ADF_SDI0 data signal, and the bitstreams bs0_r and bs0_f. The ADF_SDI0 signal is divided into frames L0, R0, L1, R1, L2, R2, L3, and R3. The bs0_r bitstream is aligned with the falling edges of the ADF_CCK0 or ADF_CCK1 clock, while the bs0_f bitstream is aligned with the rising edges. A sampling point is indicated by a red arrow pointing to the falling edge of ADF_CCK0 or ADF_CCK1. The period F_BS is indicated between the falling edges of ADF_CCK0 or ADF_CCK1. The diagram is labeled MSv63670V1.

Figure 375: SPI timing example. The diagram shows the timing relationship between ADF_CCK0 or ADF_CCK1, ADF_SDI0, bs0_ck, bs0_r, and bs0_f. ADF_CCK0 or ADF_CCK1 is a clock signal. ADF_SDI0 shows data frames L0, R0, L1, R1, L2, R2, L3, R3. bs0_ck is a clock signal. bs0_r and bs0_f are bitstreams. A sampling point is indicated by a red arrow pointing to the falling edge of ADF_CCK0 or ADF_CCK1. The period F_BS is indicated between the falling edges of ADF_CCK0 or ADF_CCK1. The diagram is labeled MSv63670V1.

To properly synchronize/receive the data stream, the adf_proc_ck frequency must be adjusted according to the constraints listed in Table 368.

Clock absence detection

A no-clock-transition period may be detected when the serial interface works in normal SPI mode. This feature can be used to detect a clock failure in the SPI link.

The application can program a timeout value via the STH[4:0] bitfield of the SITF0. If the ADF does not detect clock transitions for a duration of \(STH[4:0] \times T_{adf\_proc\_ck}\), then the CKABF flag is set.

An interrupt can be generated if CKABIE is set to 1. The STH[4:0] bitfield is in the ADF serial interface control register 0 (ADF_SITF0CR).

When the serial interface is enabled, the CKABF flag remains to 1 until a first clock transition is detected.

To avoid spurious clock absence detection, the following sequence must be respected:

  1. 1. Configure the serial interface in normal SPI mode and enable it.
  2. 2. Clear the CKABF flag by writing CKABF bit to 1.

If no clock transition is detected on the serial interface, the hardware immediately sets the CKABF flag to 1.

  1. 3. Read the CKABF flag:
    • – If CKABF = 1, go back to step 2.
    • – If CKABF = 0, a clock has been detected. The CKABIE bit can be set to 1 if the application wants an interrupt on detection of a clock absence.

Note: The clock absence detection feature is not available in the LF_MASTER SPI mode.

Manchester mode

In Manchester coded format, the ADF receives data stream from the external sensor via the ADF_SDI0 pin only.

The ADF_CCK0 and ADF_CCK1 pins are not needed in this mode.

Decoded data and clock signals are recovered from serial stream after Manchester decoding. They are available on bs0_r. There are two possible settings of Manchester codings:

Figure 376. Manchester timing example (SITFMOD = 11)

Timing diagram for Manchester mode showing Data transferred, ADF_SDI0, adf_proc_ck, STH[4:0] = 5, MCNT, bs0_ck, bs0_r, CKABF, and Clear of the CKABF signals. The diagram illustrates the relationship between the Manchester-coded data stream and the internal counters and flags used for decoding.

The diagram shows the following signals over time:

Legend:

MSv63652V1

Timing diagram for Manchester mode showing Data transferred, ADF_SDI0, adf_proc_ck, STH[4:0] = 5, MCNT, bs0_ck, bs0_r, CKABF, and Clear of the CKABF signals. The diagram illustrates the relationship between the Manchester-coded data stream and the internal counters and flags used for decoding.

To decode the incoming Manchester stream, the user must program STH[4:0] in the ADF serial interface control register 0 (ADF_SITF0CR). The STH[4:0] bitfield is used by the SITF0 to estimate the Manchester symbol length and to detect a clock absence. An internal counter (MCNT) is restarted every time a transition is detected in the ADF_SDI0 input. It is used to detect short transitions, long transitions or clock absence. A long transition indicates

that the data value changed. Figure 376 shows a case where the OVR is around height and STH[4:0] = 5.

The estimated Manchester symbol rate (\(T_{SYMB}\)) must respect the following formula:

\[(STH + 1) \times T_{adf\_proc\_ck} < T_{SYMB} < (2 \times STH \times T_{adf\_proc\_ck})\]

It is recommended to compute STH as follows:

\[STH[4:0] = \text{round}\left(\frac{(2 \times OVR) - 1}{3}\right)\]

where OVR represents the ratio between the adf_proc_ck frequency and the expected Manchester symbol frequency. OVR must be higher than five, and the adf_proc_ck clock must be adjusted according to the constraints listed in Table 368.

The clock absence flag CKABF is set to 1 when no transition is detected during more than \(2 \times STH[4:0] \times T_{adf\_proc\_ck}\), or when the SITF0 is not yet synchronized to the incoming Manchester stream. In addition, an interrupt can be generated if the bit CKABIE is set to 1.

When the serial interface is enabled, the ADF must first be synchronized to the incoming Manchester stream. The synchronization ends when a data transition from 0 to 1 or from 1 to 0 (pink circle in the Figure 376) is detected.

The end of the synchronization phase can be checked by following the software sequence:

  1. 1. Clear the CKABF flag in the ADF DFLT0 interrupt status register 0 (ADF_DFLT0ISR) by writing CKABF bit to 1. If the serial interface is not yet synchronized the hardware immediately set the CKABF flag to 1.
  2. 2. Read the CKABF flag:
    • – If CKABF = 1, go back to step 1.
    • – If CKABF = 0, the Manchester interface is synchronized and provides valid data.

Programming example

In the following example, the ADF kernel clock frequency (\(F_{adf\_ker\_ck}\)) is 100 MHz and the received Manchester stream is at about 6 MHz (\(F_{SYMB}\)):

  1. 1. Provide a valid adf_proc_ck to the SITF0.
    The adf_proc_ck frequency must be at least six times higher than the Manchester symbol frequency (means at least 36 MHz).
    PROCDIV is programmed to 1 to perform a division by two of the kernel clock. In that case, \(F_{adf\_proc\_ck} = 50\) MHz (8.33 times higher than the Manchester symbol frequency).
  2. 2. Compute STH.
    OVR is given by: \(OVR = F_{adf\_proc\_ck} / F_{SYMB} = 50 \text{ MHz} / 6 \text{ MHz} = 8.33\).

\[\text{Then } STH[4:0] = \text{round}\left(\frac{(2 \times 8.33) - 1}{3}\right) = 5\]

The minimum allowed frequency for the Manchester stream is then:

\[1 / (2 \times STH \times T_{adf\_proc\_ck}) = 1 / (10 \times 20 \text{ ns}) = 5 \text{ MHz}\]

The maximum allowed frequency for the Manchester stream is then:

\[1 / ((STH+1) \times T_{adf\_proc\_ck}) = 1 / (6 \times 20 \text{ ns}) = 8.33 \text{ MHz}\]

37.4.4 ADC slave interface (ADCITF)

The ADCs are not always connected to the ADF. Refer to Section 37.3 to check the situation for this product.

The ADF allows the connection of up to two ADCs to the filter path. For the filter, the DATSRC[1:0] bitfield in the ADF digital filter configuration register 0 (ADF_DFLT0CICR) allows the application to select data from the ADCs.


Warning: The ADF does not support receiving interleaved data from one of the ADCITF input.


37.4.5 Clock generator (CKGEN)

The RCC (reset and clock controller) provides the following clocks to the ADF:

These clocks are not supposed to be phase locked, so all signals crossing those clock domains are resynchronized.

The clock generator (CKGEN) is responsible of the generation of the processing clock, and the clock provided to the ADF_CCK0 and ADF_CCK1 pins. All those clocks are generated from the adf_ker_ck.

The processing clock (adf_proc_ck) is used to run all the signal processing and to re-sample the incoming serial or parallel stream.

To adapt the kernel clock frequency provided by the RCC, the following dividers are available:

PROCDIV[6:0] and CCKDIV[3:0] must be programmed when no clock is provided to the dividers (CKGDEN = 0).

The adf_proc_ck generation is controlled by CKGDEN.

In addition, the CKGMOD bit allows the application to define the way to trigger the CCKDIV divider:

All the bits and fields controlling the CKGEN are in the ADF clock generator control register (ADF_CKGCRC).

Figure 377. CKGEN overview

Block diagram of the CKGEN overview within the ADF. The diagram shows the internal structure of the CKGEN block. Inputs include adf_ker_ck and cck_trg (from TRIG_CK). Inside CKGEN, adf_ker_ck is ANDed with CKGDEN, then divided by 1 to 128 (PROCDIV[6:0]). The output is multiplexed by CKGMOD (0 or 1) and then divided by 1 to 16 (CCKDIV[3:0]). The output is adf_proc_ck. adf_proc_ck is connected to TRIG0/TRIG_CK, Digital processing (DFLT0, SAD), and Interfaces (ADCITF[2:1], SITF0). It also feeds into CCK0DIR and CCK1DIR. CCK0EN and CCK1EN are ANDed with CCK0DIR and CCK1DIR respectively to produce ADF_CCK0 and ADF_CCK1 outputs. A reference MSv63653V1 is shown at the bottom right.
Block diagram of the CKGEN overview within the ADF. The diagram shows the internal structure of the CKGEN block. Inputs include adf_ker_ck and cck_trg (from TRIG_CK). Inside CKGEN, adf_ker_ck is ANDed with CKGDEN, then divided by 1 to 128 (PROCDIV[6:0]). The output is multiplexed by CKGMOD (0 or 1) and then divided by 1 to 16 (CCKDIV[3:0]). The output is adf_proc_ck. adf_proc_ck is connected to TRIG0/TRIG_CK, Digital processing (DFLT0, SAD), and Interfaces (ADCITF[2:1], SITF0). It also feeds into CCK0DIR and CCK1DIR. CCK0EN and CCK1EN are ANDed with CCK0DIR and CCK1DIR respectively to produce ADF_CCK0 and ADF_CCK1 outputs. A reference MSv63653V1 is shown at the bottom right.

The trigger logic for CKGEN is handled by the block TRG_CK. As shown in Figure 382, the CCKDIV divider can be triggered on the rising or falling edge of an external trigger source. When the proper trigger condition occurs, the cck_trg signal goes to high, allowing the CCKDIV divider to start. The TRG_CK logic is reset when CKGDEN is set to 0.

This feature can be helpful to synchronize the ADF_CCKy (y = 0,1) clock of several ADF instances, or to synchronize the clock generation to a timer event.

The application can control the activation of the ADF_CCK0 or ADF_CCK1 pin thanks to CCK0EN/CCK1EN and CCK0DIR/CCK1DIR bits:

Table 367. Control of the common clock generation(1)
CCKyENCCKyDIRDescription
00The ADF_CCKy pin is in input. An external clock can be connected to the ADF_CCKy pin and used by the SITF0 in order to decode the serial stream
01The ADF_CCKy pin is in output. No clock is generated. The ADF_CCKy pin is driven low.
11The ADF_CCKy pin is in output. A clock is generated on the ADF_CCKy pin. The SITF0 can use this pin as clock source in order to decode the serial stream

1. The configuration with CCKyEN = 1 and CCKyDIR = 0 is not shown must be avoided (no interest).

Note: The adf_proc_ck must be enabled (by CKGDEN = 1) before enabling other blocks (such as SITF0 or DFLT0).

CKGEN activation sequence example

  1. 1. Set CKGDEN to 0.
  2. 2. Wait for CKGACTIVE = 0. If CKGDEN was previously enabled, this phase can take two periods of adf_hclk, and two periods of adf_proc_ck.
  3. 3. Program PROCDIV[6:0], CKGMOD, CCKDIV[3:0], TRGSRC[3:0], TRGSENS, CCK1EN and CCK0EN.
  4. 4. Set CKGDEN to 1.

When needed, at any moment, CCK[1:0]EN bitfield value can be changed without disabling the clock generator.

Clock frequency constraints

Table 368 shows the frequency constraints to receive and process properly the samples.

Note: The reshape filter (RSFLT) needs up to 24 cycles of adf_proc_ck clock to process one sample.

Table 368. Clock constraints with respect to the incoming stream(1)

SITF0 modeADF clock constraints
With RSFLT disabledWith RSFLT enabled
LF_MASTER SPI\(F_{ADF\_CCKy}\) max frequency limited to 5 MHz
\(F_{adf\_proc\_ck} > 2 \times F_{ADF\_CCKy}\)
and
\(F_{adf\_hclk} \geq F_{adf\_proc\_ck}\)
\(F_{adf\_proc\_ck} > 24 \times F_{ADF\_CCKy} / (MCICD+1)\)
and
\(F_{adf\_proc\_ck} > 2 \times F_{ADF\_CCKy}\)
and
\(F_{adf\_hclk} \geq F_{adf\_proc\_ck}\)
MASTER SPI
SLAVE SPI
\(F_{ADF\_CKx}\) max frequency limited to 25 MHz
\(F_{adf\_proc\_ck} > 4 \times F_{ADF\_CCKy}\)
and
\(F_{adf\_hclk} \geq F_{adf\_proc\_ck}\)
\(F_{adf\_proc\_ck} > 24 \times F_{ADF\_CCKy} / (MCICD+1)\)
and
\(F_{adf\_proc\_ck} > 4 \times F_{ADF\_CCKy}\)
and
\(F_{adf\_hclk} \geq F_{adf\_proc\_ck}\)
Manchester\(F_{SYMB}\) max frequency limited to 20 MHz
\(F_{adf\_proc\_ck} > 6 \times F_{SYMB}\)
and
\(F_{adf\_hclk} \geq F_{adf\_proc\_ck}\)
\(F_{adf\_proc\_ck} > 24 \times F_{ADF\_CCKy} / (MCICD+1)\)
and
\(F_{adf\_proc\_ck} > 6 \times F_{SYMB}\)
and
\(F_{adf\_hclk} \geq F_{adf\_proc\_ck}\)
  1. 1. \(F_{ADF\_CCKy}\) represents the frequency of clock received via ADF_CCKy, or generated via ADF_CCKy. \(F_{SYMB}\) represents the frequency of the received symbol rate for Manchester mode.

37.4.6 Bitstream matrix (BSMX)

The BSMX receives the bitstreams from the serial interface SITF0 and provides the selected stream to the digital filter DFLT0.

As shown in Figure 373, the SITF0 provides two bitstreams (bs0_r and bs0_f) to the BSMX.

The application to select the wanted stream via the ADF bitstream matrix control register 0 (ADF_BSMX0CR). This selection is intended to be static.

Figure 378. BSMX overview

Block diagram of the BSMX overview within the ADF. The ADF block contains ADCITF[2,1], DFLT0, and BSMX. ADCITF[2,1] connects to DFLT0. DFLT0 connects to BSMX via bs_flt0. BSMX contains a multiplexer controlled by BSSEL, which selects between bs0_r and bs0_f from SITF0. The output of the multiplexer is bs_flt0. A crossed-switch symbol is also shown inside BSMX. The diagram is labeled MSv63654V1.

The diagram illustrates the BSMX (Bitstream Matrix) overview within the ADF (Audio Digital Filter). The ADF block contains ADCITF[2,1], DFLT0, and BSMX. ADCITF[2,1] connects to DFLT0. DFLT0 connects to BSMX via bs_flt0. BSMX contains a multiplexer controlled by BSSEL, which selects between bs0_r and bs0_f from SITF0. The output of the multiplexer is bs_flt0. A crossed-switch symbol is also shown inside BSMX. The diagram is labeled MSv63654V1.

Block diagram of the BSMX overview within the ADF. The ADF block contains ADCITF[2,1], DFLT0, and BSMX. ADCITF[2,1] connects to DFLT0. DFLT0 connects to BSMX via bs_flt0. BSMX contains a multiplexer controlled by BSSEL, which selects between bs0_r and bs0_f from SITF0. The output of the multiplexer is bs_flt0. A crossed-switch symbol is also shown inside BSMX. The diagram is labeled MSv63654V1.

BSMX programming sequence example

The BSSEL[4:0] bitfield cannot be changed if the DFLT0 is enabled. The following steps are needed to change the value of BSMX:

  1. 1. Set DFLTEN of DFLT0 to 0.
  2. 2. Wait for BSMXACTIVE = 0.
  3. 3. Program BSSEL[4:0].
  4. 4. Set DFLTEN of DFLT0 to 1.

37.4.7 Digital filter processing (DFLT)

The digital filter processing includes the following sub-blocks:

Figure 379 shows the filter path configuration according to CICMOD[2:0]. Several configuration bits are available to configure the digital filter to the application needs.

Figure 379. DFLT overview

Block diagram of the DFLT0 audio digital filter overview. The diagram shows three frequency domains: F_PCM, F_RS, and F_BS. The F_PCM domain includes an RX FIFO, a 23:0 PCM bus, a multiplexer (0/1), and a Discard logic block. The F_RS domain includes HPFC, RSFLT, RSFLTD, HPFBYP, RSFLTBYP, SAT, and SCALE blocks. The F_BS domain includes MCIC4, MCIC5, D1, DLY, DATSRC, and SBR blocks. The entire system is clocked by adf_proc_ck. Inputs come from ADCITF2, ADCITF1, and BSMX. The output is from the RX FIFO.

The diagram illustrates the DFLT0 audio digital filter architecture. It is divided into three main frequency domains: \(F_{PCM}\), \(F_{RS}\), and \(F_{BS}\). The \(F_{PCM}\) domain starts with an RX FIFO receiving PCM data (23:0). A multiplexer (0/1) selects between the FIFO and a Discard logic block. The \(F_{RS}\) domain includes HPFC, RSFLT, RSFLTD, HPFBYP, RSFLTBYP, SAT, and SCALE blocks. The \(F_{BS}\) domain includes MCIC4, MCIC5, D1, DLY, DATSRC, and SBR blocks. The entire system is clocked by adf_proc_ck. Inputs come from ADCITF2, ADCITF1, and BSMX. The output is from the RX FIFO.

Block diagram of the DFLT0 audio digital filter overview. The diagram shows three frequency domains: F_PCM, F_RS, and F_BS. The F_PCM domain includes an RX FIFO, a 23:0 PCM bus, a multiplexer (0/1), and a Discard logic block. The F_RS domain includes HPFC, RSFLT, RSFLTD, HPFBYP, RSFLTBYP, SAT, and SCALE blocks. The F_BS domain includes MCIC4, MCIC5, D1, DLY, DATSRC, and SBR blocks. The entire system is clocked by adf_proc_ck. Inputs come from ADCITF2, ADCITF1, and BSMX. The output is from the RX FIFO.

Symbol remap and source selection

The symbol remap (SBR) converts the bitstream selected by the BSMX into data usable by the filter path. More especially:

The signal source of the digital filter can be selected via DATSRC[1:0] between the two following:

Programmable micro-delay control (DLY)

The digital filter has a delay line that allows the timing adjustment of each stream with the resolution of the bitstream clock.

This feature is particularly helpful in the case of microphone beam forming applications where delays smaller than the final sampling rate must be applied to the incoming stream. This feature can be used when the ADF is synchronized with another MDF instance (if present in the product) for a beam forming application for example.

The delay is performed by discarding a given number of samples from the selected input stream, before samples enter into the CIC filter. This data discarding is done by skipping a given number of data strobe, preventing the CIC filter to take into account those data.

When the wanted amount of data strobe has been skipped, the next incoming samples are strobed normally.

Table 380 shows an example on how to apply dynamically small delay to an incoming stream. For simplification, the CIC filter performs a decimation by height in this example. CIC1 represents the CIC included in the ADF and CIC0 represents a filter from another MDF instance (if present in the product).

Figure 380. Programmable delay

Timing diagram for Programmable delay showing CIC0 and CIC1 inputs, data strobes, decimation counters, and outputs. It illustrates how CIC1 skips samples b10, b11, and b12, causing a delay in sample delivery for CIC1 compared to CIC0.

The diagram illustrates the timing relationship between CIC0 and CIC1 inputs, data strobes, decimation counters, and outputs.
CIC0 input: 32-bit data words (a0-a31) with data strobes.
CIC1 input: 32-bit data words (b0-b31) with data strobes.
Decimation counter of CIC0: Counts 0-7, then resets to 0.
Decimation counter of CIC1: Counts 0-7, then resets to 0.
CIC0 output: Shows samples N-2, N-1, N, and N+1. Sample N is built from input samples a[15:8], Sample N+1 from a[23:16].
CIC1 output: Shows samples N-2, N-1, N, and N+1. Sample N is built from input samples b8, b9, b[18:13], Sample N+1 from b[26:19].
Annotations:

Timing diagram for Programmable delay showing CIC0 and CIC1 inputs, data strobes, decimation counters, and outputs. It illustrates how CIC1 skips samples b10, b11, and b12, causing a delay in sample delivery for CIC1 compared to CIC0.

The CIC of the ADF (CIC1) receives a command in order to skip three incoming samples. So the input samples named b10, b11 and b12 are not processed by CIC1. As a consequence, the output sample N+1 generated by CIC0 is built from input samples a[23:16] while the sample N+1 of CIC1 is built from input samples b[26:19].

Finally, the non-skipped data stream looks delayed by three bitstream periods.

Note: When the input data strobes are skipped, the decimation counter remains frozen. As a consequence, the samples delivered by the CIC1 are a bit delayed.

The following steps are needed to program the amount of bitstream clock periods to be skipped:

  1. 1. Wait for SKPBF equal to 0.
  2. 2. Write SKPDLY[6:0] to the wanted number of bitstream clock periods to be skipped. The SKPBF flag goes immediately to 1, indicating that the delay value entered into SKPDLY[6:0] is under process.
    • – If the DFLT0 is not yet enabled (DFLTEN = 0), then the DLY logic waits for DFLTEN = 1. When the application sets DFLTEN to 1, the DLY logic starts to skip the amount of wanted data strobes.
    • – If the DFLT0 is already enabled (DFLTEN = 1), then the DLY logic immediately starts to skip the amount of wanted data strobes.

When the ADF skipped the amount of wanted data strobes, then SKPBF goes back to 0.

  1. 3. If the application needs to skip more data strobes, then the operation must be restarted from step 1.

The effect of the delay performed with this mechanism is cumulative as long as the ADF is enabled. If the application performs a D1 delay followed by a D2 delay, then all other active filters are delayed by D1 + D2.

Note: If SKPDLY[6:0] is written when SKPBF = 1, the write operation is ignored.

Cascaded-integrator-comb (CIC) filter

The CIC digital filters are an efficient implementation of low-pass filters, often used for decimation and interpolation. The CIC frequency response is equal to a SincN function, this is why they are often called Sinc filters.

The \(\text{Sinc}^N\) digital filter embedded into the ADF can be configurable in Sinc⁴ or Sinc⁵, according to CICMOD:

The filters have the following transfer function:

\[H(z) = \left( \frac{1 - z^{-D}}{1 - z^{-1}} \right)^N\]

where N can be 4 or 5, and D is the decimation ratio. D is equal to MCICD+1.

Figure 381. CIC4 and CIC5 frequency response with decimation ratio = 32 or 16

Figure 381: CIC4 and CIC5 frequency response with decimation ratio = 32 or 16. The figure consists of two subplots. The top subplot shows the frequency response from 0 to 5 x 10^5 Hz, with the y-axis representing Normalized Magnitude (dB) from 0 to -160. It displays four curves: CIC5, DEC32 (solid black), CIC4, DEC32 (solid red), CIC5, DEC16 (dashed black), and CIC4, DEC16 (dashed red). The bottom subplot shows the frequency response from 0 to 10000 Hz, with the y-axis representing Normalized Magnitude (dB) from 0 to -8. It displays the same four curves. The legend in both plots identifies the curves: CIC5, DEC32 (solid black), CIC4, DEC32 (solid red), CIC5, DEC16 (dashed black), and CIC4, DEC16 (dashed red).
Figure 381: CIC4 and CIC5 frequency response with decimation ratio = 32 or 16. The figure consists of two subplots. The top subplot shows the frequency response from 0 to 5 x 10^5 Hz, with the y-axis representing Normalized Magnitude (dB) from 0 to -160. It displays four curves: CIC5, DEC32 (solid black), CIC4, DEC32 (solid red), CIC5, DEC16 (dashed black), and CIC4, DEC16 (dashed red). The bottom subplot shows the frequency response from 0 to 10000 Hz, with the y-axis representing Normalized Magnitude (dB) from 0 to -8. It displays the same four curves. The legend in both plots identifies the curves: CIC5, DEC32 (solid black), CIC4, DEC32 (solid red), CIC5, DEC16 (dashed black), and CIC4, DEC16 (dashed red).

CIC output data size

The size of samples delivered by the CIC (\(DS_{CIC}\)), depends on the following parameters:

The CIC order and decimation ratio must be programmed in order to insure that the data size does not exceed the 26-bit CIC capability.

The following formula gives the output data size (\(DS_{CIC}\)) according to the parameters above.

\[DS_{CIC} = \left( \frac{N \times \text{Ln}(D)}{\text{Ln}(2)} \right) + DS_{IN}\]

and the CIC gain is given by this formula:

\[G_{CIC} = (D)^N\]

The decimation ratio can be adjusted from 2 to 512 for the CIC filter.

Table 369 gives some data output size in bits for some decimation values, when the data source is a full-scale signal coming from the serial interface or from a 12-bit ADC.

Note: \(DS_{IN} = 1\) bit for a serial bitstream, but can be up to 16 bits when coming from the ADCITF.

Table 369. Data size according to CIC order and CIC decimation values

DecimationData size (bits) when \(DS_{IN} = 1\) bit
(data from SITF0)
Data size (bits) when \(DS_{IN} = 12\) bits
(data from ADCITF)
Sinc4Sinc5Sinc4Sinc5
49112022
8131624-
10151826-
121619--
161721--
201923--
242024--
322126--
4824---
6425---
7626---

Note: For a full-scale input signal, the decimation ratio must not exceed 76 for a Sinc4 and 32 for a Sinc5.

The LSB parts of the data provided by the CIC is not necessarily significant: it depends on the sensor performances and the ability of the CIC to reject the out-of-band noise.

The sample size at CIC output can be adjusted thanks to the SCALE block.

Scaling (SCALE) and saturation (SAT)

The SCALE block allows the application to adjust the amplitude of the signal provided by the CIC, by steps of 3 dB (±0.5 dB).

The signal amplitude can be decreased by up to 8 bits (- 48.2 dB), and can be increased by up to 12 bits (+ 72.2 dB).

The gain is adjusted by the SCALE[5:0] bitfield in the ADF digital filter configuration register 0 (ADF_DFLT0CICR).

SCALE[5:0] can be changed even if the DFLT0 is enabled. During the gain transition, the signal provided by the filter is disturbed.

Due to internal resynchronization, there is a delay of some cycles of adf_proc_ck clock between the moment where the application writes the new gain, and the moment where the gain is effectively applied to the samples. If the application attempts to write a new gain value while the previous one is not yet applied, this new gain value is ignored. Reading back SCALE[5:0] informs the application on the current gain value.

Table 370 shows the possible gain values.

Table 370. Possible gain values

SCALE[5:0]Gain (dB)SCALE[5:0]Gain (dB)SCALE[5:0]Gain (dB)SCALE[5:0]Gain (dB)
0x20- 48.20x2B- 14.50x06+ 18.10x11+ 51.7
0x21- 44.60x2C- 12.00x07+ 21.60x12+ 54.2
0x22- 42.10x2D- 8.50x08+ 24.10x13+ 57.7
0x23- 38.60x2E- 6.00x09+ 27.60x14+ 60.2
0x24- 36.10x2F- 2.50x0A+ 30.10x15+ 63.7
0x25- 32.60x000.00x0B+ 33.60x16+ 66.2
0x26- 30.10x01+ 3.50x0C+ 36.10x17+ 69.7
0x27- 26.60x02+ 6.00x0D+ 39.60x18+ 72.2
0x28- 24.10x03+ 9.50x0E+ 42.1--
0x29- 20.60x04+ 12.00x0F+ 45.7--
0x2A- 18.10x05+ 15.60x10+ 48.2--

The SAT blocks avoid having a wrap-around of the binary code when the code exceeds its maximal or minimal value.

The ADF performs saturation operations at the following levels:

The SATF bit informs the application that a saturation occurred either after the SCALE, inside the RSFLT or after the HPF. In addition, an interrupt can be generated if SATIE is set to 1. As soon as a saturation is detected, the SATF flag is set to 1. It is up to the application to clear this flag in order to be able to detect a new saturation.

Those bits are in the ADF DFLT0 interrupt enable register (ADF_DFLT0IER) and ADF DFLT0 interrupt status register 0 (ADF_DFLT0ISR).

Gain adjustment policy

To get the best ADF performances, it is important to properly adjust the gain value via SCALE[5:0].

A usual way to adjust the gain is to select the SCALE[5:0] value that gives a final signal amplitude as close as possible to the 24-bit full-scale, for the maximum input signal.

A way to select the optimal gain is detailed below:

  1. 1. Check that, for the expected input signal, the data size into the CIC filter does not exceed 26 bits. This can be checked using this formula:

\[\frac{\text{LN}(\text{SIN}_{pp} \cdot D^N)}{\text{LN}(2)} < 26\]

where N represents the CIC order, D the decimation ratio and \(\text{SIN}_{pp}\) the maximum peak-to-peak amplitude of the input signal.

\(\text{SIN}_{pp}\) can take:

Example: a Sinc⁴ can be used with a decimation ratio of 96, if the maximum input signal does not exceed ±0.35. Indeed:

\[\frac{\text{LN}(0.7 \cdot 96^4)}{\text{LN}(2)} \sim 25.82 \text{ bits} < 26 \text{ bits}\]

2. Adjust the SCALE value.

To select the most appropriate SCALE value, the user must check if the RSFLT is used or not. If the RSFLT is used, the data size at SCALE output must not exceed 22 bits, otherwise the data size can be up to 24 bits.

The SCALE value in dB must be selected using this formula:

\[\text{SCALE}_{\text{dB}} < 20 \cdot \log_{10} \left( \frac{2^{\text{NB}}}{\text{SIN}_{\text{pp}} \cdot D^N} \right)\]

where NB is equal to 22 if RSFLT is enabled, or 24 if RSFLT is bypassed. \(\text{SCALE}_{\text{dB}}\) represents the gain value selected by SCALE[5:0].

Example: For a Sinc4 with a decimation ratio of 96 and a \(\text{SIN}_{\text{pp}}\) of 0.7.

\[20 \cdot \log_{10} \left( \frac{2^{24}}{0.7 \cdot 96^4} \right) \sim 11 \text{ dB}\]

\(\text{SCALE}_{\text{dB}}\) value must be lower than - 11 dB, the closest lower value is - 12dB (SCALE[5:0] = 0x2C).

\[20 \cdot \log_{10} \left( \frac{2^{22}}{0.7 \cdot 96^4} \right) \sim 23 \text{ dB}\]

\(\text{SCALE}_{\text{dB}}\) value must be lower than - 23 dB, the closest lower value is - 24.1 dB (SCALE[5:0] = 0x28).

If SCALE[5:0] is set to a higher value, then a saturation may occur. An event flag informs the user if a saturation occurred.

Table 371 proposes gain values for different filter configurations, when the data comes from the SITF0, according to the MCIC order, and the MCIC decimation ratio. This table is not exhaustive and considers a full-scale input signal (see Section 37.7.5: Total ADF gain for details).

Table 371. Recommended maximum gain values versus CIC decimation ratios

CIC decimation ratioGain settings (dB) for configuration SITF + CICx + RSFLT (+ HPF)Gain settings (dB) for configuration SITF + CICx (+ HPF)
CIC5CIC4CIC5CIC4
833.651.745.763.7
1218.139.630.151.7
163.527.615.639.6
20- 6.021.66.033.6
24- 12.015.6027.6
28- 20.69.5- 8.521.6

Table 371. Recommended maximum gain values
versus CIC decimation ratios (continued)

CIC
decimation
ratio
Gain settings (dB) for configuration
SITF + CICx + RSFLT (+ HPF)
Gain settings (dB) for configuration
SITF + CICx (+ HPF)
CIC5CIC4CIC5CIC4
32- 26.63.5- 4.515.6
48-- 8.5-3.5
64-- 20.6-- 8.5

Reshaping filter (RSFLT)

In addition to the CIC, the ADF offers a reshaping IIR filter mainly dedicated to the audio application, but also usable in other applications.

When the RSFLT is used, the sample size at its input must not exceed 22 bits.

The samples at the RSFLT output can be decimated by four or not according to the RSFLTD bit in the ADF reshape filter configuration register 0 (ADF_DFLT0RSFR).

The RSFLT can be bypassed by setting RSFBYP to 1 in the ADF reshape filter configuration register 0 (ADF_DFLT0RSFR).

Table 372 shows which sampling rate must be provided to the RSFLT in order to process the most common audio streams.

The RSFLT cutoff frequency (FC) depends on the sample rates at its input (FRS), and is given by the following formula:

\[\mathrm{F_C} = 0.111 \times \mathrm{F_{RS}}\]

Table 372. Most common microphone settings

Sample rate (kHz) at RSFLT (FRS)Pass band (kHz)D2PCM sampling rate (kHz)
323.5548
647.1416
12814.2432
19221.3448

Table 382 shows the frequency response of the reshape filter.

Figure 382. Reshape filter frequency response normalized (\(F_{RS} / 2 = 1\))

Figure 382: Reshape filter frequency response normalized (F_RS / 2 = 1). The figure consists of two plots. The top plot shows Magnitude (dB) on the y-axis (from -80 to 10) versus Normalized frequency (xπ rad/sample) on the x-axis (from 0 to 0.9). The response is flat at 10 dB until approximately 0.25, then drops sharply to a minimum of about -75 dB at 0.3, followed by a series of ripples. The bottom plot shows Magnitude (dB) on the y-axis (from 6 to 10.5) versus Normalized frequency (xπ rad/sample) on the x-axis (from 0 to 0.2). The response is relatively flat around 9.3 dB, with a slight peak of about 10.3 dB at 0.22. The label 'MSv62664V1' is in the bottom right corner.
Figure 382: Reshape filter frequency response normalized (F_RS / 2 = 1). The figure consists of two plots. The top plot shows Magnitude (dB) on the y-axis (from -80 to 10) versus Normalized frequency (xπ rad/sample) on the x-axis (from 0 to 0.9). The response is flat at 10 dB until approximately 0.25, then drops sharply to a minimum of about -75 dB at 0.3, followed by a series of ripples. The bottom plot shows Magnitude (dB) on the y-axis (from 6 to 10.5) versus Normalized frequency (xπ rad/sample) on the x-axis (from 0 to 0.2). The response is relatively flat around 9.3 dB, with a slight peak of about 10.3 dB at 0.22. The label 'MSv62664V1' is in the bottom right corner.

The RSFLT gain is close to 9.3 dB, so the output data size is a little bit lower than 24 bits for a 22-bit wide input signal.

The RSFLT takes 24 clock cycles of adf_proc_ck clock to process one sample at \(F_{RS}\). When the RSFLT is enabled, the application must insure that the adf_proc_ck is at least 24 times faster \(F_{RS}\).

The RSFLT generates an event (rfovr_evt) and sets the RFOVRF flag, if the RSFLT receives a new samples while the previous one is still under processing.

When RFOVRF is set, the samples provided by the RSFLT are invalid. The application must then stop the data acquisition and provides a faster adf_proc_ck clock to the RSFLT.

High-pass filter (HPF)

The high-pass filter suppresses the low-frequency content from the final output data stream in case of continuous conversion mode. The high-pass filter can be enabled or disabled via HPFBYP in the ADF reshape filter configuration register 0 (ADF_DFLT0RSFR).

The HPF is useful when there is parasitic low-frequency noise (or DC signal) in the input data source that must be removed from the final data.

The HPF is a first order IIR filter and the cut-off frequency can be selected via HPFC[1:0] in the ADF reshape filter configuration register 0 (ADF_DFLT0RSFR), among the following values:

Table 373. HPF 3 dB cut-off frequency examples

HPFC3 dB cut-off frequency for common \(F_{\text{PCM}}\) frequencies (Hz)
\(F_{\text{PCM}} = 8 \text{ kHz}\)\(F_{\text{PCM}} = 16 \text{ kHz}\)\(F_{\text{PCM}} = 48 \text{ kHz}\)
051030
1102060
22040120
376152456

The HPF output is saturated at 24 bits. The SATF flag is set if a sample is saturated.

37.4.8 Digital filter acquisition modes

The ADF offers the following modes to perform a data capture:

Note: To perform a data capture, the filter, the interface providing the data (SITF0 or ADCITF) and the CKGEN must be enabled. If needed, the ADF_CCK0 or ADF_CCK1 must be enabled as well.

The filter can be stopped immediately when DFLTEN is set to 0. This action resets the filter and flushes the RXFIFO. The DFLTACTIVE flag also goes back to 0 when the RXFIFO and the filter is reset.

Table 383 shows a simplified view of the trigger logic available for each filter and for the clock generator.

Figure 383. Trigger logic for DFLT and CKGEN

Figure 383: Trigger logic for DFLT and CKGEN. Block diagram showing ADF containing TRIG0 and TRIG_CK logic blocks driven by adf_trgi and TRGO inputs through a RESYNC and edge detection block operating in adf_proc_ck clock domain, controlling DFLT0 and CKGEN.
Figure 383: Trigger logic for DFLT and CKGEN. Block diagram showing ADF containing TRIG0 and TRIG_CK logic blocks driven by adf_trgi and TRGO inputs through a RESYNC and edge detection block operating in adf_proc_ck clock domain, controlling DFLT0 and CKGEN.

A block common to all TRIG blocks performs the rising and falling edges detection and the resynchronization of the input trigger to the adf_ker_ck clock domain. This implementation allows the application to use triggers with pulse width smaller than the adf_ker_ck period.

In synchronous modes, the TRIG block offers the possibility to select adf_trgi or TRGO bit as trigger sources. The TRGO bit is in the ADF global control register (ADF_GCR).

The edge sensitivity can also be selected.

Asynchronous continuous acquisition mode

This mode allows the application to start a continuous acquisition by simply writing the DFLTEN bit to 1.

The asynchronous continuous acquisition mode is selected when ACQMOD[2:0] = 0.

The sequence below shows the most important programming steps (assuming that DFLTEN is set to 0):

  1. 1. Configure and enable the clock generator (CKGEN) so that the adf_proc_ck frequency is compatible with the targeted application (see examples in Table 377).
  2. 2. Enable the CKGEN (CKGDEN = 1) and, if needed, enable the ADF_CCK0 and ADF_CCK1 clocks.
  3. 3. Program the filter configuration and set the ACQMOD[2:0] to 0.
  4. 4. Set to 1 the SITFEN bit of the serial data interface.
  5. 5. Before setting DFLTEN to 1, wait for DFLTACTIVE = 0: it insures that the previous filter deactivation sequence terminated properly.
  6. 6. When DFLTEN is set to 1, the acquisition sequence starts immediately.

Figure 384 shows a simplified example of the samples generated by the DFLT0.

Figure 384. Asynchronous continuous mode (ACQMOD[2:0] = 0)

Timing diagram for Asynchronous continuous mode (ACQMOD[2:0] = 0). The diagram shows five signals: DFLTEN, DFLT0 output, DFLTRUN, ADFLTACTIVE, and ADF_CCKy. DFLTEN is a high pulse that triggers the acquisition. DFLTRUN is a high pulse that starts when DFLTEN goes high and ends when DFLTEN goes low. ADFLTACTIVE is a high pulse that starts when DFLTRUN goes high and ends when DFLTRUN goes low. ADF_CCKy is a continuous high signal. The DFLT0 output shows a sequence of samples: X, ..., X, S1, S2, ..., SN, OFF. A 'Discard (note)' label with a red arrow points to the first sample 'X'. A 'Dropped !' label with a red arrow points to the last sample 'SN'.

Note: the discard phase is optional.

MSv63657V1

Timing diagram for Asynchronous continuous mode (ACQMOD[2:0] = 0). The diagram shows five signals: DFLTEN, DFLT0 output, DFLTRUN, ADFLTACTIVE, and ADF_CCKy. DFLTEN is a high pulse that triggers the acquisition. DFLTRUN is a high pulse that starts when DFLTEN goes high and ends when DFLTEN goes low. ADFLTACTIVE is a high pulse that starts when DFLTRUN goes high and ends when DFLTRUN goes low. ADF_CCKy is a continuous high signal. The DFLT0 output shows a sequence of samples: X, ..., X, S1, S2, ..., SN, OFF. A 'Discard (note)' label with a red arrow points to the first sample 'X'. A 'Dropped !' label with a red arrow points to the last sample 'SN'.

Note: The acquisition can be stopped by setting DFLTEN back to 0. This resets the filter and flushes the RXFIFO, so the samples located into the RXFIFO are lost. The ongoing DMA transfer is properly terminated. DFLTACTIVE goes back to 0 when the filter chain is reset and the RXFIFO flushed.

Asynchronous single-shot acquisition mode

This mode allows the application to start the acquisition of one sample by simply writing the DFLTEN bit to 1.

The asynchronous single-shot acquisition mode is selected when ACQMOD[2:0] = 001.

The sequence below shows the most important programming steps (assuming that DFLTEN is set to 0):

  1. 1. Configure and enable the clock generator (CKGEN), so that the adf_proc_ck frequency is compatible with the targeted application (see examples in Table 377).
  2. 2. Enable the CKGEN (CKGDEN = 1) and, if needed, enable the ADF_CCK0 and ADF_CCK1 clocks.
  3. 3. Program the filter configuration, and set the ACQMOD[2:0] to 001.
  4. 4. Set to 1 the SITFEN bit.
  5. 5. Before setting DFLTEN to 1, wait for DFLTACTIVE = 0: it insures that the previous filter deactivation sequence terminated properly.
  6. 6. When DFLTEN is set to 1, the filter provides one data to the RXFIFO and stops the acquisition.

To trigger a new acquisition, the application must:

  1. 1. Check that the previous acquisition is completed, by waiting that DFLTRUN = 0.
  2. 2. Set again DFLTEN to 1.

This sequence can be repeated every time a new data must be converted.

As shown in Figure 384, every time DFLTEN is set to 1, an acquisition sequence is triggered. The first samples provided by the filter can be discarded if needed. At the end of each conversion, the decimation counters and filter taps are reset, and the filter is ready to start a new conversion.

If DFLTEN is set to 0 while an acquisition is ongoing, the ongoing conversion is stopped (in the example, S3 is lost). This situation can be avoided with the following steps:

  1. 1. Wait for DFLTRUN = 0.
  2. 2. Read the sample from the RXFIFO.
  3. 3. Set DFLTEN to 0.

Figure 385. Asynchronous single-shot mode (ACQMOD[2:0] = 001)

Timing diagram for Asynchronous single-shot mode (ACQMOD[2:0] = 001). The diagram shows the relationship between DFLTEN, Writing to DFLTEN, DFLT0 output, DFLTRUN, DFLTACTIVE, and ADF_CCK. DFLTEN is a high-level signal that is pulsed low to write new values. Writing to DFLTEN shows pulses of '1' and '0'. DFLT0 output shows sample sequences S1, S2, and S3, with a 'Discard (note)' phase before each. DFLTRUN is a pulse that starts when DFLTEN is written to '1' and ends when DFLTEN is written to '0'. DFLTACTIVE is a pulse that starts when DFLTRUN starts and ends when DFLTRUN ends. ADF_CCK is a continuous clock signal. A note indicates that the discard phase is optional. A label 'Dropped!' points to the end of S3, indicating it was lost when DFLTEN was set to 0.

Note: the discard phase is optional.

MSv63660V1

Timing diagram for Asynchronous single-shot mode (ACQMOD[2:0] = 001). The diagram shows the relationship between DFLTEN, Writing to DFLTEN, DFLT0 output, DFLTRUN, DFLTACTIVE, and ADF_CCK. DFLTEN is a high-level signal that is pulsed low to write new values. Writing to DFLTEN shows pulses of '1' and '0'. DFLT0 output shows sample sequences S1, S2, and S3, with a 'Discard (note)' phase before each. DFLTRUN is a pulse that starts when DFLTEN is written to '1' and ends when DFLTEN is written to '0'. DFLTACTIVE is a pulse that starts when DFLTRUN starts and ends when DFLTRUN ends. ADF_CCK is a continuous clock signal. A note indicates that the discard phase is optional. A label 'Dropped!' points to the end of S3, indicating it was lost when DFLTEN was set to 0.

Note: The acquisition can be stopped by setting DFLTEN back to 0. This resets the filter and flushes the RXFIFO, so the samples located into the RXFIFO are lost. The ongoing DMA transfer is properly terminated. DFLTACTIVE goes back to 0 when the filter chain is reset and the RXFIFO flushed.

Synchronous continuous acquisition mode

This mode allows the application to start a continuous acquisition by using one of the following trigger sources:

The Synchronous continuous acquisition mode is selected when ACQMOD[2:0] = 010.

The sequence below shows the most important programming steps (assuming that DFLTEN is set to 0):

  1. 1. Configure and enable the clock generator (CKGEN), so that the frequency of adf_proc_ck clock is compatible with the targeted application (see examples in Table 377).
  2. 2. Enable the CKGEN (CKGDEN = 1) and, if needed, enable the ADF_CCK0 and ADF_CCK1 clocks.
  3. 3. Program the filter configuration and set the ACQMOD[2:0] to 010.
  4. 4. Set to 1 the bit SIFTEN.
  5. 5. Select the proper trigger source and sensitivity.
  6. 6. Before setting DFLTEN to 1, wait for DFLTACTIVE = 0: it insures that the previous filter deactivation sequence terminated properly.
  7. 7. Set DFLTEN to 1.
  8. 8. When the trigger condition is met, the filter starts the acquisition.

The TRGSENS bit allows the selection of the trigger edge (rising or falling). The trigger is ignored if an acquisition is ongoing or if DFLTEN is set to 0.

Figure 386 shows a simplified example where the trigger logic is sensitive to a rising edge trigger (TRGSENS = 0). The first rising edge of the trigger signal is ignored because DFLTEN = 0. Then the next rising edge is taken into account and starts the acquisition. All other rising edges are ignored. The trigger logic is re-initialized when DFLTRUN goes back to 0.

Figure 386. Synchronous continuous mode (ACQMOD[2:0] = 010)

Timing diagram for Synchronous continuous mode (ACQMOD[2:0] = 010). It shows the relationship between DFLTEN, adf_trgi, DFLT0 output, DFLTRUN, DFLTACTIVE, and ADF_CCKx signals. DFLTEN is a high-level enable signal. adf_trgi shows multiple rising edges; the first is ignored, the second starts an acquisition, and subsequent ones are ignored. DFLT0 output shows a sequence of samples: a discard phase (X), followed by S1, S2, ..., SN, and then OFF. DFLTRUN is high during the acquisition period. DFLTACTIVE is high while the filter is active. ADF_CCKx is a continuous clock signal. Annotations include 'Discard (note)' for the initial samples and 'Dropped !' for a missed trigger edge.

Note: the discard phase is optional. MSv63661V1

Timing diagram for Synchronous continuous mode (ACQMOD[2:0] = 010). It shows the relationship between DFLTEN, adf_trgi, DFLT0 output, DFLTRUN, DFLTACTIVE, and ADF_CCKx signals. DFLTEN is a high-level enable signal. adf_trgi shows multiple rising edges; the first is ignored, the second starts an acquisition, and subsequent ones are ignored. DFLT0 output shows a sequence of samples: a discard phase (X), followed by S1, S2, ..., SN, and then OFF. DFLTRUN is high during the acquisition period. DFLTACTIVE is high while the filter is active. ADF_CCKx is a continuous clock signal. Annotations include 'Discard (note)' for the initial samples and 'Dropped !' for a missed trigger edge.

Note: The acquisition can be stopped by setting DFLTEN back to 0. This resets the filter and flushes the RXFIFO, so the samples located into the RXFIFO are lost. The ongoing DMA transfer is properly terminated. DFLTACTIVE goes back to 0 when the filter chain is reset and the RXFIFO flushed.

Synchronous single-shot acquisition mode

This mode allows the application to start a single acquisition by using one of the following trigger sources:

The Synchronous single-shot acquisition mode is selected when ACQMOD[2:0] = 011.

The sequence below shows the most important programming steps (assuming that DFLTEN is set to 0):

  1. 1. Configure and enable the clock generator (CKGEN), so that the frequency of adf_proc_ck clock is compatible with the targeted application (see examples in Table 377).
  2. 2. Enable the CKGEN and, if needed, enable the ADF_CCK0 and ADF_CCK1 clocks.
  3. 3. Program the filter configuration, and set the ACQMOD[2:0] to 011.
  4. 4. Set to 1 the SITFEN bit.
  5. 5. Select the proper trigger source and sensitivity.
  6. 6. Before setting DFLTEN to 1, wait for DFLTACTIVE = 0: it insures that the previous filter deactivation sequence terminated properly.
  7. 7. Set DFLTEN to 1.
  8. 8. When the trigger condition is met, the filter starts the acquisition and provides one data to the RXFIFO, then the filter is ready to accept a new trigger.

TRGSENS allows the selection of the trigger edge (rising or falling). The trigger is ignored if an acquisition is ongoing, or if DFLTEN is set to 0.

Figure 387 shows a simplified example where the trigger logic is sensitive to a rising edge trigger (TRGSENS = 0). Every-time a trigger rising edge is detected with DFLTEN = 1, an acquisition sequence is triggered. The first samples provided by the filter can be discarded if needed. At the end of each conversion, the decimation counters and filter taps are reset. DFLTRUN is set to 0 and the filter is ready to start a new conversion.

Figure 387. Synchronous single-shot mode (ACQMOD[2:0] = 011)

Timing diagram for Synchronous single-shot mode (ACQMOD[2:0] = 011). The diagram shows the relationship between DFLTEN, adf_trgi, DFLT0 output, DFLTRUN, DFLTACTIVE, and ADF_CCKx. DFLTEN is a high-level enable signal. adf_trgi shows rising edge triggers. DFLT0 output shows sample sequences: a discard phase (X...X) followed by a valid sample (S1), and another discard phase (X...X) followed by a valid sample (S2). DFLTRUN is a pulse that starts on a trigger edge and ends after a conversion. DFLTACTIVE is a high-level signal that starts on a trigger edge and ends after a conversion. ADF_CCKx is a continuous clock signal. A note indicates that the discard phase is optional. A label 'Dropped!' points to the S2 sample, indicating it was lost.

Note: the discard phase is optional.

MSv63662V1

Timing diagram for Synchronous single-shot mode (ACQMOD[2:0] = 011). The diagram shows the relationship between DFLTEN, adf_trgi, DFLT0 output, DFLTRUN, DFLTACTIVE, and ADF_CCKx. DFLTEN is a high-level enable signal. adf_trgi shows rising edge triggers. DFLT0 output shows sample sequences: a discard phase (X...X) followed by a valid sample (S1), and another discard phase (X...X) followed by a valid sample (S2). DFLTRUN is a pulse that starts on a trigger edge and ends after a conversion. DFLTACTIVE is a high-level signal that starts on a trigger edge and ends after a conversion. ADF_CCKx is a continuous clock signal. A note indicates that the discard phase is optional. A label 'Dropped!' points to the S2 sample, indicating it was lost.

Note: The acquisition can be stopped by setting DFLTEN back to 0. This resets the filter and flushes the RXFIFO, so the samples located into the RXFIFO are lost. The ongoing DMA transfer is properly terminated. DFLTACTIVE goes back to 0 when the filter chain is reset and the RXFIFO flushed.

Figure 386 shows a case where the DFLTEN is set to 0 while an acquisition is ongoing (the sample S2 is lost). This situation can be avoided with the following steps:

  1. 1. Wait for DFLTRUN = 0.
  2. 2. Read the sample from the RXFIFO.
  3. 3. Clear DFLTEN to 0.

Window continuous acquisition mode

This mode allows the application to start or stop a continuous acquisition controlled by consecutive edges of one of the following trigger sources:

The window continuous acquisition mode is selected when ACQMOD[2:0] = 100.

The sequence below shows the most important programming steps (assuming that DFLTEN is set to 0):

  1. 1. Configure and enable the clock generator (CKGEN), so that the frequency of adf_proc_ck clock is compatible with the targeted application (see examples in Table 377).
  2. 2. Enable the CKGEN and, if needed, enable the ADF_CCK0 and ADF_CCK1 clocks.
  3. 3. Program the filter settings and set the ACQMOD[2:0] to 100.
  4. 4. Set to 1 the SITFEN bit.
  5. 5. Select the proper trigger source and sensitivity.
  6. 6. Before setting DFLTEN to 1, wait for DFLTACTIVE = 0: it insures that the previous filter deactivation sequence terminated properly.
  7. 7. Set DFLTEN to 1.
  8. 8. If TRGSENS = 0, the acquisition starts on trigger rising edge and stops on trigger falling edge. If TRGSENS = 1, the acquisition starts on trigger falling edge and stops on trigger rising edge.

Note: The acquisition may restart if the trigger condition becomes again active.

Figure 388 shows a simplified example of window continuous acquisition mode, with TRGSENS = 1. Once DFLTEN is set to 1, the ADF waits for a falling edge on the selected trigger input. When the trigger condition is met, DFLTRUN goes to 1 and the acquisition starts. The acquisition stops if the ADF detects a rising edge on the selected trigger input. If DFLTEN is still set to 1, the ADF waits again for a falling edge on the selected trigger input.

Figure 388. Window continuous mode (ACQMOD[2:0] = 100)

Timing diagram for Window continuous mode (ACQMOD[2:0] = 100). The diagram shows five signals: DFLTEN, adf_trgi, DFLT0 output, DFLTRUN, and DFLTACTIVE. DFLTEN is a high-level signal that enables the acquisition. adf_trgi is a trigger signal with falling and rising edges. DFLT0 output shows sample data blocks: a discard phase (X...X), followed by samples S1, S2, ..., SN, then another discard phase (X...X), and finally samples S1, S2, ..., Sk. DFLTRUN is a pulse that starts on a falling edge of adf_trgi and ends on a rising edge. DFLTACTIVE is a pulse that starts on a falling edge of adf_trgi and ends on a rising edge. ADF_CCKx is a continuous clock signal. Notes indicate that the discard phase is optional and that samples SN and Sk are dropped when a rising edge occurs during acquisition.

Note: the discard phase is optional.

MSv63663V1

Timing diagram for Window continuous mode (ACQMOD[2:0] = 100). The diagram shows five signals: DFLTEN, adf_trgi, DFLT0 output, DFLTRUN, and DFLTACTIVE. DFLTEN is a high-level signal that enables the acquisition. adf_trgi is a trigger signal with falling and rising edges. DFLT0 output shows sample data blocks: a discard phase (X...X), followed by samples S1, S2, ..., SN, then another discard phase (X...X), and finally samples S1, S2, ..., Sk. DFLTRUN is a pulse that starts on a falling edge of adf_trgi and ends on a rising edge. DFLTACTIVE is a pulse that starts on a falling edge of adf_trgi and ends on a rising edge. ADF_CCKx is a continuous clock signal. Notes indicate that the discard phase is optional and that samples SN and Sk are dropped when a rising edge occurs during acquisition.

Note: The acquisition can be stopped by setting DFLTEN back to 0. This resets the filter and flushes the RXFIFO, so the samples located into the RXFIFO are lost. The ongoing DMA transfer is properly terminated. DFLTACTIVE goes back to 0 when the filter chain is reset and the RXFIFO flushed.

Starting several filters synchronously

If the ADF is used with MDF instances (if present in the product), it is possible to start simultaneously the acquisition of all the filters. This synchronization capability depends on the way the triggers are connected in the product. Generally, an ADF is able to trigger MDF instances, if its adf_trgo signal is connected as trigger input to those blocks (see Section 37.4.2: ADF pins and internal signals to check trigger capabilities).

In the following programming example, one ADF has its adf_trgo signal connected to some MDFs. To start the acquisition of several filters synchronously, the following sequence must be performed (assuming that DFLTEN bits of the filters are set to 0):

On MDFs receiving the adf_trgo trigger:

  1. 1. Enable the CKGEN (CKGDEN = 1) and, if needed, enable the ADF_CCK0 and ADF_CCK1 clocks.
  2. 2. Set to 1 the SITFEN bit of the requested data interfaces.
  3. 3. For each filter, set the acquisition mode to synchronous (ACQMOD[2:0] = 01x).
  4. 4. For each filter, set TRGSRC[3:0] in order to select the adf_trgo trigger input.
  5. 5. For each filter, set TRGSENS to 0 (rising edge).
  6. 6. For each filter, set DFLTEN to 1.

On the ADF generating the adf_trgo trigger:

  1. 1. Enable the CKGEN (CKGDEN = 1) and, if needed, enable the ADF_CCK[1:0] clocks.
  2. 2. Set to 1 the SITFEN bit of the requested data interfaces.
  3. 3. Set the acquisition mode to synchronous (ACQMOD[2:0] = 01x).
  4. 4. Set TRGSRC[3:0] to 0 (TRGO selected).
  5. 5. Set TRGSENS to 0 (rising edge).
  6. 6. Set DFLTEN to 1.
  7. 7. Read TRGO bit until it is read to 0.
  8. 8. Set TRGO to 1. Then the acquisition sequence for all selected filters starts immediately.

To trigger a new acquisition (in case of single-shot) the application must do the following:

  1. 1. Check that the previous acquisition is completed, by waiting DFLTRUN = 0.
  2. 2. Read TRGO until it is read to 0.
  3. 3. Set again the bit TRGO to 1.

Discarded samples

The ADF offers the possibility to program the amount of samples to be discarded after each restart:

The discard function is controlled via NBDIS[7:0] as follows:

Refer to Figure 383 to Figure 387, and Figure 389.

In the example shown in Figure 389, the discard function is used to drop the first five samples provided by the digital filter (S1 to S5). The first sample transfered to the RXFIFO is S6.

Figure 389. Discard function example

Figure 389: Discard function example. Graph of Output filter amplitude over time showing dropped samples S1 through S5, and samples S6 to S9 provided to RXFIFO with T_PCM interval indicated. MSv63621V1.
Figure 389: Discard function example. Graph of Output filter amplitude over time showing dropped samples S1 through S5, and samples S6 to S9 provided to RXFIFO with T_PCM interval indicated. MSv63621V1.

37.4.9 Start-up sequence examples

Figure 390 details a start of acquisition sequence of a digital filter triggered by DFLTEN (ACQMOD[2:0] = 0), with NBDIS[7:0] = 3 (three samples to discard before acquisition).

The DFLT0 is configured for audio application: MCIC, RSFLT and HPF activated.The data interface (SITF0 or ADCITF) is assumed to be already activated.

Note: NBDIS[7:0] is set on purpose to a small value to simplify the drawing.

Figure 390. Start sequence with DFLTEN, in continuous mode, audio configuration

Figure 390: Start sequence with DFLTEN, in continuous mode, audio configuration. Timing diagram showing ADCITF/SITF status, ACQMOD, DFLTEN re-sync with adf_proc_ck, bs0_[r|f]_ck, MCIC dec. counter, MCIC_OUT, RSFLT dec. counter, RSFLT_OUT, HPF_OUT, NBDIS_CNTR, and Sample stored in RXFIFO. MSv63664V1.
Figure 390: Start sequence with DFLTEN, in continuous mode, audio configuration. Timing diagram showing ADCITF/SITF status, ACQMOD, DFLTEN re-sync with adf_proc_ck, bs0_[r|f]_ck, MCIC dec. counter, MCIC_OUT, RSFLT dec. counter, RSFLT_OUT, HPF_OUT, NBDIS_CNTR, and Sample stored in RXFIFO. MSv63664V1.

The DFLTEN bit is re-sampled into the ADF processing clock domain. When DFLTEN is detected high, the filter chain is enabled, and the decimation counter of the MCIC filter is incremented at the rate of the bitstream clock.

When the MCIC decimation counter reached its programmed value N, a sample is available for the RSFLT.

The RSFLT processes all the samples provided by the MCIC, and delivers a sample to the HPF every-time it processes four samples (decimation by 4). The RSFLT needs up to 24 cycles of adf_proc_ck clock before delivering a sample (P1).

The HPF processes all the samples provided by the RSFLT, but the NBDIS function prevents the data writing in the RXFIFO as long as NBDIS_CNTR does not reach 0.

When NBDIS_CNTR reaches 0, the samples provided by the HPF are stored into the RXFIFO.

37.4.10 Sound activity detection (SAD)

The SAD is based on the computation of the ambient noise level (ANLVL) and of the short-term sound level (SDLVL). The SAD offers the following ways to detect a sound:

As shown in Figure 391, the SAD takes the 16 MSB samples from the DFLT0 output.

Figure 391. SAD block diagram

Figure 391. SAD block diagram. The diagram shows the internal structure of the Sound Activity Detection (SAD) block. It receives PCM[23:0] data from DFLT0 and outputs sddet_evt and sdlvl_evt signals. The block includes a Logic unit, an SDLVL computation unit (containing a Sound level (SDLVL) computation block and a Learning phase ANLVL computation block), and an ANLVL update Thresholds update block. The Logic unit controls the flow of data between these components based on configuration registers ADF_SADCR.SADEN, ADF_SADCR.DATCAP[1:0], and ADF_SADCR.SADST[1:0]. The output of the Logic unit is connected to the RXFIFO0.

The diagram illustrates the SAD block structure. It takes PCM[23:0] input from DFLT0. The input is split into PCM[23:8] and PCM[23:0]. The PCM[23:8] path goes through an absolute value function \(|x_n|\) and then to the 'Sound level (SDLVL) computation' block. This block is part of the 'SDLVL computation' section. The output of this block goes to a multiplexer. The other input to the multiplexer is from the 'Learning phase ANLVL computation' block, which is part of the 'Detection' section. The multiplexer output goes to the 'ANLVL update Thresholds update' block. The output of this block goes to the 'SAD trigger logic' block, which produces the 'sddet_evt' output. The 'sdlvl_evt' output is taken directly from the multiplexer output. The 'Logic' block controls the flow between these components based on configuration registers: ADF_SADCR.SADEN, ADF_SADCR.DATCAP[1:0], and ADF_SADCR.SADST[1:0]. The output of the Logic block is connected to the RXFIFO0. The diagram is labeled MSv63623V1.

Figure 391. SAD block diagram. The diagram shows the internal structure of the Sound Activity Detection (SAD) block. It receives PCM[23:0] data from DFLT0 and outputs sddet_evt and sdlvl_evt signals. The block includes a Logic unit, an SDLVL computation unit (containing a Sound level (SDLVL) computation block and a Learning phase ANLVL computation block), and an ANLVL update Thresholds update block. The Logic unit controls the flow of data between these components based on configuration registers ADF_SADCR.SADEN, ADF_SADCR.DATCAP[1:0], and ADF_SADCR.SADST[1:0]. The output of the Logic unit is connected to the RXFIFO0.

The SAD is highly configurable, and the application can adjust several parameters:

SAD detection behavior

The SAD can use the following ways to detect a sound, selected by SADMOD[1:0]:

SAD states

As shown in Figure 391, the SAD works as follows:

  1. 1. When enabled (SADEN = 1), the SAD is first in LEARN state to perform a first estimation of the ambient noise level.
  2. 2. The SAD continuously computes the short-term sound level (SDLVL) using the samples provided by the DFLT0. The amount of samples used to compute the sound level is given by FRSIZE[2:0]. The samples processed by the DFLT0 can be transferred into the memory or not depending on DATCAP[1:0] value.
  3. 3. The initial ambient noise level (ANLVL) is computed using the consecutive sound level values. The application can define how much sound level values are used to perform the computation of this initial ambient noise estimation (LFRNB).
  4. 4. When the initial ambient noise level (ANLVL) is computed, the SAD switches to the MONITOR state.
  5. 5. Every time a new short-term sound level value is available, the SAD updates the ambient noise level and the thresholds according to the selected detection mode.
  6. 6. If the SAD triggers, then the following happens:
    • – The SAD switches to DETECT state.
    • – The sddet_evt event is asserted.
    • – The adf_sad_det signal is set to high.
  7. 7. The hangover function insures that the DETECT state is maintained even if the sound level goes below the threshold level for a time given by HGOVR.

Figure 392. SAD flow diagram

Flowchart of the SAD (Sound Activity Detection) process. It starts with 'SAD enable' leading to 'SADST= LEARN'. Then 'Compute sound level (SDLVL) (using FRSIZE samples)'. A decision 'SADST = LEARN ?' branches to 'Compute initial ambient noise level (ANLVL) (using LFRNB, SDLVL)' if Y, or to the three SADMOD branches if N. The SADMOD branches are: 'When SADMOD = 1x' (Update ANLVL, Update THRH/THRL, SELSIG = ANLVL), 'When SADMOD = 01' (Update THRH/THRL, SELSIG = SDLVL), and 'When SADMOD = 0' (Update ANLVL, Update THRH/THRL, SELSIG = SDLVL). All lead to 'SADST = MONITOR?'. If Y, 'THR = THRH'; if N, 'THR = THRL'. Then 'SELSIG > THR ?'. If Y, 'SADST = DETECT', 'HGCNT = HOVR', and 'ANLVL update if SADMOD = 1x'. If N, 'HGCNT = 0 ?'. If Y, 'SADST = MONITOR'; if N, 'HGCNT = HGCNT - 1'. Both lead to 'ANLVL update'. A feedback loop returns to 'Compute sound level'.
graph TD
    Start([SAD enable]) --> Learn[SADST= LEARN]
    Learn --> ComputeSound[Compute sound level (SDLVL)
(using FRSIZE samples)] ComputeSound --> LearnCheck{SADST = LEARN ?} LearnCheck -- N --> SADMOD1x[When SADMOD = 1x] LearnCheck -- N --> SADMOD01[When SADMOD = 01] LearnCheck -- N --> SADMOD0[When SADMOD = 0] LearnCheck -- Y --> ComputeANLVL[Compute initial ambient noise level (ANLVL)
(using LFRNB, SDLVL)] ComputeANLVL --> ANLVLCheck{ANLVL available ?} ANLVLCheck -- Y --> MonitorSet[SADST= MONITOR] ANLVLCheck -- N --> MonitorSet SADMOD1x --> UpdateANLVL1x[Update ANLVL
(Using SDLVL, ANSLP)] UpdateANLVL1x --> UpdateTHRHL1x[Update THRH, THRL values
(Using ANMIN, HYSTEN, SNTHR)] UpdateTHRHL1x --> SELSIG1x[SELSIG = ANLVL] SADMOD01 --> UpdateTHRHL01[Update THRH, THRL values
(Using ANMIN, HYSTEN, SNTHR)] UpdateTHRHL01 --> SELSIG01[SELSIG = SDLVL] SADMOD0 --> UpdateANLVL0[Update ANLVL
(Using SDLVL, ANSLP, ANMIN)] UpdateANLVL0 --> UpdateTHRHL0[Update THRH, THRL values
(Using ANLVL, HYSTEN, SNTHR)] UpdateTHRHL0 --> SELSIG0[SELSIG = SDLVL] SELSIG1x --> MonitorCheck{SADST = MONITOR?} SELSIG01 --> MonitorCheck SELSIG0 --> MonitorCheck MonitorCheck -- Y --> THRHRH[THR = THRH] MonitorCheck -- N --> THRHL[THR = THRL] THRHRH --> SELSIGTHR{SELSIG > THR ?} THRHL --> SELSIGTHR SELSIGTHR -- Y --> Detect[SADST = DETECT] Detect --> HGCNTHOVR[HGCNT = HOVR] HGCNTHOVR --> ANLVLUpdate1x[ANLVL update
if SADMOD = 1x] SELSIGTHR -- N --> HGCNT0{HGCNT = 0 ?} HGCNT0 -- Y --> MonitorSet2[SADST= MONITOR] HGCNT0 -- N --> HGCNTDec[HGCNT = HGCNT - 1] HGCNTDec --> ANLVLUpdate[ANLVL update] ANLVLUpdate1x --> Feedback(( )) ANLVLUpdate --> Feedback MonitorSet --> Feedback MonitorSet2 --> Feedback Feedback --> ComputeSound

MSv62687V1

Flowchart of the SAD (Sound Activity Detection) process. It starts with 'SAD enable' leading to 'SADST= LEARN'. Then 'Compute sound level (SDLVL) (using FRSIZE samples)'. A decision 'SADST = LEARN ?' branches to 'Compute initial ambient noise level (ANLVL) (using LFRNB, SDLVL)' if Y, or to the three SADMOD branches if N. The SADMOD branches are: 'When SADMOD = 1x' (Update ANLVL, Update THRH/THRL, SELSIG = ANLVL), 'When SADMOD = 01' (Update THRH/THRL, SELSIG = SDLVL), and 'When SADMOD = 0' (Update ANLVL, Update THRH/THRL, SELSIG = SDLVL). All lead to 'SADST = MONITOR?'. If Y, 'THR = THRH'; if N, 'THR = THRL'. Then 'SELSIG > THR ?'. If Y, 'SADST = DETECT', 'HGCNT = HOVR', and 'ANLVL update if SADMOD = 1x'. If N, 'HGCNT = 0 ?'. If Y, 'SADST = MONITOR'; if N, 'HGCNT = HGCNT - 1'. Both lead to 'ANLVL update'. A feedback loop returns to 'Compute sound level'.

Sound level computation (SDLVL)

Once enabled, the SAD computes continuously the sound level value. The sound level represents the average of the absolute value of an amount of PCM samples given by FRSIZE[2:0].

\[SDLVL = \frac{1}{N_{FRSIZE}} \times \sum_{n=1}^{N_{FRSIZE}} |PCM(n)|\]

where \(N_{FRSIZE}\) is the amount of PCM samples given by FRSIZE[2:0].

Ambient noise estimation (ANLVL)

The ambient noise level (ANLVL) is computed when SADMOD[1:0] is 00 or 10.

The ambient noise level is computed differently according to the state of the SAD as detailed below:

Every time the SAD is enabled, a learning phase is initiated in order to estimate a first value of the ambient noise level. During this phase, the SAD cannot trigger.

During the LEARN phase, the ambient noise level is computed as follows:

\[ANLVL = \frac{1}{N_{LFRNB}} \times \sum_{n=1}^{N_{LFRNB}} |SDLVL(n)|\]

where \(N_{LFRNB}\) is the amount of frames given by LFRNB[2:0] bitfield.

When the learning phase is completed, the SAD updates the ambient noise level in the following way:

\[ANLVL\_UP = ANLVL * (1+2^{(ANSLP-12)})\]

\[ANLVL\_DN = ANLVL * (1-2^{(ANSLP-10)})\]

The ANLVL is not updated if the current sound level is higher than the threshold level, except if SADMOD[1:0] = 10.

The slope of the noise estimator can be adjusted to optimize the detection of the wanted signal. This slope is adjusted via ANSLP[2:0] in the ADF SAD configuration register (ADF_SADCFGR).

Table 374 shows the allowed values according to the frame size and the sampling rate of the data observed by the SAD. The recommended values when the SADMOD[1:0] = 0 are the ones into the gray shaded cells.

Table 374. ANSLP values versus FRSIZE and sampling rates

FRSIZEANSLP values for Fs = 8 kHzANSLP values for Fs = 16 kHz
Slow(1)typical(2)Fast(3)Slow(1)typical(2)Fast(3)
0 (8 samples)012-01
1 (16 samples)123012
2 (32 samples)234123
3 (64 samples)345234
4 (128 samples)456345
5 (256 samples)567456
6 (512 samples)67-567
  1. 1. The slow slope is equal to - 8.5 dB/s for the negative slope and + 2.1 dB/s for the positive slope.
  2. 2. The typical slope is equal to - 17.1 dB/s for the negative slope and + 4.2 dB/s for the positive slope.
  3. 3. The fast slope is equal to - 34.2 dB/s for the negative slope and + 8.5 dB/s for the positive slope.

The slopes can also be computed using the following formulas:

\[SLC_{UP} = 20 \times \frac{F_s}{F_{SIZE}} \times \log_{10}(1 + 2^{(ANSLP - 12)})\]

\[SLC_{DN} = 20 \times \frac{F_s}{F_{SIZE}} \times \log_{10}(1 - 2^{(ANSLP - 10)})\]

where FS is the sampling rate of the stream observed by the SAD and FSIZE is the frame size defined by FRSIZE[2:0].

Threshold computation

The way the threshold value is computed depends on SADMOD[1:0]:

\[THR_H = ANLVL \times 10^{\frac{GdB_{SNTHR}}{20}}\]

This threshold value is then compared to the current sound level (SDLVL).

\[THR_H = ANMIN \times 10^{\frac{GdB_{SNTHR}}{20}}\]

This threshold value is then compared to the current sound level (SDLVL).

\[THR_H = ANMIN \times 4\]

This threshold value is then compared to:

\[ANLVL \times 10^{\frac{GdB_{SNTHR}}{20}}\]

The hysteresis mode can be enabled to reduce the spurious transitions between MONITOR and DETECT states. In hysteresis mode (HYSTEN = 1), the following threshold values are used:

Table 375 shows the thresholds values according to SNTHR.

Table 375. Threshold values according SNTHR(1)

SNTHR[3:0]THRHTHRLComments
0LVL + 3.5 dBLVL x 1.5LVL + 3.5 dBLVL x 1.5No hysteresis
1LVL + 6.0 dBLVL x 2LVL + 3.5 dBLVL x 1.5Hysteresis of 2.5 dB
2LVL + 9.5 dBLVL x 3LVL + 6.0 dBLVL x 2Hysteresis of 3.5 dB
3LVL + 12.0 dBLVL x 4LVL + 9.5 dBLVL x 3Hysteresis of 2.5 dB
4LVL + 15.6 dBLVL x 6LVL + 12.0 dBLVL x 4Hysteresis of 3.5 dB
5LVL + 18.1 dBLVL x 8LVL + 15.6 dBLVL x 6Hysteresis of 2.5 dB
6LVL + 21.6 dBLVL x 12LVL + 18.1 dBLVL x 8Hysteresis of 3.5 dB
7LVL + 24.1 dBLVL x 16LVL + 21.6 dBLVL x 12Hysteresis of 2.5 dB
8LVL + 27.6 dBLVL x 24LVL + 24.1dBLVL x 16Hysteresis of 3.5 dB
9LVL + 30.1 dBLVL x 32LVL + 27.6dBLVL x 24Hysteresis of 2.5 dB

1. LVL must be replaced by ANLVL when SADMOD[1:0] = 0 and by ANMIN for other SADMOD[1:0] values.

When the hysteresis function is disabled, the SAD always use THRH.

Note: The hysteresis mode must not be used when SADMOD[1:0] = 1x.

Trigger logic

The signal compared to this threshold depends also on SADMOD[1:0].

The trigger condition is reached when the selected signal (SELSIG) is bigger than the threshold level.

If the trigger condition is met, the following happens:

The SAD remains in DETECT state as long as the trigger condition is met or the hangover down-counter is different from 0.

The sddet_evt event indicates when the SAD enters and/or exits the DETECT state. This event is used to generate an interrupt when a sound is detected or when a sound is no longer detected:

The adf_sad_det signal remains high as long as the SAD is in DETECT state.

The SAD also provides a flag indicating that a new sound level value is available (SDLVLF). The last computed sound level (SDLVL[14:0]) is available in the ADF SAD sound level register (ADF_SADSDLVR), and the last computed ambient noise level (ANLVL[14:0]), in the ADF SAD ambient noise level register (ADF_SADANLVR).

Note: The SAD can work even when the AHB clock is not present. In that case, the SAD does not update SDLVL[14:0] and ANLVL[14:0].

To get the latest valid SDLVL[14:0] and ANLVL[14:0] values, the application must read the ADF_SADSDLVR, and ADF_SADANLVR registers, when the SDLVLF flag goes high. This can be done in the following ways:

Sample transfer to memory

The SAD offers the following options to control the samples transfer from DFLT0 to the system memory:

Note: DATCAP[1:0] is taken into account only when the SADEN = 1. For example, if the SAD configuration is DATCAP[1:0] = 0, SADEN = DFLTEN = 1, and if the application sets now SADEN to 0, the samples provided by the DFLT0 are transferred to the RXFIFO.

Programming recommendations

To make the SAD function working properly, the ADF must be programmed as follows:

  1. 1. Provide the proper kernel clock (adf_ker_ck) to the ADF.
  2. 2. Configure the CKGEN and enable it.
  3. 3. Configure the SITF and enable it (note that microphones have a settling time of several milliseconds).
  4. 4. Configure the DFLT0. A typical setting is the following:
    • – CIC5 with a decimation ratio of 12, 16 or 24
    • – RSFLT with a decimation ratio of 4
    • – HPF with HPFC = 2 or 3

    For a very-low power implementation, the RSFLT can be bypassed.

  5. 5. Set SADEN to 0.
  6. 6. Wait for SADACTIVE = 0. If SADEN was previously enabled, this phase can take two periods of adf_hclk, and two periods of adf_proc_ck.
  7. 7. Configure the SAD as follows:
    • – Set DATCAP[1:0] to 0, if the application does not want to store the samples into the system memory.
    • – Set DATCAP[1:0] to 01, if the application wants to store the samples into the system memory only when the SAD detects a sound.
    • – Set DATCAP[1:0] to 11, if the application wants to store the samples into the system memory continuously.
  8. 8. Configure the DMA (optional).
  9. 9. Enable the SAD.
  10. 10. Enable the DFLT0.

Figure 392 shows a simplified timing diagram when the SAD works with DATCAP[1:0] = 01.

Thanks to the kernel clock (adf_ker_ck), the SAD continuously monitors the audio signal provided by the DFLT0. The threshold is also continuously updated according to the ambient noise level estimation.

Figure 393. SAD timing diagram example

Figure 393: SAD timing diagram example. This diagram illustrates the timing of various signals during the SAD (Signal Activity Detection) process. It includes a graph of the signal provided by DFLT0 and a threshold line. Below the graph, several digital signals are shown: SADST (with LERN, MONITOR, DETECT, and MONITOR phases), adf_sad_det (a detection signal), adf_bus_ckreq (a bus clock request), adf_hclk (a high-speed clock), adf_fifo_it (a FIFO interrupt), and Sample transfer to memory. The diagram also shows the adf_ker_ck (kernel clock) and the SDDETF flag cleared! event. The diagram is labeled MSv63624V2.

The diagram shows the timing of various signals during the SAD process. The top part shows the signal provided by DFLT0 and a threshold line. The SADST signal indicates the LERN, MONITOR, DETECT, and MONITOR phases. The adf_sad_det signal indicates the detection of a signal. The adf_bus_ckreq signal indicates the request for a bus clock. The adf_hclk signal indicates the high-speed clock. The adf_fifo_it signal indicates the FIFO interrupt. The Sample transfer to memory signal indicates the transfer of samples to memory. The adf_ker_ck signal indicates the kernel clock. The SDDETF flag cleared! event is shown. The diagram is labeled MSv63624V2.

Figure 393: SAD timing diagram example. This diagram illustrates the timing of various signals during the SAD (Signal Activity Detection) process. It includes a graph of the signal provided by DFLT0 and a threshold line. Below the graph, several digital signals are shown: SADST (with LERN, MONITOR, DETECT, and MONITOR phases), adf_sad_det (a detection signal), adf_bus_ckreq (a bus clock request), adf_hclk (a high-speed clock), adf_fifo_it (a FIFO interrupt), and Sample transfer to memory. The diagram also shows the adf_ker_ck (kernel clock) and the SDDETF flag cleared! event. The diagram is labeled MSv63624V2.

37.4.11 Data transfer to memory

Data format

The samples processed by DFLT0 are stored into a RXFIFO. The application can read the samples stored into these FIFOs via the ADF digital filter data register 0 (ADF_DFLT0DR). The samples inside this register are signed and left aligned. The bit 31 always represents the sign.

The ADF provides 24-bit left-aligned data. Performing a 16-bit access to ADF_DFLT0DR allows the application to get the 16 most significant bits. Performing a 32-bit access to ADF_DFLT0DR allows the application to get a 24-bit data size.

Figure 394. ADF_DFLT0DR data format

Figure 394: ADF_DFLT0DR data format. This diagram shows the data format of the ADF_DFLT0DR register. It includes a graph of the RXFIFO width and the FIFO_DEPTH. Below the graph, the ADF_DFLT0DR register is shown with its 32-bit width. The register is divided into three parts: PCM[23:0] (bits 31 to 7), zero's (bits 6 to 0), and a sign bit (bit 31). The diagram is labeled MSv63665V1.

The diagram shows the data format of the ADF_DFLT0DR register. The top part shows the RXFIFO width and the FIFO_DEPTH. Below the graph, the ADF_DFLT0DR register is shown with its 32-bit width. The register is divided into three parts: PCM[23:0] (bits 31 to 7), zero's (bits 6 to 0), and a sign bit (bit 31). The diagram is labeled MSv63665V1.

Figure 394: ADF_DFLT0DR data format. This diagram shows the data format of the ADF_DFLT0DR register. It includes a graph of the RXFIFO width and the FIFO_DEPTH. Below the graph, the ADF_DFLT0DR register is shown with its 32-bit width. The register is divided into three parts: PCM[23:0] (bits 31 to 7), zero's (bits 6 to 0), and a sign bit (bit 31). The diagram is labeled MSv63665V1.

Data resynchronization

The samples stored into the RXFIFO can be transferred into the memory by using either DMA requests or interrupt signaling.

Note: The RXFIFO is located into the adf_ker_ck clock domain, while ADF_DFLT0DR is located into the adf_hclk (AHB) clock domain.

When the AHB clock is available, if ADF_DFLT0DR is empty and if a sample is available into the RXFIFO, this sample is transferred into ADF_DFLT0DR.

The sample transfer from the RXFIFO to ADF_DFLT0DR takes two periods of the AHB clock (adf_hclk) and two periods of the adf_ker_ck clock. The ADF inserts automatically wait-states if the application performs a read operation of ADF_DFLT0DR while the transfer of the new sample from the RXFIFO to ADF_DFLT0DR is not yet completed.

Figure 395. Data resynchronization

Block diagram of data resynchronization between AHB and adf_ker_ck clock domains.

The diagram illustrates the data resynchronization process between two clock domains. On the left, a shaded gray area represents the AHB clock domain, containing the ADF_DFLT0DR register. On the right, a shaded light gray area represents the adf_ker_ck clock domain, containing the RXFIFO and the Digital filter processing (DFLT0) block. A vertical 'sync' block is positioned between the two domains. Data flow is indicated by arrows: from Digital filter processing (DFLT0) to RXFIFO, from RXFIFO to sync, and from sync to ADF_DFLT0DR. A legend at the bottom identifies the gray shading for the AHB clock domain and the light gray shading for the adf_ker_ck clock domain. The reference code MSv63666V1 is located in the bottom right corner.

Block diagram of data resynchronization between AHB and adf_ker_ck clock domains.

Data transfer

The content of the RXFIFO can be transferred to the memory either by using a DMA channel or interrupt services.

Both single and burst, DMA transfers are supported by the ADF, but the application has to care about the following points:

Note: The burst mode is not available in all products (see the DMA section to check if the product supports it).

In addition, the application can select the RXFIFO threshold (FTH bit) in order to trigger the data transfer: a data transfer can be triggered as soon as the RXFIFO is not empty, or when the RXFIFO is half-full (containing depth/2 samples).

For the DMA transfer, as soon as one of the RXFIFO reaches the threshold level, the DMA request is asserted in order to ask for data transfer. Successive DMA requests are performed as long as the RXFIFO is not empty.

The DMA mode of the RXFIFO is enabled via the DMAEN bit in ADF_DFLT0DR.

For the interrupt signaling, the following cases must be considered:

met again. In this mode, every time an interrupt occurs, the application is supposed to read FIFO_SIZE/2 data.

RXFIFO overrun

A RXFIFO overrun condition is detected when the RXFIFO is full, and a new sample from the DFLT0 must be written.

In this case, DOVRF is set and the new sample is dropped. When the RXFIFO has at least one location available, the new incoming sample is written into the RXFIFO.

Figure 396 shows an example based on a RXFIFO depth of four words and FTH set to 1, so that FTHF goes to 1 when the RXFIFO is half-full.

The S7 sample is lost due to an overrun: the RXFIFO is full while S7 must be written into the RXFIFO. The S7 write operation is not performed. DOVRF is set to 1 at the moment where the write operation was expected. The overflow event remains to 1 as long as it is not cleared by the application.

In this example, DOVRIE is set to 1 to have an interrupt if an overrun condition is detected.

After the S7 sample, the application manages to read data from the RXFIFO, and the ADF can write the S8 sample and consecutive. Later, the application clears DOVR, allowing the detection of a new overrun situation.

In the adf_hclk line, the gray boxes indicate that the ADF requested the AHB clock.

Figure 396 shows the AHB clock available only when the ADF requests it. In real applications, the AHB clock may also be present if the ADF does not request it.

Figure 396. Example of overflow and transfer to memory

Timing diagram showing RXFIFO overrun and data transfer to memory. It includes signals: adf_ker_ck, Data from DFLT0 (samples S1-S12), Data write into RXFIFO, RXFIFO Level, RXFIFO Full, FTHF, RXNEF, adf_hclk, read access to RXFIFO, and DOVRF. The diagram illustrates an overrun at sample S7 where the FIFO is full (level 4). DOVRF is set to 1 at this point. The AHB clock (adf_hclk) is active during read and write operations. Read accesses occur for S1-S2 and S3-S10. Write operations are shown for S1-S6 and S8-S12, with S7 being skipped.

The diagram illustrates the RXFIFO overrun and data transfer to memory. It shows the following signals and events:

Annotations include "Writing DOVRF to 1" and the reference "MSv63667V1".

Timing diagram showing RXFIFO overrun and data transfer to memory. It includes signals: adf_ker_ck, Data from DFLT0 (samples S1-S12), Data write into RXFIFO, RXFIFO Level, RXFIFO Full, FTHF, RXNEF, adf_hclk, read access to RXFIFO, and DOVRF. The diagram illustrates an overrun at sample S7 where the FIFO is full (level 4). DOVRF is set to 1 at this point. The AHB clock (adf_hclk) is active during read and write operations. Read accesses occur for S1-S2 and S3-S10. Write operations are shown for S1-S6 and S8-S12, with S7 being skipped.

37.4.12 Register protection

The ADF embeds some hardware protection to prevent invalid situations.

Table 376 shows the list of write-protected and unprotected fields.

Table 376. Register protection summary

RegistersUnprotected fieldsWrite-protected fieldsWrite-protection condition
ADF global control register (ADF_GCR)TRGO-DFLTACTIVE0 = 1
ADF clock generator control register (ADF_CKGR)CKGDEN
CCK0EN
CCK1EN
PROC DIV[6:0], CCKDIV[3:0],
CKGMOD, TRGSRC[3:0],
TRGSENS, CCK[1:0]DIR
CKGACTIVE = 1
ADF serial interface control register 0 (ADF_SITF0CR)SITFENSTH[4:0], SITFMOD[1:0],
SCKSRC[1:0]
SITFACTIVEx = 1
ADF bitstream matrix control register 0 (ADF_BSMX0CR)-BSSEL[4:0]DFLTACTIVEx = 1
ADF digital filter control register 0 (ADF_DFLT0CR)DFLTENNBDIS[7:0], TRGSRC[3:0],
TRGSENS, FTH, DMAEN,
SNPSFMT, ACQMOD[2:0]
DFLTACTIVEx = 1
ADF digital filter configuration register 0 (ADF_DFLT0CICR)SCALE[5:0]MCICD[8:0], CICMOD[2:0],
DATSRC[1:0]
ADF reshape filter configuration register 0 (ADF_DFLT0RSFR)-All fields
ADF delay control register 0 (ADF_DLY0CR)-SKPDLY[6:0]SKPBF = 1
ADF DFLT0 interrupt enable register (ADF_DFLT0IER)All fields--
ADF DFLT0 interrupt status register 0 (ADF_DFLT0ISR)All fields--
ADF SAD control register (ADF_SADCR)SADENFRSIZE[2:0], DETCFG,
SADMOD[1:0], HYSTEN,
DATCAP[1:0]
SADACTIVE = 1
ADF SAD configuration register (ADF_SADCFGR)-ANMIN[12:0], SNTHR[3:0],
HGOVR[3:0], LFRNB[2:0],
ANSLP[2:0]
SADACTIVE = 1

All the ADF processing is performed in the adf_proc_ck clock domain. For that reason, enabling or disabling an ADF sub-block may take some time due to the resynchronization between the AHB clock domain and the adf_proc_ck clock domain. XXXACTIVE flags are available to allow the application to check that the synchronization between the two clock domains is completed.

To change a write-protected bitfield, the application must follow this sequence:

  1. 1. Set the enable bit of the sub-block to 0.
  2. 2. Wait for corresponding flag XXXACTIVE = 0.
  3. 3. Modify the wanted fields.
  4. 4. Set the enable bit of the sub-block to 1.

Refer to the description of each sub-block for details.

37.5 ADF low-power modes

Table 377. Effect of low-power modes on ADF

ModeDescription
SleepNo effect. ADF interrupts cause the device to exit the Sleep mode.
Stop(1)The ADF registers content is kept.
Thanks to the kernel clock request feature, if the ADF is clocked by an internal oscillator available in Stop mode, the ADF remains active. The interrupts cause the device to exit Stop mode.
StandbyThe ADF is powered down and must be reinitialized after exiting Standby mode.

1. Refer to Section 37.3: ADF implementation for details about Stop modes supported by the ADF.

37.6 ADF interrupts

To increase the CPU performance, the ADF offers an interrupt line (adf_flt0_it), sensitive to several events.

Note: The status flags are available even if the corresponding interrupt enable flag is not enabled.

The interrupt interface is controlled via the ADF DFLT0 interrupt enable register (ADF_DFLT0IER) and the ADF DFLT0 interrupt status register 0 (ADF_DFLT0ISR).

Figure 397. ADF interrupt interface

Block diagram of the ADF interrupt interface showing various interrupt event signals (fth_evt0, dovr_evt0, rfovr_evt0, sat_evt0, ckab_evt0, sddet_evt, sdlvl_evt) routed through edge detectors with clear inputs, mapped to status and enable registers ADF_DFLT0ISR and ADF_DFLT0IER with corresponding flags/enable pairs (FTHF/FTHIE, DOVRF/DOVRIE, RFOVRF/RFOVRIE, SATF/SATIE, CKABF/CKABIE, SDDETF/SDDETIE, SDLVLF/SDLVLIE) feeding into an OR gate generating adf_flt0_it signal.

(1) Only present if the SAD is implemented, refer to section ADF implementation for details.

MSv63668V2

Block diagram of the ADF interrupt interface showing various interrupt event signals (fth_evt0, dovr_evt0, rfovr_evt0, sat_evt0, ckab_evt0, sddet_evt, sdlvl_evt) routed through edge detectors with clear inputs, mapped to status and enable registers ADF_DFLT0ISR and ADF_DFLT0IER with corresponding flags/enable pairs (FTHF/FTHIE, DOVRF/DOVRIE, RFOVRF/RFOVRIE, SATF/SATIE, CKABF/CKABIE, SDDETF/SDDETIE, SDLVLF/SDLVLIE) feeding into an OR gate generating adf_flt0_it signal.

Table 378 shows which interrupt line is affected by which event, and how to clear and activate each interrupt/event.

Table 378. ADF interrupt requests

Interrupt vectorInterrupt eventEvent flagEvent/interrupt clearing methodExit Sleep modeExit Stop modes(1)Exit Standby mode
ADF_FLT0(2)RXFIFO threshold reachedFTHFRead ADF_DFLT0DR until RXFIFO level is lower than the threshold.YesYesNo
RXFIFO overrunDOVRFWrite DOVRF to 1.
RSFLT overrunRFOVRFWrite RFOVRF to 1.
Saturation detectionSATFWrite SATF to 1.
Channel clock absence detectionCKABFWrite CKABF to 1.
SAD: sound detectedSDDETFWrite SDDETF to 1.
SAD: sound level value availableSDLVLFWrite SDLVLF to 1.
ST logo
ST logo

37.7 ADF application information

37.7.1 ADF configuration examples for audio capture

Table 379 gives some examples of the ADF settings for the digital microphones, focusing on 16 and 48 kHz output data rate.

Configurations #1 and #2 are for very low-power use-cases and have a reduced signal-to-noise ratio. The user must also insure that the selected digital microphone can work properly at 512 kHz. These configurations can be used for sound detection. The RSFLT is not used to reduce as much as possible the frequency of the kernel clock (adf_ker_ck).

Configurations #3, #4, #9, #10, #11 give signal-to-noise ratios around 115 dB, with an ideal microphone model, with a sinus signal of 997 Hz. Using the RSFLT allows a good control on the in-band ripple, and a good image rejection.

Configurations #7, #8, #10 give signal-to-noise ratio around 120 dB, with an ideal microphone model, using a sinus signal of 997 Hz.

Table 379. Examples of ADF settings for microphone capture

Configurationadf_ker_ck (MHz)PROCIV + 1CCKDIV + 1CIC order (1)MCICD + 1SCALERSFLTBYPRSFLTDHPFBYP-adf_proc_ck (MHz)Total dec. ratioFRS (kHz)FADF_CCKx (MHz)FPCM (kHz)
#11.024124640x2D (- 8.5 dB)1xx=>1.02464-0.5128
#2125320x2B (- 14.5 dB)32-16
#3125160x01 (+ 3.5 dB)64328
#42.048125160x01 (+ 3.5 dB)002.04864641.02416
#53.07216580x0B (+ 33.6 dB)003.07232320.5128
#6225120x06 (+ 18.1 dB)48640.76816
#7125240x2C (- 12 dB)961.536
#84.096125320x27 (- 26.6 dB)004.096128642.04816
#96.144325160x02 (+ 6.0 dB)002.04864641.02416
#10225240x2C (- 12 dB)3.072961.536
#11125160x01 (+ 3.5 dB)6.144641923.07248
#127.680125200x2E (- 6.0 dB)007.680801923.84048

1. CICMOD = 100 for CIC order equal to 4. CICMOD = 101 for CIC order equal to 5.

37.7.2 Programming examples

Example 1

This example describes the programming of ADF for the capture of a signal coming from a digital microphone, using only the CIC4, with a decimation of 48, assuming that the kernel clock is 1.536 MHz. Typically, this configuration can be used to detect sound using the SAD.

Table 380. Programming sequence (CIC4)

OperationsComments
Adjust the proper kernel clock frequency via the RCCAssuming that the RCC is programmed to provide a kernel clock (adf_ker_ck) of 1.536 MHz coming from a RC oscillator.
Select the proper ADF kernel clock source via the RCCRefer to the RCC of the product.
Enable the ADF clocks via the RCCRefer to the RCC of the product.
Reset the ADF via the RCCRefer to the RCC of the product.
AFMUX programmingProgram the AFMUX to select ADF_SD0 and ADF_CCK0 functions.
Enable ADF processing clock:
ADF_CKGCR = 0x0001 0023
PROC DIV = 0 (bypass): adf_proc_ck frequency is 1.536 MHz.
CCKDIV = 1 (division by 2): ADF_CCK0 clock frequency is 768 kHz.
The ADF_CCK0 pin is set in output and generates a clock so that the microphone can exit from low-power mode.
Serial interfaces configuration:
ADF_SITF0CR = 0x0000 1F01
SCKSRC = 0 to select ADF_CCK0 as serial clock.
SIFTMOD = 0 to select LF_MASTER SPI mode.
Clock absence feature is not working in this mode.
The serial interface is enabled.
Bitstream matrix configuration:
ADF_BSMX0CR = 0x0000 0000
DFLT0 filter takes the bitstream of SITF0, sampled on rising edge
Filters configuration (CIC):
ADF_DFLT0CICR = 0x0040 2F40
SCALE = 0x04 (12 dB): RSFLT is not enabled. Note that the gain is 8.5 dB, higher than recommended in order to improve signal accuracy for the SAD. Saturation is not an issue in this case, as only the detection of a signal much lower than the full scale is needed.
MCICD = 0x2F (decimation by 48)
CICMOD = 4 to select a Sinc4
DATSCR = 0 to select data coming from BSMX
Filters configuration (RSFLT and HPF):
ADF_DFLT0RSFR = 0x0000 0301
HPFC = 3: cut-off frequency of 16kHz * 0.0095 = 152 Hz
HPFBYP = 0: HPF not bypassed
RSFLTBYB = 1: RSFLT bypassed
Micro delay adjust:
ADF_DLY0CR = 0x0000 0000
Not used in this example
Enable interrupt events:
ADF_DFLT0IER = 0x0000 1000
Enable the interrupt events the application wants to handle.
In this example, SDDETIE is set to 1 to have an interrupt if a sound is detected.
Table 380. Programming sequence (CIC4) (continued)
OperationsComments
SAD setting:
ADF_SADCR = 0x0000 1400
SADMOD = 1: Trigger based on sound level values
FRSIZE = 4: Sound level computed on 128 samples
HYSTEN = 0: No hysteresis
DETCFG = 0: interrupt generated when the SAD enters in DETECT state
DATCAP = 0: samples not transferred to memory
SADEN = 0: SAD not yet enabled
SAD setting:
ADF_SADCFGR = 0x0025 0001
ANMIN = 0x25: Sound threshold of \(37 * 10^{\text{SNTHR}}/20 = 74 \text{ LSB}^{(1)}\)
HGOVR = 0: four frames (4 x 128 = 512 samples)
LFRNB = 0: Learning phase set to two frames. Not useful in this mode.
ANSLP = 0: Not used in this mode
SNTHR = 1: Threshold set to 6 dB (see ANMIN)
Clear status flags:
ADF_DFLT0ISR = 0x0000 0FFF
Clear all the status flags before running the ADF
Enable the SAD:
ADF_SADCR = 0x0000 1401
Wait for SADACTIVE flag = 1
Enable first the SAD, in order to be sure that data transfer to memory are blocked by the SAD.
Enable the filter:
ADF_DFLT0CR = 0x0000 0001
NBDIS = 0: no samples discarded
ACQMOD = 0: Asynchronous continuous acquisition mode
DMAEN = 0: DMA interface not used
DFLTEN = 1: Filter enabled

Example 2

This example describes the programming of ADF for the capture of a signal coming from a digital microphone, using the CIC5, and the RSFLT, with a total decimation of 64.

Table 381. Programming sequence (CIC5)
OperationsComments
Adjust the proper kernel clock frequency via the RCCAssuming that the RCC is programmed to provide a kernel clock (adf_ker_ck) of 6.144 MHz
Select the proper ADF kernel clock source via the RCCRefer to the RCC of the product.
Enable the ADF clocks via the RCCRefer to the RCC of the product.
Reset the ADF via the RCCRefer to the RCC of the product.
AFMUX programmingProgram the AFMUX to select ADF_SD0 and ADF_CCK0 functions.
Enable ADF processing clock:
ADF_CKGCR = 0x0201 0023
PROC DIV = 2 (division by 3): adf_proc_ck frequency is 6.144 MHz.
CCK DIV = 1 (division by 2): ADF_CCK0 clock frequency is 1.024 MHz.
The ADF_CCK0 pin is set in output and generates a clock so that the microphone can exit from low-power mode.
Table 381. Programming sequence (CIC5) (continued)
OperationsComments
Serial interfaces configuration:
ADF_SITF0CR = 0x0000 1F01
SCKSRC = 0 to select ADF_CCK0 as serial clock.
SIFTMOD = 0 to select LF_MASTER SIPI mode.
Clock absence feature is not working in this mode.
The serial interface is enabled.
Bitstream matrix configuration:
ADF_BSMX0CR = 0x0000 0000
DFLT0 filter takes the bitstream of SITF0, sampled on rising edge
Digital filter control:
ADF_DFLT0CR = 0x0000 0006
NBDIS = 0: no samples discarded
ACQMOD = 0: Asynchronous continuous acquisition mode
DMAEN = 1: DMA interface not used
DFLTEN = 0: Filter disabled
FTH = 1: RXFIFO half-full
Filters configuration (CIC):
ADF_DFLT0CICR = 0x0010 0F50
SCALE = 0x01(+3.5 dB): Output limited to 22 bits due to RSFLT.
MCICD = 0xF (decimation by 16)
CICMOD = 5 to select a Sinc5
DATSCR = 0 to select data coming from BSMX
Filters configuration (RSFLT and HPF):
ADF_DFLT0RSFR = 0x0000 0200
HPFC = 2: cut-off frequency of 16 kHz * 0.0025 = 40 Hz
HPFBYP = 0: HPF not bypassed
RSFLTBYP = 0: RSFLT not bypassed
RSFLTD = 0: Decimation by 4
Micro delay adjust:
ADF_DLY0CR = 0x0000 0000
Not used in this example
Enable interrupt events:
ADF_DFLT0IER = x
Enable the interrupt events the application wants to handle.
Clear status flags:
ADF_DFLT0ISR = 0x0000 0FFF
Clear all the status flags before running the ADF
Program the DMA
Enable the DMA
The DMA must be programmed in order to read the data inside the ADF_DLT0DR register every time a DMA request is generated.
Start acquisition:
ADF_DFLT0CR = 0x0000 0007
The ADF starts to filter data.

37.7.3 Connection examples

Figure 397 shows simple connection examples of the ADF to external sensors.

Figure 398. Sensor connection examples

Figure 398: Sensor connection examples. Three connection diagrams: Digital microphones (reduced IOs), Digital microphones (optimal power), and Single sensor.
Figure 398: Sensor connection examples. Three connection diagrams: Digital microphones (reduced IOs), Digital microphones (optimal power), and Single sensor.

37.7.4 Global frequency response

Figure 398 shows the global frequency response for a 16 kHz audio signal with a digital microphone working at 1.024 MHz. The filter configuration is the following:

Figure 399 shows the theoretical frequency response using a CIC4 and a CIC5.

Figure 399. Global frequency response

Figure 399: Global frequency response graph showing Normalized Magnitude (dB) vs Frequency (Hz) from 0 to 10 x 10^4 Hz for CIC4 and CIC5.
Figure 399: Global frequency response graph showing Normalized Magnitude (dB) vs Frequency (Hz) from 0 to 10 x 10^4 Hz for CIC4 and CIC5.

Figure 400 shows the in-band ripple for a 16 kHz audio signal with a digital microphone working at 1.024 MHz. The filter configuration is the following:

The resulting in-band ripple is ± 0.41 dB for CIC5, and ± 0.45 dB for CIC4.

The - 3 dB cut-off frequency is 7061 Hz.

Figure 400. Detailed frequency response

Figure 400: Detailed frequency response plot showing Normalized Magnitude (dB) versus Frequency (Hz) for CIC5 and CIC4 filters. The plot title is 'FREQUENCY RESPONSE (CICx + RSFLT + HPF)'. The x-axis ranges from 0 to 7000 Hz with major ticks every 1000 Hz. The y-axis ranges from -2 to 0.1 dB with major ticks every 0.2 dB. Two curves are shown: a solid black line for CIC5 and a dotted red line for CIC4. Both curves start at -2 dB at 0 Hz, rise to a peak of approximately -0.1 dB at 1000 Hz, then dip to a local minimum of about -0.6 dB at 2000 Hz. They then rise to a higher peak of about -0.1 dB at 3500 Hz, dip to a local minimum of about -0.8 dB at 5000 Hz, rise to a peak of about -0.3 dB at 6000 Hz, and finally drop sharply to -2 dB at 7000 Hz. The CIC5 curve is consistently slightly higher than the CIC4 curve in the passband.
Figure 400: Detailed frequency response plot showing Normalized Magnitude (dB) versus Frequency (Hz) for CIC5 and CIC4 filters. The plot title is 'FREQUENCY RESPONSE (CICx + RSFLT + HPF)'. The x-axis ranges from 0 to 7000 Hz with major ticks every 1000 Hz. The y-axis ranges from -2 to 0.1 dB with major ticks every 0.2 dB. Two curves are shown: a solid black line for CIC5 and a dotted red line for CIC4. Both curves start at -2 dB at 0 Hz, rise to a peak of approximately -0.1 dB at 1000 Hz, then dip to a local minimum of about -0.6 dB at 2000 Hz. They then rise to a higher peak of about -0.1 dB at 3500 Hz, dip to a local minimum of about -0.8 dB at 5000 Hz, rise to a peak of about -0.3 dB at 6000 Hz, and finally drop sharply to -2 dB at 7000 Hz. The CIC5 curve is consistently slightly higher than the CIC4 curve in the passband.

37.7.5 Total ADF gain

This section details how to compute the signal level provided by the ADF according to the filter settings.

A signal level may be expressed in dBFS (decibel full scale). A 0 dBFS level is assigned to the maximum possible digital level. For example, a signal that reaches 50 % of the maximum level, has a – 6 dBFS level (6 dB below full scale).

For example, for the ADF offering a final data width of 24 bits, a signal having an amplitude of 2 × 10⁶ LSB has a level of:

\[20 \times \log_{10} \left( \frac{2 \times 10^6}{2^{(24-1)}} \right) = -12.45 \text{ dBFS}\]

In addition, the data size of a signal having an amplitude (Amp) expressed in LSB is given by:

\[DS = \left( \frac{\ln(\text{Amp})}{\ln(2)} + 1 \right) \text{ bits}\]

One bit need to be added for negative values.

So a signal having an amplitude of 2 × 10⁶ LSB, has a data size of 21.9 bits.

CIC gain

The CIC gain (\(G_{\text{CIC}}\) and \(G_{\text{dB,CIC}}\)) can be deduced from the following formula giving data size in bits (\(DS_{\text{CIC}}\)).

\[DS_{\text{CIC}} = (N \times \log_2(D1)) + DS_{\text{in}}\]

where N represents the CIC order (selected by CICMOD[2:0]), and D1 is the decimation ratio (given by MCICD[8:0]).

\(DS_{\text{in}}\) represents the data size (in bits) of the signal at CIC input.


Warning: \(DS_{\text{CIC}}\) is very important for CIC filter. In order to work fine, \(DS_{\text{CIC}}\) must not exceed 26 bits.


The CIC gain \(G_{\text{CIC}}\) is given by:

\[G_{CIC} = (D1)^N\]

which gives in decibels:

\[GdB_{CIC} = 20 \times \log_{10}((D1)^N)\]

Data size at SCALE output

The data size at SCALE output (including the CIC gain), is a key information as the RSFLT starts to have some saturations, if the peak-to-peak signal amplitude at SCALE output is higher than 22 bits.

If the RSFLT is bypassed, then a peak-to-peak signal amplitude of 24 bits is accepted.

The signal amplitude at SCALE output is:

\[Asout_{SCALE} = D1^N \times 10^{\frac{GdB_{SCALE}}{20}} \times Asin_{DFLT}\]

\(GdB_{SCALE}\) represents the gain selected by SCALE[5:0], in dB.

\(Asout_{SCALE}\) is the signal amplitude at SCALE output (in LSB), and \(Asin_{DFLT}\) is the signal amplitude at CIC input (LSB).

\[DS_{SCALE} = \frac{\ln(Asout_{SCALE})}{\ln(2)} + 1\]

The data size at SCALE output (\(DS_{SCALE}\)) is expressed in bits.

RSFLT gain

The RSFLT gain in the useful bandwidth is typically 9.5 dB, but due to ripple a margin of about ±0.41 dB must be considered.

\[G_{RSFLT} = 10^{\frac{9.5 \text{ dB}}{20}} = 2.98 \text{ typical}\]

Note: The HPF filter has a gain of 0 dB.

SAD gain

The SAD is using only the 16 MSB on the signal, as a consequence, from the SAD point of view, the truncation from 24 to 16 bits can be seen as an attenuation.

\[GdB_{SAD} = -48.1 \text{ dB}\]

and

\[G_{SAD} = 0.003906\]

The Figure 401 shows a simplified view of the filter path and gives, for each significant component, the expression of the bit growth and the gain.

Figure 401. Simplified DFLT view with gain information

Figure 401: Simplified DFLT view with gain information. The diagram shows a signal flow from Bin through a CIC filter, a D1 decimator, a SCALE block, a SAT block, an RSFLT block, an HPF block, and an SAD block to PCM[23:0]. Gain and gain in dB values are provided for each block.

Gain (linear)

Gain (dB)

(1) The SAD is not always implemented (see the ADF implementation section for details). MSv62698V1

Figure 401: Simplified DFLT view with gain information. The diagram shows a signal flow from Bin through a CIC filter, a D1 decimator, a SCALE block, a SAT block, an RSFLT block, an HPF block, and an SAD block to PCM[23:0]. Gain and gain in dB values are provided for each block.

Table 382 summarizes of the final data size for different filter configurations.

Table 382. Output signal levels

Filter configurationsFinal signal amplitude (LSB)
CIC + RSFLT + HPF + SAD

Samples provided to the RXFIFO:

\[Asout_{RXFIFO} = D1^N \times 10^{\frac{GdB_{SCALE}}{20}} \times 10^{\frac{9.5}{20}} \times Asin_{DFLT}\]

Samples provided to the SAD:

\[Asout_{SAD} = D1^N \times 10^{\frac{GdB_{SCALE}}{20}} \times 10^{\frac{9.5}{20}} \times 0.003906 \times Asin_{DFLT}\]

\(DS_{SCALE}\) must be lower than 22 bits.

CIC + RSFLT (+ HPF)
\[ASout_{HPF} = D1^N \times 10^{\frac{GdB_{SCALE}}{20}} \times 10^{\frac{9.5}{20}} \times Asin_{DFLT}\]

\(DS_{SCALE}\) must be lower than 22 bits.

CIC (+ HPF)
\[ASout_{HPF} = D1^N \times 10^{\frac{GdB_{SCALE}}{20}} \times Asin_{DFLT}\]

\(DS_{SCALE}\) must be lower than 24 bits.

Example using the main filter chain

If the ADF filter is programmed as follows:

Check first the data size at CIC output:

\[DS_{CIC} = (5 \times \log_2(24)) + 1 \text{ bit} = 23.92 \text{ bits}\]

The size is lower than 26 bits, so the CIC works in good conditions.

The data size at CIC output is very close to 24 bits, so the SCALE must be adjusted in order to provide a 22-bit max signal to the RSFLT. An attenuation of 12 dB is needed.

Then the signal level provided to the RSFLT is:

\[Asout_{SCALE} = 24^5 \times 10^{\frac{-12}{20}} \times 1 = 2.10^6\]

\[DS_{SCALE} = \frac{\ln(2.10^6)}{\ln(2)} + 1 = 21.93 \text{ bits}\]

If a higher gain is used, the RSFLT may saturate the output signal for strong input signals.

At the end, the final signal amplitude is:

\[Asout_{HPF} = 24^5 \times 10^{\frac{-12}{20}} \times 10^{\frac{9.5}{20}} \times 1 = 5.9711 \times 10^6\]

\[Dsout_{HPF} = \left( \frac{\ln(5.9711 \times 10^6)}{\ln(2)} + 1 \right) = 23.51 \text{ bits}\]

or:

\[SDB_{OUT} = 20 \times \log_{10} \left( \frac{2^{23.51}}{2^{24}} \right) = -2.84 \text{ dBFS}\]

37.7.6 How to compute SAD thresholds

The SAD does not compute the RMS value of the converted signal, but the average of the absolute values. As a consequence, the estimated level differs from the RMS value of the signal:

Note: FRSIZE[2:0] has a big influence on the accuracy of the level estimation: big FRSIZE[2:0] values give better results.

Threshold programming with SADMOD = 01

Consider the case of a sound capture where the application wants to wake up the system when the captured sound is bigger than 63 dB SPL.

The sound capture can be performed with a digital microphone such as the MP45DT02.

The sensitivity of this microphone is typically -26 dBFS for an input signal of 94 dB SPL.

An acoustic signal at 63 dB SPL produces a digital signal of about:
- 26 dBFS - (94 - 63) = - 57 dBFS.

For this example, the filter configuration is the following:

A SCALE value of 3.5 dB is recommended for this configuration. As DFTL0 provides samples only used for a sound detection (samples not provided to the application), a bigger gain value can be applied: it increases the SAD accuracy and a saturation does not affect the SAD behavior (for example, a SCALE value of 15.6 dB).

The input signal is - 57 dBFS, corresponding to an amplitude

\[A_{\text{in}} = 10^{(-57/20)} = 0.00141 \text{ LSB.}\]

The total filter gain for the SAD is:

\[G_{\text{SAD}} = 16^5 \times 10^{\frac{15.6}{20}} \times 10^{\frac{9.5}{20}} \times \frac{1}{256} = 73.68 \times 10^3 \text{ or } 97.3 \text{ dB}\]

The signal amplitude received by the SAD is:

\[A_{\text{inSAD}} = 0.00141 \times G_{\text{SAD}} \sim 104 \text{ LSB}\]

The gain can be increased if the expected amplitude is too small. For the targeted application, 104 LSB is fine.

If the input signal is expected to be a sine, the sound level for a signal amplitude of 104 LSB is:

\[\text{SDLVL} = \frac{A_{\text{inSAD}} \times \sqrt{2}}{2} \times 0.9 \sim 66 \text{ LSB}\]

where 0.9 is the correction factor to apply with respect to the RMS value.

ANMIN and SNTHR must be programmed to trigger the SAD when the input signal level reaches 66 LSB.

For SADMOD[1:0] = 01, the threshold value is given by:

\[\text{THR} = \text{ANMIN} \times 10^{\frac{\text{GdB}_{\text{SNTHR}}}{20}}\]

where \(\text{GdB}_{\text{SNTHR}}\) represents the decibel value selected by SNTHR[3:0].

When SNTHR[3:0] = 6 dB for example, this formula becomes:

\[\text{THR} = 2 \times \text{ANMIN}\]

So \(\text{ANMIN} = \text{THR}/2 = 66 / 2 = 33 \text{ LSB.}\)

In Figure 401, the trigger value (THR in red) is fixed to 66 LSB. The input signal is at - 65 dBFS during 256 samples, then its value goes to - 55 dB for 256 samples, and finally it is reduced to - 60 dBFS.

The blue curve is showing the sound level estimation (SDLVL) versus time. Fluctuation on the estimated value can be observed due to windowing effect of FRSIZE samples.

The SAD DETECT state (when green signal is high) is maintained during four additional frames due to hangover function value.

In this example ANSLP = FRSIZE = 3 (64 samples), LFRNB = 0 (2 frames), HGOVR = 0 (4 frames), SNTHR = 1 (6 dB) and ANMIN = 33.

Figure 402. SAD example working with SADMOD = 01

Figure 402: A line graph showing the SAD example working with SADMOD = 01. The x-axis represents 'Samples' from 0 to 900. The y-axis represents 'dBFS' from 0 to 120. The graph contains four data series: |Sin| (black line, representing the input signal amplitude), SDLVL (blue line, representing the sound level estimation), THR (red line, representing the threshold at approximately 65 dBFS), and SAD State (green line, representing the detection state). The |Sin| signal is a periodic waveform that fluctuates between 0 and 120 dBFS. The SDLVL signal follows the general trend of the |Sin| signal but with some smoothing. The THR is a constant horizontal line at 65 dBFS. The SAD State is a step function that is low (0) until the |Sin| signal exceeds the threshold, then it goes high (1) and remains high for a period of time after the signal drops below the threshold, demonstrating the hangover function.
Figure 402: A line graph showing the SAD example working with SADMOD = 01. The x-axis represents 'Samples' from 0 to 900. The y-axis represents 'dBFS' from 0 to 120. The graph contains four data series: |Sin| (black line, representing the input signal amplitude), SDLVL (blue line, representing the sound level estimation), THR (red line, representing the threshold at approximately 65 dBFS), and SAD State (green line, representing the detection state). The |Sin| signal is a periodic waveform that fluctuates between 0 and 120 dBFS. The SDLVL signal follows the general trend of the |Sin| signal but with some smoothing. The THR is a constant horizontal line at 65 dBFS. The SAD State is a step function that is low (0) until the |Sin| signal exceeds the threshold, then it goes high (1) and remains high for a period of time after the signal drops below the threshold, demonstrating the hangover function.

Threshold programming with SADMOD = 1x

Consider the case of a sound capture where the application wants to wake up the system when the captured sound is bigger than 57 dB SPL.

The sound capture can be performed with a digital microphone such as the MP45DT02. The sensitivity of this microphone is typically - 26 dBFS for an input signal of 94 dB SPL.

An acoustic signal at 57 dB SPL produces a digital signal of about:

- 26 dBFS - (94-63) = - 63 dBFS.

For this example, the filter configuration is the following:

A SCALE value of 3.5 dB is recommended for this configuration. The samples provided by DFTL0 are only used for a sound detection, without providing the samples to the application, a bigger gain value can be provided: it increases the SAD accuracy and a saturation does not affect the SAD behavior (for example, a SCALE value of 24 dB).

The input signal is - 63 dBFS, corresponding to an amplitude:

\[A_{\text{sin}} = 10^{(-63/20)} = 0.000708 \text{ LSB.}\]

The total filter gain for the SAD is:

\[G_{\text{SAD}} = 48^4 \times 10^{\frac{24}{20}} \times 0.003906 = 328.6 \times 10^3 \text{ or } 110.3 \text{ dB}\]

The signal amplitude received by the SAD is:

\[A_{\text{in}_{\text{SAD}}} = 0.000708 \times G_{\text{SAD}} \sim 232 \text{ LSB}\]

The gain can be increased if the expected amplitude is too small.

If the input signal is expected to be a sine, the sound level for a signal amplitude of 232 LSB is:

\[SDLVL = \frac{A_{in\_SAD} \times \sqrt{2}}{2} \times 0.9 \sim 148 \text{ LSB}\]

where 0.9 is the correction factor to apply with respect to the RMS value.

Note: ANLVL converges to average of SDLVL values, with a long constant time.
So SDLVL~ANLVL = 148 LSB for a constant input signal at 57 dB SPL.

For SADMOD = 1, the SAD compares the estimated ambient noise multiplied by the gain selected by SNTHR[3:0] to ANMIN[12:0]*4.

For simplification, SNTHR[3:0] is set to 1 (6 dB), meaning that ANLVL is multiplied by two.

The SAD triggers if 2*ANLVL > THR.

In this mode:

\[THR = 4 \times ANMIN\]

So the SAD triggers if:

\[ANLVL > 2 \times ANMIN\]

So ANMIN = 148/2 = 74 LSB

In Figure 402, the trigger value (THR in red) is fixed to 148 LSB. The input signal is at -75 dBFS during 512 samples, then its value goes to -62 dB for 11000 samples, and finally it is reduced to -70 dBFS.

The blue curve shows the sound level estimation (SDLVL) versus time. The black curve shows the ambient noise estimation versus time, increasing or decreasing logarithmically. During the learning phase, it reaches the SDLVL value.

In this example ANSLP = 6, FRSIZE = 3 (64 samples), LFRNB = 0 (2 frames), HGOVR = 0 (4 frames), SNTHR = 1 (6 dB) and ANMIN = 74.

Figure 403. SAD example working with SADMOD = 1x

Figure 403: A line graph showing the SAD example working with SADMOD = 1x. The x-axis represents Samples (0 to 18000) and the y-axis represents LSB (0 to 300). The graph displays several data series: |Sin| (grey area), SDLVL (blue line), ANLVL (black line), THR (red line), and SAD State (green line). The |Sin| signal is a noisy signal that fluctuates between 0 and 250 LSB. The SDLVL signal is a constant blue line at approximately 160 LSB. The ANLVL signal is a black line that starts at 0, increases logarithmically to meet the SDLVL line at approximately 6000 samples, and then follows the SDLVL line. The THR signal is a constant red line at 148 LSB. The SAD State signal is a green line that is low until approximately 6000 samples, where it transitions to a high state, remaining high until approximately 12000 samples, where it transitions back to a low state.
Figure 403: A line graph showing the SAD example working with SADMOD = 1x. The x-axis represents Samples (0 to 18000) and the y-axis represents LSB (0 to 300). The graph displays several data series: |Sin| (grey area), SDLVL (blue line), ANLVL (black line), THR (red line), and SAD State (green line). The |Sin| signal is a noisy signal that fluctuates between 0 and 250 LSB. The SDLVL signal is a constant blue line at approximately 160 LSB. The ANLVL signal is a black line that starts at 0, increases logarithmically to meet the SDLVL line at approximately 6000 samples, and then follows the SDLVL line. The THR signal is a constant red line at 148 LSB. The SAD State signal is a green line that is low until approximately 6000 samples, where it transitions to a high state, remaining high until approximately 12000 samples, where it transitions back to a low state.

37.8 ADF registers

All the ADF registers must be accessed either in word (32-bit) or half-word (16-bit) formats.

37.8.1 ADF global control register (ADF_GCR)

Address offset: 0x000

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.Res.Res.Res.TRGO
rw

Bits 31:1 Reserved, must be kept at reset value.

Bit 0 TRGO: Trigger output control

This bit is set by software and reset by hardware. It is used to start the acquisition of several filters synchronously. It is also used to synchronize several ADF together by controlling the adf_trgo signal.

0: Write 0 has no effect. Read 0 means that the trigger can be set again to 1.

1: Write 1 generates a positive pulse on the adf_trgo signal and triggers the acquisition on enabled filter having their ACQMOD[2:0] = 01x and selecting TRGO as trigger. Read 1 means that the trigger pulse is still active.

37.8.2 ADF clock generator control register (ADF_CKGCR)

Address offset: 0x004

Reset value: 0x0000 0000

This register is used to control the clock generator. The clock adf_proc_ck must be enabled before enabling other ADF parts.

31302928272625242322212019181716
CKGACTIVEPROCDIV[6:0]Res.Res.Res.Res.CCKDIV[3:0]
rrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
TRGSRC[3:0]Res.Res.Res.TRGSENSRes.CCK1DIRCCK0DIRCKGMODRes.CCK1ENCCK0ENCKGDEN
rwrwrwrwrwrwrwrwrwrwrw

Bit 31 CKGACTIVE: Clock generator active flag

This bit is set and cleared by hardware. It is used by the application to check if the clock generator is effectively enabled (active) or not. The protected fields of this function can only be updated when CKGACTIVE = 0 (see Section 37.4.12: Register protection for details).

The delay between a transition on CKGDEN and a transition on CKGACTIVE is two periods of AHB clock and two 2 periods of adf_proc_ck.

0: The clock generator is not active and can be configured if needed.

1: The clock generator is active and protected fields cannot be configured.

Bits 30:24 PROCDIV[6:0]: Divider to control the serial interface clock

This bitfield is set and reset by software. It is used to adjust the frequency of the clock provided to the SITF.

\[F_{\text{adf\_itf\_ck}} = \frac{F_{\text{adf\_ker\_ck}}}{(\text{PROC DIV} + 1)}\]

This bitfield must not be changed if the filter is enabled (DFTEN = 1).

0: adf_ker_ck provided to the SITF

1: adf_ker_ck / 2 provided to the SITF

2: adf_ker_ck / 3 provided to the SITF

...

127: adf_ker_ck / 128 provided to the SITF

Note: This bitfield can be write-protected (see Section 37.4.12: Register protection for details).

Bits 23:20 Reserved, must be kept at reset value.

Bits 19:16 CCKDIV[3:0]: Divider to control the ADF_CCK clock

This bitfield is set and reset by software. It is used to adjust the frequency of the ADF_CCK clock. The input clock of this divider is the clock provided to the SITF. More globally, the frequency of the ADF_CCK is given by the following formula:

\[F_{\text{ADF\_CCK}} = \frac{F_{\text{adf\_ker\_ck}}}{(\text{PROC DIV} + 1) \times (\text{CCK DIV} + 1)}\]

This bitfield must not be changed if the filter is enabled (DFTEN = 1).

0000: The ADF_CCK clock is adf_proc_ck.

0001: The ADF_CCK clock is adf_proc_ck / 2.

0010: The ADF_CCK clock is adf_proc_ck / 3.

...

1111: The ADF_CCK clock is adf_proc_ck / 16.

Note: This bitfield can be write-protected (see Section 37.4.12: Register protection for details).

Bits 15:12 TRGSRC[3:0]: Digital filter trigger signal selection

This bitfield is set and cleared by software. It is used to select which external signals trigger the corresponding filter. This bitfield is not significant if the CKGMOD = 0.

000x: TRGO selected

0010: adf_trg1 selected

Others: Reserved

Note: This bitfield can be write-protected (see Section 37.4.12: Register protection for details).

Bits 11:9 Reserved, must be kept at reset value.

Bit 8 TRGSENS: CKGEN trigger sensitivity selection

This bit is set and cleared by software. It is used to select the trigger sensitivity of the trigger signals. This bit is not significant if the CKGMOD = 0.

0: A rising edge event triggers the activation of CKGEN dividers.

1: A falling edge event triggers the activation of CKGEN dividers.

Note: When the trigger source is TRGO, the sensitivity is forced to falling edge, thus TRGSENS value is not taken into account. This bit can be write-protected (see Section 37.4.12: Register protection for details).

Bit 7 Reserved, must be kept at reset value.

Bit 6 CCK1DIR: ADF_CCK1 direction

This bit is set and reset by software. It is used to control the direction of the ADF_CCK1 pin.

0: The ADF_CCK1 pin direction is in input.

1: The ADF_CCK1 pin direction is in output.

Note: This bit can be write-protected (see Section 37.4.12: Register protection for details).

Bit 5 CCK0DIR: ADF_CCK0 direction

This bit is set and reset by software. It is used to control the direction of the ADF_CCK0 pin.

0: The ADF_CCK0 pin direction is in input.

1: The ADF_CCK0 pin direction is in output.

Note: This bit can be write-protected (see Section 37.4.12: Register protection for details).

Bit 4 CKGMOD: Clock generator mode

This bit is set and reset by software. It is used to define the way the clock generator is enabled. This bit must not be changed if the filter is enabled (DFTEN = 1).

0: The kernel clock is provided to the dividers as soon as CKGDEN is set to 1.

1: The kernel clock is provided to the dividers when CKGDEN is set to 1 and the trigger condition met.

Note: This bit can be write-protected (see Section 37.4.12: Register protection for details).

Bit 3 Reserved, must be kept at reset value.

Bit 2 CCK1EN: ADF_CCK1 clock enable

This bit is set and reset by software. It is used to control the generation of the bitstream clock on the ADF_CCK1 pin.

0: Bitstream clock not generated

1: Bitstream clock generated on the ADF_CCK1 pin.

Bit 1 CCK0EN: ADF_CCK0 clock enable

This bit is set and reset by software. It is used to control the generation of the bitstream clock on the ADF_CCK0 pin.

0: Bitstream clock not generated

1: Bitstream clock generated on the ADF_CCK0 pin

Bit 0 CKGDEN: CKGEN dividers enable

This bit is set and reset by software. It is used to enable/disable the clock dividers of the CKGEN: PROCDIV and CCKDIV.

0: CKGEN dividers disabled

1: CKGEN dividers enabled

37.8.3 ADF serial interface control register 0 (ADF_SITF0CR)

Address offset: 0x080

Reset value: 0x0000 1F00

This register is used to control the serial interface SITF0.

RM0517Bit 0UART9LPEN
Bit 2CCK1EN: ADF_CCK1 clock enable
Bit 1CCK0EN: ADF_CCK0 clock enable
Bit 0CKGDEN: CKGEN dividers enable
31 30 29 SITFAC2827 26 25 24 23 22 21 20 19 18 17 16
TIVE Res. Res. rRes.Res. Res. Res. Res. Res. Res. Res. Res. Res. Res. Res. Res.
15 14 131211 10 9 8 7 6 5 4 3 2 1 0
Res. Res. Res.STH[4:0] Res. Res. SITFMOD[1:0] Res. SCKSRC[1:0] SITFE N
rwrw rw rw rw rw rw rw rw rw
RM0517 Rev 1 1615/ 3945

37.8.4 ADF bitstream matrix control register 0 (ADF_BSMX0CR)

Address offset: 0x084

Reset value: 0x0000 0000

This register is used to select the bitstream to be provided to DFLT0.

31302928272625242322212019181716
BSMXACTIVERes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
r
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.BSSEL[4:0]
rwrwrwrwrw

Bit 31 BSMXACTIVE: BSMX active flag

This bit is set and cleared by hardware. It is used by the application to check if the BSMX is effectively enabled (active) or not. BSSEL[4:0] can only be updated when BSMXACTIVE is set to 0. This BSMXACTIVE flag cannot go to 0 if DFLT0 is enabled.

0: BSMX is not active and can be configured if needed.

1: BSMX is active and protected fields cannot be configured.

Bits 30:5 Reserved, must be kept at reset value.

Bits 4:0 BSSEL[4:0]: Bitstream selection

This bitfield is set and cleared by software. It is used to select the bitstream to be processed for DFLT0.

00000: bs0_r provided to DFLT0

00001: bs0_f provided to DFLT0

others: reserved

Note: This bitfield can be write-protected (see Section 37.4.12: Register protection for details).

37.8.5 ADF digital filter control register 0 (ADF_DFLT0CR)

Address offset: 0x088

Reset value: 0x0000 0000

31302928272625242322212019181716
DFLTACTIVEDFLTRUNRes.Res.NBDIS[7:0]Res.Res.Res.Res.
rrrwrwrwrwrwrwrwrw
1514131211109876543210
TRGSRC[3:0]Res.Res.Res.TRGSENSRes.ACQMOD[2:0]Res.FTHDMAENDFLTEN
rwrwrwrwrwrwrwrwrwrww

Bit 31 DFLTACTIVE: DFLT0 active flag

This bit is set and cleared by hardware. It indicates if DFLT0 is active: can be running or waiting for events.

0: DFLT0 not active (can be re-enabled again, via DFLTEN bit, if needed)

1: DFLT0 active

Bit 1 DMAEN: DMA requests enable

This bit is set and cleared by software. It is used to control the generation of DMA request to transfer the processed samples into the memory.

0: DMA interface for the corresponding digital filter disabled

1: DMA interface for the corresponding digital filter enabled

Note: This bit can be write-protected (see Section 37.4.12: Register protection for details).

Bit 0 DFLTEN: DFLT0 enable

This bit is set and cleared by software. It is used to control the start of acquisition of the DFLT0 path. This bit behavior depends on ACQMOD[2:0] and external events. The serial or parallel interface delivering the samples must be enabled as well.

0: Acquisition immediately stopped

1: Acquisition immediately started if ACQMOD[2:0] = 00x or 101, or acquisition started when the proper trigger event occurs if ACQMOD[2:0] = 01x.

37.8.6 ADF digital filer configuration register 0 (ADF_DFLT0CICR)

Address offset: 0x08C

Reset value: 0x0000 0000

This register is used to control the main CIC filter.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.SCALE[5:0]Res.Res.Res.MCICD 8
rwrwrwrwrwrwrw
1514131211109876543210
MCICD[7:0]Res.CICMOD[2:0]Res.Res.DATSRC[1:0]
rwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:26 Reserved, must be kept at reset value.

Bits 25:20 SCALE[5:0]: Scaling factor selection

This bitfield is set and cleared by software. It is used to select the gain to be applied at CIC output (see Table 370 for details). If the application attempts to write a new gain value while the previous one is not yet applied, this new gain value is ignored. Reading back this bitfield informs the application on the current gain value.

000000: 0 dB

000001: + 3.5 dB

000010: + 6 dB or shift left by 1 bit

...

011000: + 72 dB or shift left by 12 bits

100000: - 48.2 dB or shift right by 8 bits (default value)

100001: - 44.6 dB

100010: - 42.1 dB or shift right by 7 bits

100011: - 38.6 dB

...

101110: -6 dB or shift right by 1 bit

101111: -2.5 dB

Others: Reserved

Bits 19:17 Reserved, must be kept at reset value.

Bits 16:8 MCICD[8:0]: CIC decimation ratio selection

This bitfield is set and cleared by software. It is used to select the CIC decimation ratio. A decimation ratio smaller than two is not allowed. The decimation ratio is given by (CICDEC+1).

0: Decimation ratio is 2.

1: Decimation ratio is 2.

2: Decimation ratio is 3.

3: Decimation ratio is 4.

...

511: Decimation ratio is 512.

Note: This bitfield can be write-protected (see Section 37.4.12: Register protection for details).

Bit 7 Reserved, must be kept at reset value.

Bits 6:4 CICMOD[2:0]: Select the CIC order

This bitfield is set and cleared by software. It is used to select the order of the MCIC.

100: MCIC configured in single Sinc4 filter

101: MCIC configured in single Sinc5 filter

Others: Reserved

Note: This bitfield can be write-protected (see Section 37.4.12: Register protection for details).

Bits 3:2 Reserved, must be kept at reset value.

Bits 1:0 DATSR[1:0]: Source data for the digital filter

This bitfield is set and cleared by software.

0x: Stream coming from the BSMX selected

10: Stream coming from the ADCITF1 selected

11: Stream coming from the ADCITF2 selected

Note: This bitfield can be write-protected (see Section 37.4.12: Register protection for details).

37.8.7 ADF reshape filter configuration register 0 (ADF_DFLT0RSFR)

Address offset: 0x090

Reset value: 0x0000 0000

This register is used to control the reshape and HPF filter.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.HPFC[1:0]HPFBYPRes.Res.RSFLTRes.Res.Res.RSFLT
rwrwrwDBYP
rwrw

Bits 31:10 Reserved, must be kept at reset value.

Bits 9:8 HPFC[1:0]: High-pass filter cut-off frequency

This bitfield is set and cleared by software. It is used to select the cut-off frequency of the high-pass filter. \(F_{PCM}\) represents the sampling frequency at HPF input.

00: Cut-off frequency = \(0.000625 \times F_{PCM}\)

01: Cut-off frequency = \(0.00125 \times F_{PCM}\)

10: Cut-off frequency = \(0.00250 \times F_{PCM}\)

11: Cut-off frequency = \(0.00950 \times F_{PCM}\)

Note: This bitfield can be write-protected (see Section 37.4.12: Register protection for details).

Bit 7 HPFBYP: High-pass filter bypass

This bit is set and cleared by software. It is used to bypass the high-pass filter.

0: HPF not bypassed (default value)

1: HPF bypassed

Note: This bit can be write-protected (see Section 37.4.12: Register protection for details).

Bits 6:5 Reserved, must be kept at reset value.

Bit 4 RSFLTD: Reshaper filter decimation ratio

This bit is set and cleared by software. It is used to select the decimation ratio for the reshape filter

0: Decimation ratio is 4 (default value).

1: Decimation ratio is 1.

Note: This bit can be write-protected (see Section 37.4.12: Register protection for details).

Bits 3:1 Reserved, must be kept at reset value.

Bit 0 RSFLTBYP: Reshaper filter bypass

This bit is set and cleared by software. It is used to bypass the reshape filter and its decimation block.

0: Reshape filter not bypassed (default value)

1: Reshape filter bypassed

Note: This bit can be write-protected (see Section 37.4.12: Register protection for details).

37.8.8 ADF delay control register 0 (ADF_DLY0CR)

Address offset: 0x0A4

Reset value: 0x0000 0000

This register is used for the adjustment stream delays.

31302928272625242322212019181716
SKPBFRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
r
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.SKPDLY[6:0]
rwrwrwrwrwrwrw

Bit 31 SKPBF: Skip busy flag

This bit is set and cleared by hardware. It is used to control if the delay sequence is completed.

0: ADF ready to accept a new value into SKPDLY[6:0]

1: Last valid SKPDLY[6:0] still under precessing

Bits 30:7 Reserved, must be kept at reset value.

Bits 6:0 SKPDLY[6:0]: Delay to apply to a bitstream

This bitfield is set and cleared by software. It defines the number of input samples that are skipped. Skipping is applied immediately after writing to this bitfield, if SKPBF = 0 and DFLTEN = 1. If SKPBF = 1, the value written into the register is ignored by the delay state machine.

0: No input sample skipped
1: 1 input sample skipped
...
127: 127 input samples skipped

37.8.9 ADF DFLT0 interrupt enable register (ADF_DFLT0IER)

Address offset: 0x0AC

Reset value: 0x0000 0000

This register is used for allowing or not the events to generate an interrupt.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.SDLVLI
E
SDDET
IE
RFOVR
IE
CKABI
E
SATIERes.Res.Res.Res.Res.Res.Res.DOVRI
E
FTHIE
rwrwrwrwrwrwrw

Bits 31:14 Reserved, must be kept at reset value.

Bits 8:2 Reserved, must be kept at reset value.

ST logo
ST logo

Bit 1 DOVRIE: Data overflow interrupt enable
This bit is set and cleared by software.
0: Data overflow interrupt disabled
1: Data overflow interrupt enabled

Bit 0 FTHIE: RXFIFO threshold interrupt enable
This bit is set and cleared by software.
0: RXFIFO threshold interrupt disabled
1: RXFIFO threshold interrupt enabled

37.8.10 ADF DFLT0 interrupt status register 0 (ADF_DFLT0ISR)

Address offset: 0x0B0

Reset value: 0x0000 0000

This register contains the status flags for the digital filter path.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.SDLVL
F
SDDDET
F
RFOVR
F
CKABFSATFRes.Res.Res.Res.Res.RXNEFRes.DOVRFFTHF
rc_w1rc_w1rc_w1rc_w1rc_w1rrc_w1r

Bits 31:14 Reserved, must be kept at reset value.

Bit 13 SDLVLF: Sound level value ready flag
This bit is set by hardware and cleared by software by writing this bit to 1.
0: Read 0 means that new sound level value is not ready. Write 0 has no effect.
1: Read 1 means that new sound level value is ready. Write 1 clears this flag.

Bit 12 SDDETF: Sound activity detection flag
This bit is set by hardware and cleared by software by writing this bit to 1.
0: Read 0 means that no sound activity is detected. Write 0 has no effect.
1: Read 1 means that sound activity is detected. Write 1 clears this flag.

Bit 11 RFOVRF: Reshape filter overrun detection flag
This bit is set by hardware and cleared by software by writing this bit to 1.
0: Read 0 means that no reshape filter overrun is detected. Write 0 has no effect.
1: Read 1 means that reshape filter overrun is detected. Write 1 clears this flag.

Bit 10 CKABF: Clock absence detection flag
This bit is set by hardware and cleared by software by writing this bit to 1.
0: Read 0 means that no clock absence is detected. Write 0 has no effect.
1: Read 1 means that a clock absence is detected. Write 1 clears this flag.

Bit 9 SATF: Saturation detection flag
This bit is set by hardware and cleared by software by writing this bit to 1.
0: Read 0 means that no saturation is detected. Write 0 has no effect.
1: Read 1 means that a saturation is detected. Write 1 clears this flag.

Bits 8:4 Reserved, must be kept at reset value.

Bit 3 RXNEF: RXFIFO not empty flag

This bit is set and cleared by hardware according to the RXFIFO level.

0: RXFIFO empty

1: RXFIFO not empty

Bit 2 Reserved, must be kept at reset value.

Bit 1 DOVRF: Data overflow flag

This bit is set by hardware and cleared by software by writing this bit to 1.

0: Read 0 means that no overflow is detected. Write 0 has no effect.

1: Read 1 means that an overflow is detected; Write 1 clears this flag.

Bit 0 FTHF: RXFIFO threshold flag

This bit is set by hardware, and cleared by the hardware when the RXFIFO level is lower than the threshold.

0: RXFIFO threshold not reached

1: RXFIFO threshold reached

37.8.11 ADF SAD control register (ADF_SADCR)

Address offset: 0x0B8

Reset value: 0x0000 0000

This register is used for the configuration and the control of the sound activity detection.

31302928272625242322212019181716
SADACTIVERes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
r
1514131211109876543210
Res.Res.SADMOD[1:0]Res.FRSIZE[2:0]HYSTENRes.SADST[1:0]DETCFGDATCAP[1:0]SADEN
rwrwrwrwrwrwrrrwrwrwrw

Bit 31 SADACTIVE: SAD Active flag

This bit is set and cleared by hardware. It is used to check if the SAD is effectively enabled (active) or not. The protected fields and registers of this function can only be updated when the SADACTIVE is set to 0 (see Section 37.4.12: Register protection for details).

The delay between a transition on SADEN and a transition on SADACTIVE is two periods of AHB clock and two periods of adf_proc_ck.

0: SAD not active and can be configured if needed

1: SAD active and protected fields cannot be configured.

Bits 30:14 Reserved, must be kept at reset value.

Bits 13:12 SADMOD[1:0]: SAD working mode

This bitfield is set and cleared by software. It is used to define the way the SAD works.

00: Threshold value computed according to the estimated ambient noise

The SAD triggers when the sound level (SDLVL) is bigger than the defined threshold. In this mode, the SAD works like a voice activity detector.

01: Threshold value equal to ANMIN[12:0], multiplied by the gain selected by SNTHR[3:0]

The SAD triggers when the sound level (SDLVL) is bigger than the defined threshold. In this mode, the SAD works like a sound detector.

1x: Threshold value given by 4 × ANMIN[12:0]

The SAD triggers when the estimated ambient noise (ANLVL), multiplied by the gain selected by SNTHR[3:0] is bigger than the defined threshold. In this mode, the SAD is working like an ambient noise estimator. Hysteresis function cannot be used in this mode.

Note: This bitfield can be write-protected (see Section 37.4.12: Register protection for details).

Bit 11 Reserved, must be kept at reset value.

Bits 10:8 FSIZE[2:0]: Frame size

This bitfield is set and cleared by software. It is used to define the size of one frame and also to define how many samples are taken into account to compute the short-term signal level.

000: 8 PCM samples used to compute the short-term signal level

001: 16 PCM samples used to compute the short-term signal level

010: 32 PCM samples used to compute the short-term signal level

011: 64 PCM samples used to compute the short-term signal level

100: 128 PCM samples used to compute the short-term signal level

101: 256 PCM samples used to compute the short-term signal level

11x: 512 PCM samples used to compute the short-term signal level

Note: This bitfield can be write-protected (see Section 37.4.12: Register protection for details).

Bit 7 HYSTEN: Hysteresis enable

This bit is set and cleared by software. It is used to enable/disable the hysteresis function (see Table 370 for details). This bit must be kept to 0 when SADMOD[1:0] = 1x.

0: Hysteresis function disabled. \(\text{THR}_H\) is always used.

1: Hysteresis function enabled. \(\text{THR}_H\) is used for MONITOR to DETECT transition and \(\text{THR}_L\) is used for DETECT to MONITOR transition.

Note: This bit can be write-protected (see Section 37.4.12: Register protection for details).

Bit 6 Reserved, must be kept at reset value.

Bits 5:4 SADST[1:0]: SAD state

This bitfield is set and cleared by hardware. It indicates the SAD state and is meaningful only when SADEN = 1. The SAD state can be:

- LEARN when the SAD is in learning phase or in SDLVL computation mode

- MONITOR when the SAD is in monitoring phase

- DETECT when the SAD detects a sound

00: SAD in LEARN state

01: SAD in MONITOR state

11: SAD in DETECT state

Bit 3 DETCFG: Sound trigger event configuration

This bit is set and cleared by software. It is used to define if the sddet_evt event is generated only when the SAD enters to MONITOR state or when the SAD enters or exits the DETECT state.

0: sddet_evt generated when SAD enters the MONITOR state

1: sddet_evt generated when SAD enters or exits the DETECT state

Note: This bit can be write-protected (see Section 37.4.12: Register protection for details).

Bits 2:1 DATCAP[1:0]: Data capture mode

This bitfield is set and cleared by software. It is used to define in which conditions, the samples provided by DLFT0 are stored into the memory.

00: Samples from DFLT0 not transfered into the memory

01: Samples from DFLT0 transfered into the memory when SAD is in DETECT state

1x: Samples from DFLT0 transfered into memory when SAD and DFLT0 are enabled

Note: This bitfield can be write-protected (see Section 37.4.12: Register protection for details).

Bit 0 SADEN: Sound activity detector enable

This bit is set and cleared by software. It is used to enable/disable the SAD.

0: SAD disabled and SAD state reset

1: SAD enabled

37.8.12 ADF SAD configuration register (ADF_SADCFGR)

Address offset: 0x0BC

Reset value: 0x0000 0000

This register is used for the configuration of the sound activity detection.

31302928272625242322212019181716
Res.Res.Res.ANMIN[12:0]
rwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
Res.HGOVR[2:0]Res.LFRNB[2:0]Res.ANSLP[2:0]SNTHR[3:0]
rwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:29 Reserved, must be kept at reset value.

Bits 28:16 ANMIN[12:0]: Minimum noise level

This bitfield is set and cleared by software. It is used to define the minimum noise level and then the sensitivity. It represents a positive number.

Note: This bitfield can be write-protected (see Section 37.4.12: Register protection for details).

Bit 15 Reserved, must be kept at reset value.

Bits 14:12 HGOVR[2:0]: Hangover time window

This bitfield is set and cleared by software. Once the SAD state is DETECT, this parameter is used to define the amount of time the sound is allowed to remain below the threshold, before switching the SAD to MONITOR state (see FRSIZE bitfield for the description of a frame).

000: SAD back to MONITOR state if sound is below threshold for 4 frames

001: SAD back to MONITOR state if sound is below threshold for 8 frames

010: SAD back to MONITOR state if sound is below threshold for 16 frames

011: SAD back to MONITOR state if sound is below threshold for 32 frames

100: SAD back to MONITOR state if sound is below threshold for 64 frames

101: SAD back to MONITOR state if sound is below threshold for 128 frames

110: SAD back to MONITOR state if sound is below threshold for 256 frames

111: SAD back to MONITOR state if sound is below threshold for 512 frames

Note: This bitfield can be write-protected (see Section 37.4.12: Register protection for details).

Bit 11 Reserved, must be kept at reset value.

Bits 10:8 LFRNB[2:0]: Number of learning frames

This bitfield is set and cleared by software. It is used to define the number of learning frames to perform the first estimate of the noise level.

000: 2 frames used to compute the initial noise level

001: 4 frames used to compute the initial noise level

010: 8 frames used to compute the initial noise level

011: 16 frames used to compute the initial noise level

1xx: 32 frames used to compute the initial noise level

Note: This bitfield can be write-protected (see Section 37.4.12: Register protection for details).

Bit 7 Reserved, must be kept at reset value.

Bits 6:4 ANSLP[2:0]: Ambient noise slope control

This bitfield is set and cleared by software. It is used to define the positive and negative slope of the noise estimator, in charge of updating the ANLVL (see Ambient noise estimation (ANLVL) for information about programming this bitfield).

Note: This bitfield can be write-protected (see Section 37.4.12: Register protection for details).

Bits 3:0 SNTHR[3:0]: Signal to noise threshold

This bitfield is set and cleared by software. It is used to define \(THR_H\) (and \(THR_L\) if hysteresis is enabled). See Table 370 for details.

0000: \(THR_H\) is 3.5 dB higher than ANLVL

0001: \(THR_H\) is 6.0 dB higher than ANLVL

0010: \(THR_H\) is 9.5 dB higher than ANLVL

0011: \(THR_H\) is 12 dB higher than ANLVL

0100: \(THR_H\) is 15.6 dB higher than ANLVL

0101: \(THR_H\) is 18 dB higher than ANLVL

0110: \(THR_H\) is 21.6 dB higher than ANLVL

0111: \(THR_H\) is 24.1 dB higher than ANLVL

1000: \(THR_H\) is 27.6 dB higher than ANLVL

1001: \(THR_H\) is 30.1dB higher than ANLVL

others: Reserved

Note: This bitfield can be write-protected (see Section 37.4.12: Register protection for details).

37.8.13 ADF SAD sound level register (ADF_SADSDLVR)

Address offset: 0x0C0

Reset value: 0x0000 0000

This register contains the short-term sound-level computed by the SAD.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.SDLVL[14:0]
rrrrrrrrrrrrrrr

Bits 31:15 Reserved, must be kept at reset value.

Bits 14:0 SDLVL[14:0]: Short term sound level

This bitfield is set by hardware. It contains the latest sound level computed by the SAD. To refresh this value, SDLVLF must be cleared.

37.8.14 ADF SAD ambient noise level register (ADF_SADANLVR)

Address offset: 0x0C4

Reset value: 0x0000 0000

This register contains the ambient noise level computed by the SAD.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.ANLVL[14:0]
rrrrrrrrrrrrrrr

Bits 31:15 Reserved, must be kept at reset value.

Bits 14:0 ANLVL[14:0]: Ambient noise level estimation

This bitfield is set by hardware. It contains the latest ambient noise level computed by the SAD. To refresh this bitfield, the SDLVLF flag must be cleared.

37.8.15 ADF digital filter data register 0 (ADF_DFLT0DR)

Address offset: 0x0F0

Reset value: 0x0000 0000

This register is used to read the data processed by the digital filter.

31302928272625242322212019181716
DR[23:8]
rrrrrrrrrrrrrrrr
1514131211109876543210
DR[7:0]Res.Res.Res.Res.Res.Res.Res.Res.
rrrrrrrr

Bits 31:8 DR[23:0]: Data processed by DFT0

Bits 7:0 Reserved, must be kept at reset value.

37.8.16 ADF register map

Table 383. ADF register map and reset values

OffsetRegister name313029282726252423222120191817161514131211109876543210
0x000ADF_GCRRes.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.Res.Res.Res.TRGO
Reset value0
0x004ADF_CKGCRCKGACTIVEPROCDIV[6:0]Res.Res.Res.Res.CCKDIV
[3:0]
TRGSRC
[3:0]
Res.Res.Res.TRGSENSRes.CCK1DIRCCK0DIRCKGMODRes.CCK1ENCCK0ENCKGDEN
Reset value00000000000000000000000

Table 383. ADF register map and reset values (continued)

OffsetRegister name313029282726252423222120191817161514131211109876543210
0x008 -
0x07C
Reserved
0x080ADF_SITF0CRSITFACTIVERes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.STH[4:0]Res.Res.SITFMOD
[1:0]
Res.SCKSRC
[1:0]
SITFEN
Reset value01111100000
0x084ADF_BSMX0CRBSMXACTIVERes.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.BSSEL[4:0]
Reset value000000
0x088ADF_DFLT0CRDFLTACTIVEDFLTRUNRes.Res.NBDIS[7:0]Res.Res.Res.Res.TRGSRC
[3:0]
Res.Res.Res.TRGSENSRes.ACQMOD
[2:0]
Res.FTHDMAENDFLTEN
Reset value000000000000000000000
0x08CADF_DFLT0CICRRes.Res.Res.Res.Res.Res.SCALE[5:0]Res.Res.Res.MCICD[8:0]Res.CICMOD[2:0]Res.Res.DATSRC[1:0]
Reset value00000000000000000000
0x090ADF_
DFLT0RSFR
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.HPFC[1:0]HPFBYPRes.RSFLTDRes.Res.Res.Res.RSFLTBYP
Reset value00000
0x094 -
0x0A0
Reserved
0x0A4ADF_DLY0CRSKPBFRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.SKPDLY[6:0]
Reset value00000000
0x0A8Reserved
0x0ACADF_DFLT0IERRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.SDLVLIESDDETIERFOVRIECKABIESATIERes.Res.Res.Res.Res.Res.Res.Res.DOVRIEFTHIE
Reset value00000000
0x0B0ADF_DFLT0ISRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.SDLVLFSDDETFRFOVRFCKABFSATFRes.Res.Res.Res.RXNEFRes.Res.Res.DOVRFFTHF
Reset value00000000
0x0B4Reserved

Table 383. ADF register map and reset values (continued)

OffsetRegister name313029282726252423222120191817161514131211109876543210
0x0B8ADF_SADCRSADACTIVERes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.SADMOD[1:0]Res.FRSIZE[2:0]HYSTENRes.SADST[1:0]DETCFGDATCAP[1:0]SADEN
Reset value000000000000
0x0BCADF_SADCFGRRes.Res.Res.ANMIN[12:0]Res.Res.HGOVR[2:0]Res.LFRNB[2:0]Res.ANSLPT[2:0]Res.SNTHR[2:0]
Reset value0000000000000000000000000
0x0C0ADF_SADSDLVRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.SDLVL[14:0]
Reset value000000000000000
0x0C4ADF_SADANLVRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.ANLVL[14:0]
Reset value000000000000000
0x0C8 - 0x0ECReserved
0x0F0ADF_DFLT0DRDR[23:0]Res.Res.Res.Res.Res.Res.Res.
Reset value0000000000000000000000000

Refer to Section 2.3: Memory organization for the register boundary addresses.