ST STM32F405 Series User manual

February 2019 RM0090 Rev 18 1/1749
1
RM0090
Reference manual
STM32F405/415, STM32F407/417, STM32F427/437 and
STM32F429/439 advanced Arm®-based 32-bit MCUs
Introduction
This reference manual targets application developers. It provides complete information on
how to use the STM32F405xx/07xx, STM32F415xx/17xx, STM32F42xxx and
STM32F43xxx microcontroller memory and peripherals.
The STM32F405xx/07xx, STM32F415xx/17xx, STM32F42xxx and STM32F43xxx constitute
a family of microcontrollers with different memory sizes, packages and peripherals.
For ordering information, mechanical and electrical device characteristics please refer to the
datasheets.
For information on the Arm®Cortex®-M4 with FPU core, please refer to the Cortex®-M4 with
FPU Technical Reference Manual.
Related documents
Available from STMicroelectronics web site (http://www.st.com):
•STM32F40x and STM32F41x datasheets
•STM32F42x and STM32F43x datasheets
•For information on the Arm®Cortex®-M4 with FPU, refer to the STM32F3xx/F4xxx
Cortex®-M4 with FPU programming manual (PM0214).
www.st.com

Contents RM0090
2/1749 RM0090 Rev 18
Contents
1 Documentation conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
1.1 List of abbreviations for registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
1.2 Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
1.3 Peripheral availability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
2 Memory and bus architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
2.1 System architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
2.1.1 I-bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
2.1.2 D-bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
2.1.3 S-bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
2.1.4 DMA memory bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
2.1.5 DMA peripheral bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
2.1.6 Ethernet DMA bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
2.1.7 USB OTG HS DMA bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
2.1.8 LCD-TFT controller DMA bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
2.1.9 DMA2D bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
2.1.10 BusMatrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
2.1.11 AHB/APB bridges (APB) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
2.2 Memory organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
2.3 Memory map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
2.3.1 Embedded SRAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
2.3.2 Flash memory overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
2.3.3 Bit banding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
2.4 Boot configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
3 Embedded Flash memory interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
3.2 Main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
3.3 Embedded Flash memory in
STM32F405xx/07xx and STM32F415xx/17xx . . . . . . . . . . . . . . . . . . . . . 74
3.4 Embedded Flash memory in STM32F42xxx and STM32F43xxx . . . . . . . 76
3.5 Read interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
3.5.1 Relation between CPU clock frequency and Flash memory read time . 80

RM0090 Rev 18 3/1749
RM0090 Contents
39
3.5.2 Adaptive real-time memory accelerator (ART Accelerator™) . . . . . . . . 82
3.6 Erase and program operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
3.6.1 Unlocking the Flash control register . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
3.6.2 Program/erase parallelism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
3.6.3 Erase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
3.6.4 Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
3.6.5 Read-while-write (RWW) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
3.6.6 Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
3.7 Option bytes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
3.7.1 Description of user option bytes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
3.7.2 Programming user option bytes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
3.7.3 Read protection (RDP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
3.7.4 Write protections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
3.7.5 Proprietary code readout protection (PCROP) . . . . . . . . . . . . . . . . . . . 95
3.8 One-time programmable bytes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
3.9 Flash interface registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
3.9.1 Flash access control register (FLASH_ACR)
for STM32F405xx/07xx and STM32F415xx/17xx . . . . . . . . . . . . . . . . . 98
3.9.2 Flash access control register (FLASH_ACR)
for STM32F42xxx and STM32F43xxx . . . . . . . . . . . . . . . . . . . . . . . . . . 99
3.9.3 Flash key register (FLASH_KEYR) . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
3.9.4 Flash option key register (FLASH_OPTKEYR) . . . . . . . . . . . . . . . . . . 100
3.9.5 Flash status register (FLASH_SR) for
STM32F405xx/07xx and STM32F415xx/17xx . . . . . . . . . . . . . . . . . . . 101
3.9.6 Flash status register (FLASH_SR) for
STM32F42xxx and STM32F43xxx . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
3.9.7 Flash control register (FLASH_CR) for
STM32F405xx/07xx and STM32F415xx/17xx . . . . . . . . . . . . . . . . . . . 103
3.9.8 Flash control register (FLASH_CR) for
STM32F42xxx and STM32F43xxx . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
3.9.9 Flash option control register (FLASH_OPTCR) for
STM32F405xx/07xx and STM32F415xx/17xx . . . . . . . . . . . . . . . . . . . 106
3.9.10 Flash option control register (FLASH_OPTCR)
for STM32F42xxx and STM32F43xxx . . . . . . . . . . . . . . . . . . . . . . . . . 108
3.9.11 Flash option control register (FLASH_OPTCR1)
for STM32F42xxx and STM32F43xxx . . . . . . . . . . . . . . . . . . . . . . . . . 110
3.9.12 Flash interface register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
4 CRC calculation unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113

Contents RM0090
4/1749 RM0090 Rev 18
4.1 CRC introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .113
4.2 CRC main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .113
4.3 CRC functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .114
4.4 CRC registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .114
4.4.1 Data register (CRC_DR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
4.4.2 Independent data register (CRC_IDR) . . . . . . . . . . . . . . . . . . . . . . . . 114
4.4.3 Control register (CRC_CR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
4.4.4 CRC register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
5 Power controller (PWR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
5.1 Power supplies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .116
5.1.1 Independent A/D converter supply and reference voltage . . . . . . . . . . 117
5.1.2 Battery backup domain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
5.1.3 Voltage regulator for STM32F405xx/07xx and STM32F415xx/17xx . . 120
5.1.4 Voltage regulator for STM32F42xxx and STM32F43xxx . . . . . . . . . . . 121
5.2 Power supply supervisor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
5.2.1 Power-on reset (POR)/power-down reset (PDR) . . . . . . . . . . . . . . . . . 124
5.2.2 Brownout reset (BOR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
5.2.3 Programmable voltage detector (PVD) . . . . . . . . . . . . . . . . . . . . . . . . 125
5.3 Low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
5.3.1 Slowing down system clocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
5.3.2 Peripheral clock gating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
5.3.3 Sleep mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
5.3.4 Stop mode (STM32F405xx/07xx and STM32F415xx/17xx) . . . . . . . . 130
5.3.5 Stop mode (STM32F42xxx and STM32F43xxx) . . . . . . . . . . . . . . . . . 133
5.3.6 Standby mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
5.3.7 Programming the RTC alternate functions to wake up the device from
the Stop and Standby modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
5.4 Power control registers (STM32F405xx/07xx and STM32F415xx/17xx) 141
5.4.1 PWR power control register (PWR_CR)
for STM32F405xx/07xx and STM32F415xx/17xx . . . . . . . . . . . . . . . . 141
5.4.2 PWR power control/status register (PWR_CSR)
for STM32F405xx/07xx and STM32F415xx/17xx . . . . . . . . . . . . . . . . 142
5.5 Power control registers (STM32F42xxx and STM32F43xxx) . . . . . . . . . 144
5.5.1 PWR power control register (PWR_CR)
for STM32F42xxx and STM32F43xxx . . . . . . . . . . . . . . . . . . . . . . . . . 144
5.5.2 PWR power control/status register (PWR_CSR)
for STM32F42xxx and STM32F43xxx . . . . . . . . . . . . . . . . . . . . . . . . . 147

RM0090 Rev 18 5/1749
RM0090 Contents
39
5.6 PWR register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
6 Reset and clock control for
STM32F42xxx and STM32F43xxx (RCC) . . . . . . . . . . . . . . . . . . . . . . . 150
6.1 Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
6.1.1 System reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
6.1.2 Power reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
6.1.3 Backup domain reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
6.2 Clocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
6.2.1 HSE clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
6.2.2 HSI clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
6.2.3 PLL configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
6.2.4 LSE clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
6.2.5 LSI clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
6.2.6 System clock (SYSCLK) selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
6.2.7 Clock security system (CSS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
6.2.8 RTC/AWU clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
6.2.9 Watchdog clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
6.2.10 Clock-out capability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
6.2.11 Internal/external clock measurement using TIM5/TIM11 . . . . . . . . . . . 158
6.3 RCC registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
6.3.1 RCC clock control register (RCC_CR) . . . . . . . . . . . . . . . . . . . . . . . . . 161
6.3.2 RCC PLL configuration register (RCC_PLLCFGR) . . . . . . . . . . . . . . . 163
6.3.3 RCC clock configuration register (RCC_CFGR) . . . . . . . . . . . . . . . . . 165
6.3.4 RCC clock interrupt register (RCC_CIR) . . . . . . . . . . . . . . . . . . . . . . . 167
6.3.5 RCC AHB1 peripheral reset register (RCC_AHB1RSTR) . . . . . . . . . . 170
6.3.6 RCC AHB2 peripheral reset register (RCC_AHB2RSTR) . . . . . . . . . . 173
6.3.7 RCC AHB3 peripheral reset register (RCC_AHB3RSTR) . . . . . . . . . . 174
6.3.8 RCC APB1 peripheral reset register (RCC_APB1RSTR) . . . . . . . . . . 174
6.3.9 RCC APB2 peripheral reset register (RCC_APB2RSTR) . . . . . . . . . . 178
6.3.10 RCC AHB1 peripheral clock register (RCC_AHB1ENR) . . . . . . . . . . . 180
6.3.11 RCC AHB2 peripheral clock enable register (RCC_AHB2ENR) . . . . . 182
6.3.12 RCC AHB3 peripheral clock enable register (RCC_AHB3ENR) . . . . . 183
6.3.13 RCC APB1 peripheral clock enable register (RCC_APB1ENR) . . . . . 183
6.3.14 RCC APB2 peripheral clock enable register (RCC_APB2ENR) . . . . . 187
6.3.15 RCC AHB1 peripheral clock enable in low power mode register
(RCC_AHB1LPENR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189

Contents RM0090
6/1749 RM0090 Rev 18
6.3.16 RCC AHB2 peripheral clock enable in low power mode register
(RCC_AHB2LPENR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
6.3.17 RCC AHB3 peripheral clock enable in low power mode register
(RCC_AHB3LPENR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
6.3.18 RCC APB1 peripheral clock enable in low power mode register
(RCC_APB1LPENR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
6.3.19 RCC APB2 peripheral clock enabled in low power mode register
(RCC_APB2LPENR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
6.3.20 RCC Backup domain control register (RCC_BDCR) . . . . . . . . . . . . . . 199
6.3.21 RCC clock control & status register (RCC_CSR) . . . . . . . . . . . . . . . . 200
6.3.22 RCC spread spectrum clock generation register (RCC_SSCGR) . . . . 202
6.3.23 RCC PLLI2S configuration register (RCC_PLLI2SCFGR) . . . . . . . . . 203
6.3.24 RCC PLL configuration register (RCC_PLLSAICFGR) . . . . . . . . . . . . 206
6.3.25 RCC Dedicated Clock Configuration Register (RCC_DCKCFGR) . . . 207
6.3.26 RCC register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
7 Reset and clock control for
STM32F405xx/07xx and STM32F415xx/17xx(RCC) . . . . . . . . . . . . . . 213
7.1 Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
7.1.1 System reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
7.1.2 Power reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
7.1.3 Backup domain reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
7.2 Clocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
7.2.1 HSE clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
7.2.2 HSI clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
7.2.3 PLL configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
7.2.4 LSE clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
7.2.5 LSI clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
7.2.6 System clock (SYSCLK) selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
7.2.7 Clock security system (CSS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
7.2.8 RTC/AWU clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
7.2.9 Watchdog clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
7.2.10 Clock-out capability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
7.2.11 Internal/external clock measurement using TIM5/TIM11 . . . . . . . . . . . 222
7.3 RCC registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
7.3.1 RCC clock control register (RCC_CR) . . . . . . . . . . . . . . . . . . . . . . . . . 224
7.3.2 RCC PLL configuration register (RCC_PLLCFGR) . . . . . . . . . . . . . . . 226
7.3.3 RCC clock configuration register (RCC_CFGR) . . . . . . . . . . . . . . . . . 228

RM0090 Rev 18 7/1749
RM0090 Contents
39
7.3.4 RCC clock interrupt register (RCC_CIR) . . . . . . . . . . . . . . . . . . . . . . . 230
7.3.5 RCC AHB1 peripheral reset register (RCC_AHB1RSTR) . . . . . . . . . . 233
7.3.6 RCC AHB2 peripheral reset register (RCC_AHB2RSTR) . . . . . . . . . . 236
7.3.7 RCC AHB3 peripheral reset register (RCC_AHB3RSTR) . . . . . . . . . . 237
7.3.8 RCC APB1 peripheral reset register (RCC_APB1RSTR) . . . . . . . . . . 237
7.3.9 RCC APB2 peripheral reset register (RCC_APB2RSTR) . . . . . . . . . . 240
7.3.10 RCC AHB1 peripheral clock enable register (RCC_AHB1ENR) . . . . . 242
7.3.11 RCC AHB2 peripheral clock enable register (RCC_AHB2ENR) . . . . . 244
7.3.12 RCC AHB3 peripheral clock enable register (RCC_AHB3ENR) . . . . . 245
7.3.13 RCC APB1 peripheral clock enable register
(RCC_APB1ENR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
7.3.14 RCC APB2 peripheral clock enable register (RCC_APB2ENR) . . . . . 248
7.3.15 RCC AHB1 peripheral clock enable in low power mode register
(RCC_AHB1LPENR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
7.3.16 RCC AHB2 peripheral clock enable in low power mode register
(RCC_AHB2LPENR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
7.3.17 RCC AHB3 peripheral clock enable in low power mode register
(RCC_AHB3LPENR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
7.3.18 RCC APB1 peripheral clock enable in low power mode register
(RCC_APB1LPENR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
7.3.19 RCC APB2 peripheral clock enabled in low power mode
register (RCC_APB2LPENR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
7.3.20 RCC Backup domain control register (RCC_BDCR) . . . . . . . . . . . . . . 259
7.3.21 RCC clock control & status register (RCC_CSR) . . . . . . . . . . . . . . . . 260
7.3.22 RCC spread spectrum clock generation register (RCC_SSCGR) . . . . 262
7.3.23 RCC PLLI2S configuration register (RCC_PLLI2SCFGR) . . . . . . . . . 263
7.3.24 RCC register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
8 General-purpose I/Os (GPIO) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
8.1 GPIO introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
8.2 GPIO main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
8.3 GPIO functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
8.3.1 General-purpose I/O (GPIO) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
8.3.2 I/O pin multiplexer and mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
8.3.3 I/O port control registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
8.3.4 I/O port data registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
8.3.5 I/O data bitwise handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
8.3.6 GPIO locking mechanism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
8.3.7 I/O alternate function input/output . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275

Contents RM0090
8/1749 RM0090 Rev 18
8.3.8 External interrupt/wakeup lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
8.3.9 Input configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
8.3.10 Output configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
8.3.11 Alternate function configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
8.3.12 Analog configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
8.3.13 Using the OSC32_IN/OSC32_OUT pins as GPIO PC14/PC15
port pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
8.3.14 Using the OSC_IN/OSC_OUT pins as GPIO PH0/PH1 port pins . . . . 278
8.3.15 Selection of RTC_AF1 and RTC_AF2 alternate functions . . . . . . . . . . 279
8.4 GPIO registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
8.4.1 GPIO port mode register (GPIOx_MODER) (x = A..I/J/K) . . . . . . . . . . 281
8.4.2 GPIO port output type register (GPIOx_OTYPER)
(x = A..I/J/K) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
8.4.3 GPIO port output speed register (GPIOx_OSPEEDR)
(x = A..I/J/K) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
8.4.4 GPIO port pull-up/pull-down register (GPIOx_PUPDR)
(x = A..I/J/K) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
8.4.5 GPIO port input data register (GPIOx_IDR) (x = A..I/J/K) . . . . . . . . . . 283
8.4.6 GPIO port output data register (GPIOx_ODR) (x = A..I/J/K) . . . . . . . . 283
8.4.7 GPIO port bit set/reset register (GPIOx_BSRR) (x = A..I/J/K) . . . . . . . 284
8.4.8 GPIO port configuration lock register (GPIOx_LCKR)
(x = A..I/J/K) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
8.4.9 GPIO alternate function low register (GPIOx_AFRL) (x = A..I/J/K) . . . 285
8.4.10 GPIO alternate function high register (GPIOx_AFRH)
(x = A..I/J) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
8.4.11 GPIO register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
9 System configuration controller (SYSCFG) . . . . . . . . . . . . . . . . . . . . 289
9.1 I/O compensation cell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
9.2 SYSCFG registers for STM32F405xx/07xx and STM32F415xx/17xx . . 289
9.2.1 SYSCFG memory remap register (SYSCFG_MEMRMP) . . . . . . . . . . 289
9.2.2 SYSCFG peripheral mode configuration register (SYSCFG_PMC) . . 290
9.2.3 SYSCFG external interrupt configuration register 1
(SYSCFG_EXTICR1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
9.2.4 SYSCFG external interrupt configuration register 2
(SYSCFG_EXTICR2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
9.2.5 SYSCFG external interrupt configuration register 3
(SYSCFG_EXTICR3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
9.2.6 SYSCFG external interrupt configuration register 4
(SYSCFG_EXTICR4) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293

RM0090 Rev 18 9/1749
RM0090 Contents
39
9.2.7 Compensation cell control register (SYSCFG_CMPCR) . . . . . . . . . . . 293
9.2.8 SYSCFG register maps for
STM32F405xx/07xx and STM32F415xx/17xx . . . . . . . . . . . . . . . . . . . 294
9.3 SYSCFG registers for STM32F42xxx and STM32F43xxx . . . . . . . . . . . 294
9.3.1 SYSCFG memory remap register (SYSCFG_MEMRMP) . . . . . . . . . . 294
9.3.2 SYSCFG peripheral mode configuration register (SYSCFG_PMC) . . 296
9.3.3 SYSCFG external interrupt configuration register 1
(SYSCFG_EXTICR1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
9.3.4 SYSCFG external interrupt configuration register 2
(SYSCFG_EXTICR2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
9.3.5 SYSCFG external interrupt configuration register 3
(SYSCFG_EXTICR3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
9.3.6 SYSCFG external interrupt configuration register 4
(SYSCFG_EXTICR4) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
9.3.7 Compensation cell control register (SYSCFG_CMPCR) . . . . . . . . . . . 300
9.3.8 SYSCFG register maps for STM32F42xxx and STM32F43xxx . . . . . . 301
10 DMA controller (DMA) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
10.1 DMA introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
10.2 DMA main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
10.3 DMA functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
10.3.1 General description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
10.3.2 DMA transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
10.3.3 Channel selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
10.3.4 Arbiter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
10.3.5 DMA streams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309
10.3.6 Source, destination and transfer modes . . . . . . . . . . . . . . . . . . . . . . . 309
10.3.7 Pointer incrementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
10.3.8 Circular mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
10.3.9 Double buffer mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
10.3.10 Programmable data width, packing/unpacking, endianess . . . . . . . . . 314
10.3.11 Single and burst transfers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
10.3.12 FIFO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
10.3.13 DMA transfer completion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
10.3.14 DMA transfer suspension . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
10.3.15 Flow controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
10.3.16 Summary of the possible DMA configurations . . . . . . . . . . . . . . . . . . . 322
10.3.17 Stream configuration procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322

Contents RM0090
10/1749 RM0090 Rev 18
10.3.18 Error management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
10.4 DMA interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324
10.5 DMA registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
10.5.1 DMA low interrupt status register (DMA_LISR) . . . . . . . . . . . . . . . . . . 325
10.5.2 DMA high interrupt status register (DMA_HISR) . . . . . . . . . . . . . . . . . 326
10.5.3 DMA low interrupt flag clear register (DMA_LIFCR) . . . . . . . . . . . . . . 327
10.5.4 DMA high interrupt flag clear register (DMA_HIFCR) . . . . . . . . . . . . . 327
10.5.5 DMA stream x configuration register (DMA_SxCR) (x = 0..7) . . . . . . . 328
10.5.6 DMA stream x number of data register (DMA_SxNDTR) (x = 0..7) . . . 331
10.5.7 DMA stream x peripheral address register (DMA_SxPAR) (x = 0..7) . 332
10.5.8 DMA stream x memory 0 address register (DMA_SxM0AR) (x = 0..7) 332
10.5.9 DMA stream x memory 1 address register (DMA_SxM1AR) (x = 0..7) 332
10.5.10 DMA stream x FIFO control register (DMA_SxFCR) (x = 0..7) . . . . . . 333
10.5.11 DMA register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
11 Chrom-Art Accelerator™ controller (DMA2D) . . . . . . . . . . . . . . . . . . 339
11.1 DMA2D introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
11.2 DMA2D main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
11.3 DMA2D functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
11.3.1 General description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
11.3.2 DMA2D control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341
11.3.3 DMA2D foreground and background FIFOs . . . . . . . . . . . . . . . . . . . . 341
11.3.4 DMA2D foreground and background pixel format converter (PFC) . . . 342
11.3.5 DMA2D foreground and background CLUT interface . . . . . . . . . . . . . 344
11.3.6 DMA2D blender . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
11.3.7 DMA2D output PFC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
11.3.8 DMA2D output FIFO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346
11.3.9 DMA2D AHB master port timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346
11.3.10 DMA2D transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
11.3.11 DMA2D configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
11.3.12 DMA2D transfer control (start, suspend, abort and completion) . . . . . 350
11.3.13 Watermark . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
11.3.14 Error management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
11.3.15 AHB dead time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
11.4 DMA2D interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
11.5 DMA2D registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352

RM0090 Rev 18 11/1749
RM0090 Contents
39
11.5.1 DMA2D control register (DMA2D_CR) . . . . . . . . . . . . . . . . . . . . . . . . 352
11.5.2 DMA2D Interrupt Status Register (DMA2D_ISR) . . . . . . . . . . . . . . . . 354
11.5.3 DMA2D interrupt flag clear register (DMA2D_IFCR) . . . . . . . . . . . . . . 355
11.5.4 DMA2D foreground memory address register (DMA2D_FGMAR) . . . 356
11.5.5 DMA2D foreground offset register (DMA2D_FGOR) . . . . . . . . . . . . . . 356
11.5.6 DMA2D background memory address register (DMA2D_BGMAR) . . 357
11.5.7 DMA2D background offset register (DMA2D_BGOR) . . . . . . . . . . . . . 357
11.5.8 DMA2D foreground PFC control register (DMA2D_FGPFCCR) . . . . . 358
11.5.9 DMA2D foreground color register (DMA2D_FGCOLR) . . . . . . . . . . . . 360
11.5.10 DMA2D background PFC control register (DMA2D_BGPFCCR) . . . . 361
11.5.11 DMA2D background color register (DMA2D_BGCOLR) . . . . . . . . . . . 363
11.5.12 DMA2D foreground CLUT memory address register
(DMA2D_FGCMAR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
11.5.13 DMA2D background CLUT memory address register
(DMA2D_BGCMAR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
11.5.14 DMA2D output PFC control register (DMA2D_OPFCCR) . . . . . . . . . . 364
11.5.15 DMA2D output color register (DMA2D_OCOLR) . . . . . . . . . . . . . . . . . 365
11.5.16 DMA2D output memory address register (DMA2D_OMAR) . . . . . . . . 366
11.5.17 DMA2D output offset register (DMA2D_OOR) . . . . . . . . . . . . . . . . . . 367
11.5.18 DMA2D number of line register (DMA2D_NLR) . . . . . . . . . . . . . . . . . 367
11.5.19 DMA2D line watermark register (DMA2D_LWR) . . . . . . . . . . . . . . . . . 368
11.5.20 DMA2D AHB master timer configuration register (DMA2D_AMTCR) . 368
11.5.21 DMA2D register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
12 Interrupts and events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
12.1 Nested vectored interrupt controller (NVIC) . . . . . . . . . . . . . . . . . . . . . . 371
12.1.1 NVIC features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
12.1.2 SysTick calibration value register . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
12.1.3 Interrupt and exception vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
12.2 External interrupt/event controller (EXTI) . . . . . . . . . . . . . . . . . . . . . . . . 371
12.2.1 EXTI main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
12.2.2 EXTI block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
12.2.3 Wakeup event management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
12.2.4 Functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
12.2.5 External interrupt/event line mapping . . . . . . . . . . . . . . . . . . . . . . . . . 382
12.3 EXTI registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384
12.3.1 Interrupt mask register (EXTI_IMR) . . . . . . . . . . . . . . . . . . . . . . . . . . . 384

Contents RM0090
12/1749 RM0090 Rev 18
12.3.2 Event mask register (EXTI_EMR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384
12.3.3 Rising trigger selection register (EXTI_RTSR) . . . . . . . . . . . . . . . . . . 385
12.3.4 Falling trigger selection register (EXTI_FTSR) . . . . . . . . . . . . . . . . . . 385
12.3.5 Software interrupt event register (EXTI_SWIER) . . . . . . . . . . . . . . . . 386
12.3.6 Pending register (EXTI_PR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386
12.3.7 EXTI register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387
13 Analog-to-digital converter (ADC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388
13.1 ADC introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388
13.2 ADC main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388
13.3 ADC functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389
13.3.1 ADC on-off control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390
13.3.2 ADC clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390
13.3.3 Channel selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390
13.3.4 Single conversion mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391
13.3.5 Continuous conversion mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392
13.3.6 Timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392
13.3.7 Analog watchdog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392
13.3.8 Scan mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393
13.3.9 Injected channel management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394
13.3.10 Discontinuous mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
13.4 Data alignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
13.5 Channel-wise programmable sampling time . . . . . . . . . . . . . . . . . . . . . 397
13.6 Conversion on external trigger and trigger polarity . . . . . . . . . . . . . . . . 397
13.7 Fast conversion mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
13.8 Data management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
13.8.1 Using the DMA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
13.8.2 Managing a sequence of conversions without using the DMA . . . . . . 400
13.8.3 Conversions without DMA and without overrun detection . . . . . . . . . . 401
13.9 Multi ADC mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401
13.9.1 Injected simultaneous mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
13.9.2 Regular simultaneous mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
13.9.3 Interleaved mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
13.9.4 Alternate trigger mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408
13.9.5 Combined regular/injected simultaneous mode . . . . . . . . . . . . . . . . . . 410
13.9.6 Combined regular simultaneous + alternate trigger mode . . . . . . . . . . 411

RM0090 Rev 18 13/1749
RM0090 Contents
39
13.10 Temperature sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412
13.11 Battery charge monitoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414
13.12 ADC interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414
13.13 ADC registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
13.13.1 ADC status register (ADC_SR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
13.13.2 ADC control register 1 (ADC_CR1) . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
13.13.3 ADC control register 2 (ADC_CR2) . . . . . . . . . . . . . . . . . . . . . . . . . . . 418
13.13.4 ADC sample time register 1 (ADC_SMPR1) . . . . . . . . . . . . . . . . . . . . 420
13.13.5 ADC sample time register 2 (ADC_SMPR2) . . . . . . . . . . . . . . . . . . . . 420
13.13.6 ADC injected channel data offset register x (ADC_JOFRx) (x=1..4) . . 421
13.13.7 ADC watchdog higher threshold register (ADC_HTR) . . . . . . . . . . . . . 421
13.13.8 ADC watchdog lower threshold register (ADC_LTR) . . . . . . . . . . . . . . 422
13.13.9 ADC regular sequence register 1 (ADC_SQR1) . . . . . . . . . . . . . . . . . 422
13.13.10 ADC regular sequence register 2 (ADC_SQR2) . . . . . . . . . . . . . . . . . 423
13.13.11 ADC regular sequence register 3 (ADC_SQR3) . . . . . . . . . . . . . . . . . 423
13.13.12 ADC injected sequence register (ADC_JSQR) . . . . . . . . . . . . . . . . . . 424
13.13.13 ADC injected data register x (ADC_JDRx) (x= 1..4) . . . . . . . . . . . . . . 425
13.13.14 ADC regular data register (ADC_DR) . . . . . . . . . . . . . . . . . . . . . . . . . 425
13.13.15 ADC Common status register (ADC_CSR) . . . . . . . . . . . . . . . . . . . . . 426
13.13.16 ADC common control register (ADC_CCR) . . . . . . . . . . . . . . . . . . . . . 427
13.13.17 ADC common regular data register for dual and triple modes
(ADC_CDR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430
13.13.18 ADC register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430
14 Digital-to-analog converter (DAC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433
14.1 DAC introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433
14.2 DAC main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433
14.3 DAC functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
14.3.1 DAC channel enable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
14.3.2 DAC output buffer enable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
14.3.3 DAC data format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
14.3.4 DAC conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436
14.3.5 DAC output voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
14.3.6 DAC trigger selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
14.3.7 DMA request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438
14.3.8 Noise generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438
14.3.9 Triangle-wave generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439

Contents RM0090
14/1749 RM0090 Rev 18
14.4 Dual DAC channel conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440
14.4.1 Independent trigger without wave generation . . . . . . . . . . . . . . . . . . . 441
14.4.2 Independent trigger with single LFSR generation . . . . . . . . . . . . . . . . 441
14.4.3 Independent trigger with different LFSR generation . . . . . . . . . . . . . . 441
14.4.4 Independent trigger with single triangle generation . . . . . . . . . . . . . . . 442
14.4.5 Independent trigger with different triangle generation . . . . . . . . . . . . . 442
14.4.6 Simultaneous software start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442
14.4.7 Simultaneous trigger without wave generation . . . . . . . . . . . . . . . . . . 443
14.4.8 Simultaneous trigger with single LFSR generation . . . . . . . . . . . . . . . 443
14.4.9 Simultaneous trigger with different LFSR generation . . . . . . . . . . . . . 443
14.4.10 Simultaneous trigger with single triangle generation . . . . . . . . . . . . . . 444
14.4.11 Simultaneous trigger with different triangle generation . . . . . . . . . . . . 444
14.5 DAC registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
14.5.1 DAC control register (DAC_CR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
14.5.2 DAC software trigger register (DAC_SWTRIGR) . . . . . . . . . . . . . . . . 448
14.5.3 DAC channel1 12-bit right-aligned data holding register
(DAC_DHR12R1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448
14.5.4 DAC channel1 12-bit left aligned data holding register
(DAC_DHR12L1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449
14.5.5 DAC channel1 8-bit right aligned data holding register
(DAC_DHR8R1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449
14.5.6 DAC channel2 12-bit right aligned data holding register
(DAC_DHR12R2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 450
14.5.7 DAC channel2 12-bit left aligned data holding register
(DAC_DHR12L2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 450
14.5.8 DAC channel2 8-bit right-aligned data holding register
(DAC_DHR8R2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 450
14.5.9 Dual DAC 12-bit right-aligned data holding register
(DAC_DHR12RD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
14.5.10 DUAL DAC 12-bit left aligned data holding register
(DAC_DHR12LD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
14.5.11 DUAL DAC 8-bit right aligned data holding register
(DAC_DHR8RD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452
14.5.12 DAC channel1 data output register (DAC_DOR1) . . . . . . . . . . . . . . . . 452
14.5.13 DAC channel2 data output register (DAC_DOR2) . . . . . . . . . . . . . . . . 452
14.5.14 DAC status register (DAC_SR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453
14.5.15 DAC register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453
15 Digital camera interface (DCMI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455

RM0090 Rev 18 15/1749
RM0090 Contents
39
15.1 DCMI introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455
15.2 DCMI main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455
15.3 DCMI pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455
15.4 DCMI clocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455
15.5 DCMI functional overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456
15.5.1 DMA interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457
15.5.2 DCMI physical interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457
15.5.3 Synchronization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459
15.5.4 Capture modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462
15.5.5 Crop feature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463
15.5.6 JPEG format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465
15.5.7 FIFO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465
15.6 Data format description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465
15.6.1 Data formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465
15.6.2 Monochrome format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 466
15.6.3 RGB format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 466
15.6.4 YCbCr format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 466
15.7 DCMI interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467
15.8 DCMI register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467
15.8.1 DCMI control register 1 (DCMI_CR) . . . . . . . . . . . . . . . . . . . . . . . . . . 467
15.8.2 DCMI status register (DCMI_SR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470
15.8.3 DCMI raw interrupt status register (DCMI_RIS) . . . . . . . . . . . . . . . . . 471
15.8.4 DCMI interrupt enable register (DCMI_IER) . . . . . . . . . . . . . . . . . . . . 472
15.8.5 DCMI masked interrupt status register (DCMI_MIS) . . . . . . . . . . . . . . 473
15.8.6 DCMI interrupt clear register (DCMI_ICR) . . . . . . . . . . . . . . . . . . . . . . 474
15.8.7 DCMI embedded synchronization code register (DCMI_ESCR) . . . . . 475
15.8.8 DCMI embedded synchronization unmask register (DCMI_ESUR) . . 476
15.8.9 DCMI crop window start (DCMI_CWSTRT) . . . . . . . . . . . . . . . . . . . . . 477
15.8.10 DCMI crop window size (DCMI_CWSIZE) . . . . . . . . . . . . . . . . . . . . . . 477
15.8.11 DCMI data register (DCMI_DR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 478
15.8.12 DCMI register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 478
16 LCD-TFT controller (LTDC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480
16.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480
16.2 LTDC main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480
16.3 LTDC functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481

Contents RM0090
16/1749 RM0090 Rev 18
16.3.1 LTDC block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
16.3.2 LTDC reset and clocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
16.3.3 LCD-TFT pins and signal interface . . . . . . . . . . . . . . . . . . . . . . . . . . . 483
16.4 LTDC programmable parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483
16.4.1 LTDC Global configuration parameters . . . . . . . . . . . . . . . . . . . . . . . . 483
16.4.2 Layer programmable parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . 486
16.5 LTDC interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 490
16.6 LTDC programming procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492
16.7 LTDC registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493
16.7.1 LTDC Synchronization Size Configuration Register (LTDC_SSCR) . . 493
16.7.2 LTDC Back Porch Configuration Register (LTDC_BPCR) . . . . . . . . . . 493
16.7.3 LTDC Active Width Configuration Register (LTDC_AWCR) . . . . . . . . . 494
16.7.4 LTDC Total Width Configuration Register (LTDC_TWCR) . . . . . . . . . . 495
16.7.5 LTDC Global Control Register (LTDC_GCR) . . . . . . . . . . . . . . . . . . . . 495
16.7.6 LTDC Shadow Reload Configuration Register (LTDC_SRCR) . . . . . . 497
16.7.7 LTDC Background Color Configuration Register (LTDC_BCCR) . . . . 497
16.7.8 LTDC Interrupt Enable Register (LTDC_IER) . . . . . . . . . . . . . . . . . . . 498
16.7.9 LTDC Interrupt Status Register (LTDC_ISR) . . . . . . . . . . . . . . . . . . . . 499
16.7.10 LTDC Interrupt Clear Register (LTDC_ICR) . . . . . . . . . . . . . . . . . . . . . 499
16.7.11 LTDC Line Interrupt Position Configuration Register (LTDC_LIPCR) . 500
16.7.12 LTDC Current Position Status Register (LTDC_CPSR) . . . . . . . . . . . . 500
16.7.13 LTDC Current Display Status Register (LTDC_CDSR) . . . . . . . . . . . . 501
16.7.14 LTDC Layerx Control Register (LTDC_LxCR) (where x=1..2) . . . . . . . 502
16.7.15 LTDC Layerx Window Horizontal Position Configuration Register
(LTDC_LxWHPCR) (where x=1..2) . . . . . . . . . . . . . . . . . . . . . . . . . . . 503
16.7.16 LTDC Layerx Window Vertical Position Configuration Register
(LTDC_LxWVPCR) (where x=1..2) . . . . . . . . . . . . . . . . . . . . . . . . . . . 504
16.7.17 LTDC Layerx Color Keying Configuration Register (LTDC_LxCKCR)
(where x=1..2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
16.7.18 LTDC Layerx Pixel Format Configuration Register (LTDC_LxPFCR)
(where x=1..2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
16.7.19 LTDC Layerx Constant Alpha Configuration Register (LTDC_LxCACR)
(where x=1..2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 506
16.7.20 LTDC Layerx Default Color Configuration Register (LTDC_LxDCCR)
(where x=1..2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 506
16.7.21 LTDC Layerx Blending Factors Configuration Register (LTDC_LxBFCR)
(where x=1..2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 508
16.7.22 LTDC Layerx Color Frame Buffer Address Register (LTDC_LxCFBAR)
(where x=1..2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 509

RM0090 Rev 18 17/1749
RM0090 Contents
39
16.7.23 LTDC Layerx Color Frame Buffer Length Register (LTDC_LxCFBLR)
(where x=1..2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 509
16.7.24 LTDC Layerx ColorFrame Buffer Line Number Register
(LTDC_LxCFBLNR) (where x=1..2) . . . . . . . . . . . . . . . . . . . . . . . . . . . 510
16.7.25 LTDC Layerx CLUT Write Register (LTDC_LxCLUTWR)
(where x=1..2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 511
16.7.26 LTDC register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 512
17 Advanced-control timers (TIM1 and TIM8) . . . . . . . . . . . . . . . . . . . . . 515
17.1 TIM1 and TIM8 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515
17.2 TIM1 and TIM8 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516
17.3 TIM1 and TIM8 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . 518
17.3.1 Time-base unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518
17.3.2 Counter modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 520
17.3.3 Repetition counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 529
17.3.4 Clock selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 532
17.3.5 Capture/compare channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535
17.3.6 Input capture mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 538
17.3.7 PWM input mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539
17.3.8 Forced output mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539
17.3.9 Output compare mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 540
17.3.10 PWM mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541
17.3.11 Complementary outputs and dead-time insertion . . . . . . . . . . . . . . . . 544
17.3.12 Using the break function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 546
17.3.13 Clearing the OCxREF signal on an external event . . . . . . . . . . . . . . . 549
17.3.14 6-step PWM generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 550
17.3.15 One-pulse mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 551
17.3.16 Encoder interface mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 552
17.3.17 Timer input XOR function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 555
17.3.18 Interfacing with Hall sensors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 555
17.3.19 TIMx and external trigger synchronization . . . . . . . . . . . . . . . . . . . . . . 557
17.3.20 Timer synchronization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 560
17.3.21 Debug mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 560
17.4 TIM1 and TIM8 registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 561
17.4.1 TIM1 and TIM8 control register 1 (TIMx_CR1) . . . . . . . . . . . . . . . . . . 561
17.4.2 TIM1 and TIM8 control register 2 (TIMx_CR2) . . . . . . . . . . . . . . . . . . 562
17.4.3 TIM1 and TIM8 slave mode control register (TIMx_SMCR) . . . . . . . . 565
17.4.4 TIM1 and TIM8 DMA/interrupt enable register (TIMx_DIER) . . . . . . . . 567

Contents RM0090
18/1749 RM0090 Rev 18
17.4.5 TIM1 and TIM8 status register (TIMx_SR) . . . . . . . . . . . . . . . . . . . . . . 569
17.4.6 TIM1 and TIM8 event generation register (TIMx_EGR) . . . . . . . . . . . . 570
17.4.7 TIM1 and TIM8 capture/compare mode register 1 (TIMx_CCMR1) . . 572
17.4.8 TIM1 and TIM8 capture/compare mode register 2 (TIMx_CCMR2) . . 575
17.4.9 TIM1 and TIM8 capture/compare enable register (TIMx_CCER) . . . . 576
17.4.10 TIM1 and TIM8 counter (TIMx_CNT) . . . . . . . . . . . . . . . . . . . . . . . . . . 580
17.4.11 TIM1 and TIM8 prescaler (TIMx_PSC) . . . . . . . . . . . . . . . . . . . . . . . . 580
17.4.12 TIM1 and TIM8 auto-reload register (TIMx_ARR) . . . . . . . . . . . . . . . . 580
17.4.13 TIM1 and TIM8 repetition counter register (TIMx_RCR) . . . . . . . . . . . 581
17.4.14 TIM1 and TIM8 capture/compare register 1 (TIMx_CCR1) . . . . . . . . . 581
17.4.15 TIM1 and TIM8 capture/compare register 2 (TIMx_CCR2) . . . . . . . . . 582
17.4.16 TIM1 and TIM8 capture/compare register 3 (TIMx_CCR3) . . . . . . . . . 582
17.4.17 TIM1 and TIM8 capture/compare register 4 (TIMx_CCR4) . . . . . . . . . 583
17.4.18 TIM1 and TIM8 break and dead-time register (TIMx_BDTR) . . . . . . . 583
17.4.19 TIM1 and TIM8 DMA control register (TIMx_DCR) . . . . . . . . . . . . . . . 585
17.4.20 TIM1 and TIM8 DMA address for full transfer (TIMx_DMAR) . . . . . . . 586
17.4.21 TIM1 and TIM8 register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 587
18 General-purpose timers (TIM2 to TIM5) . . . . . . . . . . . . . . . . . . . . . . . . 589
18.1 TIM2 to TIM5 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 589
18.2 TIM2 to TIM5 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 589
18.3 TIM2 to TIM5 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . 591
18.3.1 Time-base unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 591
18.3.2 Counter modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 592
18.3.3 Clock selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 602
18.3.4 Capture/compare channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 605
18.3.5 Input capture mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 607
18.3.6 PWM input mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 608
18.3.7 Forced output mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 609
18.3.8 Output compare mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 609
18.3.9 PWM mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 610
18.3.10 One-pulse mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 613
18.3.11 Clearing the OCxREF signal on an external event . . . . . . . . . . . . . . . 614
18.3.12 Encoder interface mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 615
18.3.13 Timer input XOR function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 618
18.3.14 Timers and external trigger synchronization . . . . . . . . . . . . . . . . . . . . 618
18.3.15 Timer synchronization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 621

RM0090 Rev 18 19/1749
RM0090 Contents
39
18.3.16 Debug mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 626
18.4 TIM2 to TIM5 registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 627
18.4.1 TIMx control register 1 (TIMx_CR1) . . . . . . . . . . . . . . . . . . . . . . . . . . 627
18.4.2 TIMx control register 2 (TIMx_CR2) . . . . . . . . . . . . . . . . . . . . . . . . . . 629
18.4.3 TIMx slave mode control register (TIMx_SMCR) . . . . . . . . . . . . . . . . . 630
18.4.4 TIMx DMA/Interrupt enable register (TIMx_DIER) . . . . . . . . . . . . . . . . 632
18.4.5 TIMx status register (TIMx_SR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 633
18.4.6 TIMx event generation register (TIMx_EGR) . . . . . . . . . . . . . . . . . . . . 635
18.4.7 TIMx capture/compare mode register 1 (TIMx_CCMR1) . . . . . . . . . . . 636
18.4.8 TIMx capture/compare mode register 2 (TIMx_CCMR2) . . . . . . . . . . . 639
18.4.9 TIMx capture/compare enable register (TIMx_CCER) . . . . . . . . . . . . 640
18.4.10 TIMx counter (TIMx_CNT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 642
18.4.11 TIMx prescaler (TIMx_PSC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 642
18.4.12 TIMx auto-reload register (TIMx_ARR) . . . . . . . . . . . . . . . . . . . . . . . . 642
18.4.13 TIMx capture/compare register 1 (TIMx_CCR1) . . . . . . . . . . . . . . . . . 643
18.4.14 TIMx capture/compare register 2 (TIMx_CCR2) . . . . . . . . . . . . . . . . . 643
18.4.15 TIMx capture/compare register 3 (TIMx_CCR3) . . . . . . . . . . . . . . . . . 644
18.4.16 TIMx capture/compare register 4 (TIMx_CCR4) . . . . . . . . . . . . . . . . . 644
18.4.17 TIMx DMA control register (TIMx_DCR) . . . . . . . . . . . . . . . . . . . . . . . 645
18.4.18 TIMx DMA address for full transfer (TIMx_DMAR) . . . . . . . . . . . . . . . 646
18.4.19 TIM2 option register (TIM2_OR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 647
18.4.20 TIM5 option register (TIM5_OR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 647
18.4.21 TIMx register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 648
19 General-purpose timers (TIM9 to TIM14) . . . . . . . . . . . . . . . . . . . . . . . 650
19.1 TIM9 to TIM14 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 650
19.2 TIM9 to TIM14 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 650
19.2.1 TIM9/TIM12 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 650
19.2.2 TIM10/TIM11 and TIM13/TIM14 main features . . . . . . . . . . . . . . . . . . 651
19.3 TIM9 to TIM14 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . 653
19.3.1 Time-base unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 653
19.3.2 Counter modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 655
19.3.3 Clock selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 658
19.3.4 Capture/compare channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 660
19.3.5 Input capture mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 661
19.3.6 PWM input mode (only for TIM9/12) . . . . . . . . . . . . . . . . . . . . . . . . . . 663
19.3.7 Forced output mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 664

Contents RM0090
20/1749 RM0090 Rev 18
19.3.8 Output compare mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 664
19.3.9 PWM mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 665
19.3.10 One-pulse mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 666
19.3.11 TIM9/12 external trigger synchronization . . . . . . . . . . . . . . . . . . . . . . . 668
19.3.12 Timer synchronization (TIM9/12) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 671
19.3.13 Debug mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 671
19.4 TIM9 and TIM12 registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 672
19.4.1 TIM9/12 control register 1 (TIMx_CR1) . . . . . . . . . . . . . . . . . . . . . . . . 672
19.4.2 TIM9/12 slave mode control register (TIMx_SMCR) . . . . . . . . . . . . . . 673
19.4.3 TIM9/12 Interrupt enable register (TIMx_DIER) . . . . . . . . . . . . . . . . . 674
19.4.4 TIM9/12 status register (TIMx_SR) . . . . . . . . . . . . . . . . . . . . . . . . . . . 676
19.4.5 TIM9/12 event generation register (TIMx_EGR) . . . . . . . . . . . . . . . . . 677
19.4.6 TIM9/12 capture/compare mode register 1 (TIMx_CCMR1) . . . . . . . . 678
19.4.7 TIM9/12 capture/compare enable register (TIMx_CCER) . . . . . . . . . . 681
19.4.8 TIM9/12 counter (TIMx_CNT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 682
19.4.9 TIM9/12 prescaler (TIMx_PSC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 682
19.4.10 TIM9/12 auto-reload register (TIMx_ARR) . . . . . . . . . . . . . . . . . . . . . 682
19.4.11 TIM9/12 capture/compare register 1 (TIMx_CCR1) . . . . . . . . . . . . . . 683
19.4.12 TIM9/12 capture/compare register 2 (TIMx_CCR2) . . . . . . . . . . . . . . 683
19.4.13 TIM9/12 register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 684
19.5 TIM10/11/13/14 registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 686
19.5.1 TIM10/11/13/14 control register 1 (TIMx_CR1) . . . . . . . . . . . . . . . . . . 686
19.5.2 TIM10/11/13/14 Interrupt enable register (TIMx_DIER) . . . . . . . . . . . . 687
19.5.3 TIM10/11/13/14 status register (TIMx_SR) . . . . . . . . . . . . . . . . . . . . . 687
19.5.4 TIM10/11/13/14 event generation register (TIMx_EGR) . . . . . . . . . . . 688
19.5.5 TIM10/11/13/14 capture/compare mode register 1 (TIMx_CCMR1) . . 688
19.5.6 TIM10/11/13/14 capture/compare enable register (TIMx_CCER) . . . . 691
19.5.7 TIM10/11/13/14 counter (TIMx_CNT) . . . . . . . . . . . . . . . . . . . . . . . . . 692
19.5.8 TIM10/11/13/14 prescaler (TIMx_PSC) . . . . . . . . . . . . . . . . . . . . . . . . 692
19.5.9 TIM10/11/13/14 auto-reload register (TIMx_ARR) . . . . . . . . . . . . . . . . 692
19.5.10 TIM10/11/13/14 capture/compare register 1 (TIMx_CCR1) . . . . . . . . . 693
19.5.11 TIM11 option register 1 (TIM11_OR) . . . . . . . . . . . . . . . . . . . . . . . . . . 693
19.5.12 TIM10/11/13/14 register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 694
20 Basic timers (TIM6 and TIM7) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 696
20.1 TIM6 and TIM7 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 696
20.2 TIM6 and TIM7 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 696
This manual suits for next models
12
Table of contents
Other ST Computer Hardware manuals

ST
ST X-NUCLEO-NFC01A1 User manual

ST
ST X-NUCLEO-IHM08M1 User manual

ST
ST X-NUCLEO-IKA01A1 User manual

ST
ST STM32 Nucleo User manual

ST
ST X-NUCLEO-53L8A1 User manual

ST
ST UM2727 User manual

ST
ST METERS AND MORE UM2241 User manual

ST
ST X-NUCLEO-IHM02A1 User manual

ST
ST X-NUCLEO-SNK1M1 User manual

ST
ST STEVAL-MKI015V1 Quick start guide

ST
ST STM32Cube User manual

ST
ST TIP120 User manual

ST
ST 32F412GDISCOVERY User manual

ST
ST X-STM32MP-MSP01 User manual

ST
ST MotionTL User manual

ST
ST X-NUCLEO-53L5A1 User manual

ST
ST STM32 ODE User manual

ST
ST QFN20 User manual

ST
ST X-NUCLEO-OUT02A1 User manual

ST
ST TDA911 Series Installation and operating instructions