14. Peripherals interconnect matrix
14.1 Introduction
Several peripherals have direct connections between them. This allows autonomous communication and or synchronization between peripherals, saving CPU resources, thus power supply consumption.
In addition, these hardware connections avoid software latency and allow design of predictable system.
Depending on peripherals, these interconnections can operate in various power modes: Run, Sleep, and Stop modes.
14.2 Connection summary
Table 84. Peripherals interconnect matrix(1) (2)
| Source | Destination | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| TIM1 | TIM2 | TIM3 | TIM6 | TIM7 | LPTIM1 | LPTIM2 | ADC1 | OPAMP1 | DAC1/2 | COMP1 | GPDMA | TAMP | RTC | DTS | |
| TIM1 | - | 1 | 1 | - | - | - | - | 2 | - | 4 | 10 | - | - | - | - |
| TIM2 | 1 | - | 1 | - | - | - | - | 2 | - | 4 | 10 | 13 | - | - | - |
| TIM3 | 1 | 1 | - | - | - | - | - | 2 | - | 4 | 10 | - | - | - | - |
| TIM6 | - | - | - | - | - | - | - | 2 | - | 4 | - | - | - | - | - |
| TIM7 | - | - | - | - | - | - | - | 2 | - | 4 | - | - | - | - | - |
| LPTIM1 | - | - | - | - | - | - | 6 | 2 | - | 4 | 10 | 13 | - | - | 5 |
| LPTIM2 | - | - | - | - | - | 6 | - | 2 | - | 4 | 10 | 13 | - | - | 5 |
| ADC1 | 3 | - | - | - | - | - | - | - | - | - | - | - | 16 | - | - |
| DAC1/2 | - | - | - | - | - | - | - | - | 14 | - | 14 | - | - | - | - |
| OPAMP | - | - | - | - | - | - | - | 14 | - | - | - | - | - | - | - |
| COMP1 | 11 | 11 | 11 | - | - | 8 | 8 | - | - | - | - | 13 | - | - | - |
| GPDMA1 | - | - | - | - | - | 8 | 8 | - | - | - | - | 13 | - | - | - |
| GPDMA2 | - | - | - | - | - | 8 | 8 | - | - | - | - | 13 | - | - | - |
| EXTI | - | - | - | - | - | - | - | 2 | - | 4 | - | 13 | - | - | 5 |
| RTC wakeup | - | 9 | - | - | - | - | - | - | - | - | - | 13 | - | - | - |
| RTC alarm | - | - | - | - | - | 8 | 8 | - | - | - | - | 13 | - | - | - |
| RTC calendar overflow | - | - | - | - | - | - | - | - | - | - | - | - | 16 | - | - |
| TAMP | - | - | - | - | - | 8 | 8 | - | - | - | - | 13 | - | 17 | - |
| HSE | - | - | 7 | - | - | 7 | - | - | - | - | - | - | - | - | - |
| LSE | - | 7 | - | - | - | 7 | - | - | - | 15 | - | - | - | - | - |
| CSS on LSE | - | - | - | - | - | - | - | - | - | - | - | - | 16 | - | - |
| CSS on HSE | 12 | - | - | - | - | - | - | - | - | - | - | - | 16 | - | - |
| CSI | 7 | 7 | 7 | - | - | - | 7 | - | - | - | - | - | - | - | - |
| HSI | 7 | 7 | 7 | - | - | - | 7 | - | - | - | - | - | - | - | - |
| LSI | - | 7 | - | - | - | 7 | - | - | - | 15 | - | - | - | - | - |
| MCO1 | - | 7 | 7 | - | - | 7 | - | - | - | - | - | - | - | - | - |
| Source | Destination | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| TIM1 | TIM2 | TIM3 | TIM6 | TIM7 | LPTIM1 | LPTIM2 | ADC1 | OPAMP1 | DAC1/2 | COMP1 | GPDMA | TAMP | RTC | DTS | |
| MCO2 | - | 7 | 7 | - | - | - | 7 | - | - | - | - | - | - | - | - |
| VCORE | - | - | - | - | - | - | - | 14 | - | - | - | - | - | - | - |
| VREFINT | - | - | - | - | - | - | - | 14 | - | - | 14 | - | - | - | - |
| T sensor (VSENSE) | - | - | - | - | - | - | - | 14 | - | - | 14 | - | - | - | - |
| VBAT | - | - | - | - | - | - | - | 14 | - | - | 14 | - | - | - | - |
| VBAT and temperature monitor | - | - | - | - | - | - | - | - | - | - | - | - | 16 | - | - |
| System errors | 12 | - | - | - | - | - | - | - | - | - | - | - | - | - | - |
| EVENTOUT | - | - | - | - | - | 8 | 8 | - | - | - | - | 13 | - | - | - |
1. Numbers in this table are links to corresponding subsections of Section 14.3.
2. “-” means no interconnect.
14.3 Interconnection details
14.3.1 Master to slave interconnection for timers
From timer (TIM1/TIM2/TIM3) to timer (TIM1/TIM2/TIM3)
Purpose
Some of the TIMx timers are linked together internally for timer synchronization or chaining.
When one timer is configured in master mode, it can reset, start, stop, or clock the counter of another timer configured in slave mode.
A description of the feature is provided in Section 27.4.23: Timer synchronization.
The synchronization modes are detailed in:
- • Section 26.3.30 for advanced-control timers TIM1
- • Section 27.4.22 for general-purpose timers TIM2/TIM3
Triggering signals
The output (from master) is on signal TIMx_TRGO (and TIMx_TRGO2 for TIM1) following a configurable timer event. The input (to slave) is on signals TIMx_ITR0/ITR1/ITR2.
The possible master/slave connections are given in:
- • Table 171: Internal trigger connection for advanced-control timers TIM1
- • Table 194: TIMx internal trigger connection for general-purpose timers TIM2/TIM3
Active power mode
Timers are optionally active in Run and Sleep modes. The effects of low-power modes on TIMx are given in:
14.3.2 Triggers to ADCs
From EXTI, timers (TIM1/TIM2/TIM3/TIM6/TIM7) and LP timers (LPTIM1/LPTIM2) to ADC1
Purpose
A conversion, or a sequence of conversions, can be triggered either by software or by an external event (such as timer output channel, timer trigger output or input pins with EXTI). For ADC1, if the EXTEN[1:0] control bits (for a regular conversion) or JEXTEN[1:0] bits (for an injected conversion) are different from 0b00, then external events can trigger a conversion with the selected polarity. More details in:
- • Section 19.4.18: Conversion on external trigger and trigger polarity (EXTSEL, EXTEN, JEXTSEL, JEXTEN)
- • EXTEN[1:0] defined in ADC configuration register (ADC_CFGR)
- • JEXTEN[1:0] defined in ADC injected sequence register (ADC_JSQR)
General-purpose timers (TIM2/TIM3), basic timer (TIM6), advanced-control timers (TIM1) can be used to generate the ADC triggering event through the timer outputs tim_oc and tim_trgo (TIMx synchronization described in Section 26.3.31: ADC triggers for TIM1)
The general-purpose timer TIM2, basic timers (TIM6), and advanced-control timers (TIM1) can be used to generate the ADC triggering event through the timer outputs tim_oc and tim_trgo. Low-power timers (LPTIM1/LPTIM2) can be used to generate the ADC triggering event through the LPTIM channels in addition to EXTI on channel 11 and 15.
Triggering signals
For ADC1, the input triggering signals and the description of the interconnection between ADC1, and timers, are given in:
- • Table 110: ADC interconnection
- • Section 19.4.18: Conversion on external trigger and trigger polarity (EXTSEL, EXTEN, JEXTSEL, JEXTEN)
- • Section 19.4.25: Timing diagrams example (single/continuous modes, hardware/software triggers)
Active power mode
This interconnection is active in Run and Sleep modes, assuming that its trigger event line is active as well. The timers are active in Run and Sleep mode only. The effects of low-power modes are given in:
- • Table 183: Effect of low-power modes on TIM1
- • Table 201: Effect of low-power modes on TIM2/TIM3
- • Table 222: Effect of low-power modes on the LPTIM
14.3.3 ADC analog watchdogs as triggers to timers
From ADC1 to TIM1
Purpose
The internal analog watchdog output signals coming from ADC1 is connected to on-chip timer. ADC1 can provide trigger event through analog watchdog signals to advanced-control timer (TIM1) in order to reset, start, stop or clock the counter.
Settings description of the ADC analog watchdog and timer trigger, are provided in:
- • Section 26.3.6: External trigger input for TIM1
- • Table 172: Interconnect to the tim_etr input multiplexer for the internal ADC1 sources connected to TIM1 (tim_etr) input multiplexer
- • Section 19.4.28: Analog window watchdog (AWD1EN, JAWD1EN, AWD1SGL, AWD1CH, AWD2CH, AWD3CH, AWD_HTx, AWD_LTx, AWDx) for the ADC1/ADC_AWDx signal output generation
Triggering signals
The output (from ADC) is on signals ADC_AWDx, with x = 1, 2, 3 (three watchdogs per ADC). The input (to timer) is on signal TIMx_ETR (external trigger).
Active power mode
ADC1 is active in Run and Sleep modes.
14.3.4 Triggers to DAC
From timer (TIM1/TIM2/TIM3/TIM6/TIM7), Low-power timers (LPTIM1/LPTIM2) and EXTI to DAC (DAC1/DAC2)
Purpose
General-purpose timers (TIM2/TIM3), basic timers (TIM6/TIM7), advanced-control timer (TIM1), LP timers (LPTIM1/LPTIM2) outputs channels (lptim1_ch1 and lptim2_ch1) and EXTI can be used as triggering event to start a DAC conversion.
Triggering signals
The output (from timer) on the TIMx_TRGO signal and from LP timers are directly connected to corresponding DAC inputs.
The selection of input triggers on DAC is provided in:
Active power mode
This interconnect is active in Run, Sleep, and Stop modes.
14.3.5 Triggers to DTS
From EXTI, LP timers (LPTIM1/LPTIM2) to DTS.
Purpose
A temperature measurement, can be triggered either by software, by LP timers, or by an external event.
Triggering signals
The input triggering signals and the description of the interconnection between DTS, and LP timers, are given in Table 125: Trigger configuration.
14.3.6 LP timer to LP timer connection
From LPTIM1 to LPTIM2 and from LPTIM2 to LPTIM1.
Purpose
LPTIM1 output channel can be used as clock source to increment the LPTIM2 counter through lptim2_in1_mux3 input.
LPTIM2 output channel can be used as clock source to increment the LPTIM1 counter through lptim1_in1_mux3 input.
Triggering signals
LPTIM1 output lptim1_ch2 is the input to lptim2_in1_mux3.
LPTIM2 output lptim2_ch2 is the input to lptim1_in1_mux3.
The LPTIM1/2 input1 connection is given in Table 215: LPTIM1/2 input 1 connections.
Active power mode
This feature is available under Run, Sleep and Stop modes.
14.3.7 Internal clock sources to timers
From HSE, LSE, LSI, CSI, HSI and MCO1/MCO2 to timers (TIM2/TIM3) and LP timers (LPTIM1/LPTIM2)
Purpose
A timer input or timer counter can receive different clock sources and can be used to calibrate internal oscillator on a reference clock for example.
External clocks (HSE, LSE), internal clocks (LSI, CSI, HSI) and microcontroller output clock (MCO1 and MCO2) can be used as input to timers:
- • HSE, LSE, CSI, HSI and LSI are assigned to general purpose timers TIM2/TIM3 as external inputs signals. CSI/HSI/LSI can be selected as counter clock provided by an external clock source in mode1 (tim_ti1 or tim_ti2 signals) and mode2 (external trigger input tim_etr_in). Inputs assignment and clock selection description are detailed in:
- – Section 27.4.5: Clock selection for TIM2/TIM3
- – External clock mode1: Table 190: Interconnect to the tim_ti1 input multiplexer for tim_ti1_in1 (LSI-TIM2), tim_ti1_in2 (LSE-TIM2), tim_ti1_in4 (RCC_HSE_1MHz-TIM3). Table 191: Interconnect to the tim_ti2 input multiplexer for tim_ti1_in1 (HSI/1024 -TIM2), tim_ti1_in2 (CSI/128 -TIM2), tim_ti1_in3 (HSI/1024 -TIM3), tim_ti1_in1 (CSI/128 -TIM3)
- – External clock mode2: Table 195: Interconnect to the tim_etr input multiplexer, tim_etr3 (LSE), for TIM2
- • Microcontroller output clock (MCO1/MCO2) is connected as external input to general-purpose timers TIM2/TIM3. This allows the calibration of the HSI/CSI system clocks (with TIM2 and LSE) or LSI (with TIM3 and HSE). This is also used to precisely
measure LSI or CSI (with TIM3 and HSI) oscillator frequency. When the low-speed external (LSE) oscillator is used, no additional hardware connections are required.
- • RCC_HSE_1MHz, LSI and LSE can be selected as input capture 2 to LPTIM1 as described in Table 218: LPTIM1/2 input capture 2 connections.
- • MCO1 and MCO2 can be selected as input capture 1 to LPTIM1 and LPTIM2 respectively as described in Table 215: LPTIM1/2 input 1 connections.
- • HSI/1024, CSI/128 and HSI/8 can be selected as input capture 2 to LPTIM2 as described in Table 218: LPTIM1/2 input capture 2 connections.
Triggering signals
lptim_ic2_mux1 LPTIM input capture selection can be set in the LPTIM configuration register 2 (LPTIM_CFGR2). For timers, the internal clock signal can be selected as counter clock provided by an external clock source in mode1 (tim_ti1_in) and mode2 (external trigger input tim_etr_in).
Active power mode
This feature is available under Run and Sleep modes.
14.3.8 Triggers to low-power timers
From comparator (COMP1), CPU (EVENTOUT), GPDMA1/2, TAMP and RTC alarm to LP timers (LPTIM1/LPTIM2)
Purpose
LPTIM1/LPTIM2 counters may be started either by software or after the detection of an active edge on one of the eight trigger inputs (see Section 29.4.7: Trigger multiplexer).
RTC alarm A/B, TAMP input detection, COMP1_OUT, GPDMA transfert complete, and CPU EVENTOUT can be used as trigger to start LPTIM counters (LPTIM1/2)..
Triggering signals
This trigger feature is described in and the following sections. The input selection is described in Table 214: LPTIM1/2 external trigger connections.
Active power mode
This interconnection remains active down to Stop mode.
14.3.9 RTC wakeup as inputs to timers
From RTC to timers (TIM2)
Purpose
RTC wakeup interrupt can be used as input to general-purpose timer (TIM2) channel 1.
Triggering signals
RTC wakeup signal is connected to tim_ti1_in3 signal as described in Table 190: Interconnect to the tim_ti1 input multiplexer for TIM2.
Active power mode
This interconnection is active down to Stop. Timers are not active but the count is performed at wakeup.
14.3.10 Blanking sources to comparator
From timers (TIM1/TIM2/TIM3) to comparator COMP1
Purpose
Advanced-control timer TIM1 and general-purpose timers (TIM2/TIM3) can be used as blanking window input to COMP1. The blanking function is described in Section 22.3.6: Comparator output blanking function.
The blanking sources are given in Comparator configuration register 1 (COMP_CFGR1), BLANKING[3:0].
Triggering signals
Timer output signal TIMx_Ocx are the inputs to blanking source of COMP1.
Active power mode
This feature is available under Run and Sleep modes.
14.3.11 Comparators as inputs, trigger or break signals to timers
From comparator COMP1 to timers (TIM1/TIM2/TIM3)
Purpose
The comparators (COMP1) output can be connected to timers (TIM1/TIM2/TIM3) input captures, TIMx_ETR or timer break signals. The connection to ETR is described in Section 26.3.6: External trigger input.
Comparators (COMP1) output values can also generate break input signals for timers (such TIM1). The sources for break (tim_brk) channel are one of the following:
- • external: connected to one of the TIMx_BKIN pin (as per selection done in the AFIO controller) with polarity selection and optional digital filtering
- • internal: coming from comparators, tim_brk_cmpx input (refer to Section 26.3.2: TIM1 pins and internal signals for product specific implementation).
Triggering signals
The tim_etr and tim_brk signals connected to TIM1 (coming from COMP1) are given in:
- • tim_etr (Table 172: Interconnect to the tim_etr input multiplexer): external trigger internal input bus
These inputs can be used as trigger, external clock or for hardware cycle-by-cycle pulse width control. - • tim_brk (Table 173: Timer break interconnect and Table 174: Timer break2 interconnect)
- • Section 26.3.6: External trigger input
- • Section 26.3.18: Using the break function
For TIM2/TIM3, the sources connected to the tim_ti[1..4] input multiplexers coming from comparators and some other peripherals, are given in:
- • Table 190: Interconnect to the
tim_ti1input multiplexer - • Table 191: Interconnect to the
tim_ti2input multiplexer - • Table 192: Interconnect to the
tim_ti3input multiplexer - • Table 193: Interconnect to the
tim_ti4input multiplexer - • Table 195: Interconnect to the
tim_etrinput multiplexer - • Section 27.4.22: Timers and external trigger synchronization
- • Section 27.5.26: TIMx timer input selection register (
TIMx_TISEL)(x = 2, 3)
Active power mode
Run, Sleep and wakeup capability in Stop mode for trigger sources. Input and break remain active in same low-power modes as timers activity, on Run and Sleep modes.
14.3.12 System errors as break signals to timers
From system errors to timers.
Purpose
CSS, CPU lockup, SRAM1/SRAM2 ECC double errors, FLASH ECC double-error detection and PVD can generate system errors in the form of timer break toward timer TIM1.
The purpose of the break function is to protect power switches driven by PWM signals generated by the timer.
See Section 13.5.11: SBS Class B register (SBS_CFGR2) for more details.
Triggering signals
The possible sources of break are described in:
- • Section 26.3.18: Using the break function for TIM1
- • Table 175: System break interconnect for TIM1
Active power mode
Timers are optionally active in Run and Sleep modes. The effects of low-power modes on TIMx are given in:
14.3.13 Triggers to GPDMA1/2
From EXTI, RTC (alarm/wakeup), TAMP, timers (TIM2), comparators (COMP1), GPDMA1/2 transfer complete (gpdma1_chx_tcf/gpdma2_chx_tcf), to GPDMA1/2.
Purpose
A GPDMA trigger can be assigned to a GPDMA channel x. A programmed GPDMA transfer can be triggered by a rising/falling edge of a selected input trigger event. The trigger mode
can also be programmed to condition the LLI link transfer. More details are given in the sections below:
- • Section 15.3.7: GPDMA triggers
- • Section 15.4.12: GPDMA triggered transfer
- • GPDMA channel x transfer register 2 (GPDMA_CxTR2) for more details on:
- – Trigger selection TRIGSEL[5:0] field
- – Trigger mode (LLI) defined by TRIGM[1:0].
- – Trigger polarity as defined by TRIGPOL[1:0]
Triggering signals
GPDMA trigger mapping is specified in Table 87: Programmed GPDMA1/2 request, according to GPDMA_CxTR2.TRIGSEL[5:0].
Active power mode
Assuming sources are active down to Sleep modes, this interconnection remains functional in Sleep mode.
Refer to:
14.3.14 Internal analog signals to analog peripherals
From internal analog source to ADC1, comparator COMP1 and OPAMP1
Purpose
The internal reference voltage (VREFINT), the internal temperature sensor (VSENSE) and VBAT monitoring channel are connected to ADC1 input channels. In addition, the internal digital core voltage (VCORE) is connected to ADC1 input channel.
DAC channels (DAC1_OUT/DAC2_OUT), VREFINT, VSENSE and VBAT monitoring channel are connected to comparator (COMP1).
OPAMP1 output can be connected to ADC1 input channel through the GPIO. DAC1_OUT1 can be connected to OPAMP1_VINP.
Refer to Table 131: DAC internal input/output signals for:
- • dac_out1 analog output DAC channel1, output, for on-chip peripherals
- • dac_out2 analog output DAC channel2, output, for on-chip peripherals
This is according:
- • Section 19.2: ADC main features
- • Section 19.4.11: Channel selection (SQRx, JSQRx)
- • Table 149: Possible connections for OPAMP
- • Section 22.3.2: COMP pins and internal signals
Active power mode
These interconnections remain in Stop modes if the selected peripheral is kept active. Refer to:
- • Section 22.4: COMP low-power modes
- • Section 23.4: OPAMP low-power modes
- • Section 21.5: DAC in low-power modes
14.3.15 Clock source for the DAC sample and hold mode
LSI/LSE to DAC1/DAC2
Purpose
DAC1/DAC2 can run in Stop mode. The sample and hold block and its associated registers use the LSI or LSE clock source (dac_hold_ck) in Stop mode.
Refer to Table 131: DAC internal input/output signals:
dac_hold_ck, Input, DAC low-power clock used in sample and hold mode
Active power mode
This feature remains available down to Stop mode.
14.3.16 Internal tamper sources
From internal peripherals, clocks or monitoring to tamper.
Purpose
In order to detect any abnormal activity or tentative to corrupt the device, tampers are introduced and alert the system of such undesired event. Different actions can be taken in consequences.
- • The backup domain voltage monitor can generate a tamper event when the battery voltage is above the functional range. Refer to Section 9.6.6: Backup domain voltage monitoring for more details.
- • The temperature monitor can generate a tamper event when the temperature is above or below the functional range. Refer to Section 9.6.7: Temperature monitoring for more details.
- • The clock security system on LSE can generate a tamper event in case of LSE failure detection (when the LSE disappears or in case of over frequency). Refer to Section 10.4.10: Clock security system (CSS) for more details
- • The clock security system on HSE can generate a tamper event in case of HSE failure detection (when the HSE disappears or in case of over frequency). Refer to Section 10.4.10: Clock security system (CSS) for more details
List of tamper sources can be found in Table 246: TAMP interconnection.
Active power mode
This interconnection is active in all power modes if the tamper source is activated.
14.3.17 Output from tamper to RTC
From TAMP to RTC
Purpose
The RTC can timestamp a tamper event in order to retrieve history in time of such detection. The RTC can also control GPIOs and set a signal based on tamp or alarm status outside the MCU.
Refer to Section 32.3.3: GPIOs controlled by the RTC and TAMP for more details.
Active power mode
This interconnection remains active in all power modes.