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)

SourceDestination
TIM1TIM2TIM3TIM6TIM7LPTIM1LPTIM2ADC1OPAMP1DAC1/2COMP1GPDMATAMPRTCDTS
TIM1-11----2-410----
TIM21-1----2-41013---
TIM311-----2-410----
TIM6-------2-4-----
TIM7-------2-4-----
LPTIM1------62-41013--5
LPTIM2-----6-2-41013--5
ADC13-----------16--
DAC1/2--------14-14----
OPAMP-------14-------
COMP1111111--88----13---
GPDMA1-----88----13---
GPDMA2-----88----13---
EXTI-------2-4-13--5
RTC wakeup-9---------13---
RTC alarm-----88----13---
RTC calendar overflow------------16--
TAMP-----88----13-17-
HSE--7--7---------
LSE-7---7---15-----
CSS on LSE------------16--
CSS on HSE12-----------16--
CSI777---7--------
HSI777---7--------
LSI-7---7---15-----
MCO1-77--7---------
Table 84. Peripherals interconnect matrix(1) (2) (continued)
SourceDestination
TIM1TIM2TIM3TIM6TIM7LPTIM1LPTIM2ADC1OPAMP1DAC1/2COMP1GPDMATAMPRTCDTS
MCO2-77---7--------
VCORE-------14-------
VREFINT-------14--14----
T sensor
(VSENSE)
-------14--14----
VBAT-------14--14----
VBAT and
temperature
monitor
------------16--
System errors12--------------
EVENTOUT-----88----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:

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:

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:

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:

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:

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:

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:

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.

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:

Triggering signals

The tim_etr and tim_brk signals connected to TIM1 (coming from COMP1) are given in:

For TIM2/TIM3, the sources connected to the tim_ti[1..4] input multiplexers coming from comparators and some other peripherals, are given in:

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:

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:

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:

This is according:

Active power mode

These interconnections remain in Stop modes if the selected peripheral is kept active. Refer to:

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.

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.