RM0444-STM32G0x1
This reference manual complements the datasheets of the STM32G0x1 microcontrollers, providing information required for application and in particular for software development. It pertains to the superset of feature sets available on STM32G0x1 microcontrollers.
The devices include ST state-of-the-art patented technology.
For feature set, ordering information, and mechanical and electrical characteristics of a particular STM32G0x1 device, refer to its corresponding datasheet.
For information on the Arm ® Cortex ® -M0+ core, refer to the Cortex ® -M0+ technical reference manual.
Related documents
- • “Cortex ® -M0+ Technical Reference Manual”, available from: http://infocenter.arm.com
- • PM0223 programming manual for Cortex ® -M0+ core (a)
- • STM32G0x1 datasheets (a)
- • AN2606 application note on booting STM32 MCUs (a)
- • STM32G0x1 device errata sheets (a)
a. Available on STMicroelectronics website www.st.com
Contents
| 1 | Documentation conventions . . . . . | 55 |
| 1.1 | General information . . . . . | 55 |
| 1.2 | List of abbreviations for registers . . . . . | 55 |
| 1.3 | Glossary . . . . . | 56 |
| 1.4 | Availability of peripherals . . . . . | 56 |
| 2 | Memory and bus architecture . . . . . | 58 |
| 2.1 | System architecture . . . . . | 58 |
| 2.2 | Memory organization . . . . . | 60 |
| 2.2.1 | Introduction . . . . . | 60 |
| 2.2.2 | Memory map and register boundary addresses . . . . . | 61 |
| 2.3 | Embedded SRAM . . . . . | 66 |
| 2.4 | Flash memory overview . . . . . | 67 |
| 2.5 | Boot configuration . . . . . | 68 |
| 2.5.1 | Physical remap . . . . . | 69 |
| 2.5.2 | Embedded bootloader . . . . . | 69 |
| 2.5.3 | Forcing boot from main flash memory . . . . . | 69 |
| 2.5.4 | Empty check . . . . . | 69 |
| 3 | Embedded flash memory (FLASH) . . . . . | 70 |
| 3.1 | FLASH Introduction . . . . . | 70 |
| 3.2 | FLASH main features . . . . . | 70 |
| 3.3 | FLASH functional description . . . . . | 71 |
| 3.3.1 | FLASH organization . . . . . | 71 |
| 3.3.2 | FLASH dual-bank capability . . . . . | 73 |
| 3.3.3 | FLASH error code correction (ECC) . . . . . | 74 |
| 3.3.4 | FLASH read access latency . . . . . | 75 |
| 3.3.5 | FLASH memory acceleration . . . . . | 76 |
| 3.3.6 | FLASH program and erase operations . . . . . | 77 |
| 3.3.7 | FLASH main memory erase sequences . . . . . | 77 |
| 3.3.8 | FLASH main memory programming sequences . . . . . | 79 |
| 3.3.9 | Read-while-write (RWW) function . . . . . | 82 |
| 3.4 | FLASH option bytes . . . . . | 82 |
| 3.4.1 | FLASH option byte description . . . . . | 82 |
| 3.4.2 | FLASH option byte programming . . . . . | 84 |
| 3.5 | FLASH memory protection . . . . . | 85 |
| 3.5.1 | FLASH read protection (RDP) . . . . . | 86 |
| 3.5.2 | FLASH proprietary code readout protection (PCROP) . . . . . | 88 |
| 3.5.3 | FLASH write protection (WRP) . . . . . | 90 |
| 3.5.4 | Securable memory area . . . . . | 91 |
| 3.5.5 | Disabling core debug access . . . . . | 92 |
| 3.5.6 | Forcing boot from main flash memory . . . . . | 92 |
| 3.6 | FLASH interrupts . . . . . | 93 |
| 3.7 | FLASH registers . . . . . | 94 |
| 3.7.1 | FLASH access control register (FLASH_ACR) . . . . . | 94 |
| 3.7.2 | FLASH key register (FLASH_KEYR) . . . . . | 95 |
| 3.7.3 | FLASH option key register (FLASH_OPTKEYR) . . . . . | 95 |
| 3.7.4 | FLASH status register (FLASH_SR) . . . . . | 96 |
| 3.7.5 | FLASH control register (FLASH_CR) . . . . . | 98 |
| 3.7.6 | FLASH ECC register (FLASH_ECCR) . . . . . | 100 |
| 3.7.7 | FLASH ECC register 2 (FLASH_ECCR2) . . . . . | 101 |
| 3.7.8 | FLASH option register (FLASH_OPTR) . . . . . | 102 |
| 3.7.9 | FLASH PCROP area A start address register (FLASH_PCROP1ASR) . . . . . | 104 |
| 3.7.10 | FLASH PCROP area A end address register (FLASH_PCROP1AER) . . . . . | 105 |
| 3.7.11 | FLASH WRP area A address register (FLASH_WRP1AR) . . . . . | 105 |
| 3.7.12 | FLASH WRP area B address register (FLASH_WRP1BR) . . . . . | 106 |
| 3.7.13 | FLASH PCROP area B start address register (FLASH_PCROP1BSR) . . . . . | 107 |
| 3.7.14 | FLASH PCROP area B end address register (FLASH_PCROP1BER) . . . . . | 107 |
| 3.7.15 | FLASH PCROP2 area A start address register (FLASH_PCROP2ASR) . . . . . | 108 |
| 3.7.16 | FLASH PCROP2 area A end address register (FLASH_PCROP2AER) . . . . . | 108 |
| 3.7.17 | FLASH WRP2 area A address register (FLASH_WRP2AR) . . . . . | 109 |
| 3.7.18 | FLASH WRP2 area B address register (FLASH_WRP2BR) . . . . . | 109 |
| 3.7.19 | FLASH PCROP2 area B start address register (FLASH_PCROP2BSR) . . . . . | 110 |
| 3.7.20 | FLASH PCROP2 area B end address register (FLASH_PCROP2BER) . . . . . | 110 |
- 3.7.21 FLASH security register (FLASH_SECR) . . . . . 111
- 3.7.22 FLASH register map . . . . . 112
- 4 Power control (PWR) . . . . . 114
- 4.1 Power supplies . . . . . 114
- 4.1.1 ADC and DAC reference voltage . . . . . 115
- 4.1.2 Battery backup of RTC domain . . . . . 115
- 4.1.3 Voltage regulator . . . . . 117
- 4.1.4 Dynamic voltage scaling management . . . . . 118
- 4.2 Power supply supervisor . . . . . 119
- 4.2.1 Power-on reset (POR) / power-down reset (PDR) / brown-out reset (BOR) . . . . . 119
- 4.2.2 Programmable voltage detector (PVD) . . . . . 120
- 4.3 Low-power modes . . . . . 121
- 4.3.1 Run mode . . . . . 126
- 4.3.2 Low-power run mode (LP run) . . . . . 126
- 4.3.3 Low-power modes . . . . . 127
- 4.3.4 Sleep mode . . . . . 128
- 4.3.5 Low-power sleep mode (LP sleep) . . . . . 128
- 4.3.6 Stop 0 mode . . . . . 129
- 4.3.7 Stop 1 mode . . . . . 132
- 4.3.8 Standby mode . . . . . 133
- 4.3.9 Shutdown mode . . . . . 135
- 4.3.10 Auto-wake-up from low-power mode . . . . . 136
- 4.4 PWR registers . . . . . 137
- 4.4.1 Power control register 1 (PWR_CR1) . . . . . 137
- 4.4.2 Power control register 2 (PWR_CR2) . . . . . 138
- 4.4.3 Power control register 3 (PWR_CR3) . . . . . 140
- 4.4.4 Power control register 4 (PWR_CR4) . . . . . 141
- 4.4.5 Power status register 1 (PWR_SR1) . . . . . 142
- 4.4.6 Power status register 2 (PWR_SR2) . . . . . 143
- 4.4.7 Power status clear register (PWR_SCR) . . . . . 145
- 4.4.8 Power Port A pull-up control register (PWR_PUCRA) . . . . . 146
- 4.4.9 Power Port A pull-down control register (PWR_PDCRA) . . . . . 146
- 4.4.10 Power Port B pull-up control register (PWR_PUCRB) . . . . . 147
- 4.4.11 Power Port B pull-down control register (PWR_PDCRB) . . . . . 147
- 4.4.12 Power Port C pull-up control register (PWR_PUCRC) . . . . . 148
- 4.1 Power supplies . . . . . 114
| 4.4.13 | Power Port C pull-down control register (PWR_PDCRC) | 148 |
| 4.4.14 | Power Port D pull-up control register (PWR_PUCRD) | 149 |
| 4.4.15 | Power Port D pull-down control register (PWR_PDCRD) | 149 |
| 4.4.16 | Power Port E pull-up control register (PWR_PUCRE) | 150 |
| 4.4.17 | Power Port E pull-down control register (PWR_PDCRE) | 150 |
| 4.4.18 | Power Port F pull-up control register (PWR_PUCRF) | 151 |
| 4.4.19 | Power Port F pull-down control register (PWR_PDCRF) | 151 |
| 4.4.20 | PWR register map | 153 |
| 5 | Reset and clock control (RCC) | 155 |
| 5.1 | Reset | 155 |
| 5.1.1 | Power reset | 155 |
| 5.1.2 | System reset | 155 |
| 5.1.3 | RTC domain reset | 157 |
| 5.2 | Clocks | 158 |
| 5.2.1 | HSE clock | 162 |
| 5.2.2 | HSI16 clock | 163 |
| 5.2.3 | HSI48 clock | 164 |
| 5.2.4 | PLL | 164 |
| 5.2.5 | LSE clock | 165 |
| 5.2.6 | LSI clock | 165 |
| 5.2.7 | System clock (SYSCLK) selection | 166 |
| 5.2.8 | Clock source frequency versus voltage scaling | 166 |
| 5.2.9 | Clock security system (CSS) | 166 |
| 5.2.10 | Clock security system for LSE clock (LSECSS) | 167 |
| 5.2.11 | ADC clock | 167 |
| 5.2.12 | RTC clock | 168 |
| 5.2.13 | Timer clock | 168 |
| 5.2.14 | Watchdog clock | 168 |
| 5.2.15 | Clock-out capability | 169 |
| 5.2.16 | Internal/external clock measurement with TIM14/TIM16/TIM17 | 169 |
| 5.2.17 | Peripheral clock enable registers | 172 |
| 5.3 | Low-power modes | 172 |
| 5.4 | RCC registers | 174 |
| 5.4.1 | Clock control register (RCC_CR) | 174 |
| 5.4.2 | Internal clock source calibration register (RCC_ICSCR) | 176 |
| 5.4.3 | Clock configuration register (RCC_CFGR) | 176 |
| 5.4.4 | PLL configuration register (RCC_PLLCFGR) . . . . . | 179 |
| 5.4.5 | RCC clock recovery RC register (RCC_CRRCR) . . . . . | 182 |
| 5.4.6 | Clock interrupt enable register (RCC_CIER) . . . . . | 182 |
| 5.4.7 | Clock interrupt flag register (RCC_CIFR) . . . . . | 183 |
| 5.4.8 | Clock interrupt clear register (RCC_CICR) . . . . . | 185 |
| 5.4.9 | I/O port reset register (RCC_IOPRSTR) . . . . . | 186 |
| 5.4.10 | AHB peripheral reset register (RCC_AHBRSTR) . . . . . | 187 |
| 5.4.11 | APB peripheral reset register 1 (RCC_APBSTR1) . . . . . | 188 |
| 5.4.12 | APB peripheral reset register 2 (RCC_APBSTR2) . . . . . | 191 |
| 5.4.13 | I/O port clock enable register (RCC_IOPENR) . . . . . | 192 |
| 5.4.14 | AHB peripheral clock enable register (RCC_AHBENR) . . . . . | 193 |
| 5.4.15 | APB peripheral clock enable register 1 (RCC_APBENR1) . . . . . | 194 |
| 5.4.16 | APB peripheral clock enable register 2(RCC_APBENR2) . . . . . | 198 |
| 5.4.17 | I/O port in Sleep mode clock enable register (RCC_IOPSMENR) . . . . . | 199 |
| 5.4.18 | AHB peripheral clock enable in Sleep/Stop mode register (RCC_AHBSMENR) . . . . . | 200 |
| 5.4.19 | APB peripheral clock enable in Sleep/Stop mode register 1 (RCC_APBSMENR1) . . . . . | 201 |
| 5.4.20 | APB peripheral clock enable in Sleep/Stop mode register 2 (RCC_APBSMENR2) . . . . . | 205 |
| 5.4.21 | Peripherals independent clock configuration register (RCC_CCIPR) . . . . . | 206 |
| 5.4.22 | Peripherals independent clock configuration register 2 (RCC_CCIPR2) . . . . . | 208 |
| 5.4.23 | RTC domain control register (RCC_BDCR) . . . . . | 209 |
| 5.4.24 | Control/status register (RCC_CSR) . . . . . | 211 |
| 5.4.25 | RCC register map . . . . . | 213 |
| 6 | Clock recovery system (CRS) . . . . . | 217 |
| 6.1 | CRS introduction . . . . . | 217 |
| 6.2 | CRS main features . . . . . | 217 |
| 6.3 | CRS implementation . . . . . | 217 |
| 6.4 | CRS functional description . . . . . | 218 |
| 6.4.1 | CRS block diagram . . . . . | 218 |
| 6.4.2 | CRS internal signals . . . . . | 218 |
| 6.4.3 | Synchronization input . . . . . | 219 |
| 6.4.4 | Frequency error measurement . . . . . | 219 |
| 6.4.5 | Frequency error evaluation and automatic trimming . . . . . | 220 |
| 6.4.6 | CRS initialization and configuration . . . . . | 221 |
| 6.5 | CRS in low-power modes . . . . . | 222 |
| 6.6 | CRS interrupts . . . . . | 222 |
| 6.7 | CRS registers . . . . . | 222 |
| 6.7.1 | CRS control register (CRS_CR) . . . . . | 222 |
| 6.7.2 | CRS configuration register (CRS_CFGR) . . . . . | 223 |
| 6.7.3 | CRS interrupt and status register (CRS_ISR) . . . . . | 224 |
| 6.7.4 | CRS interrupt flag clear register (CRS_ICR) . . . . . | 226 |
| 6.7.5 | CRS register map . . . . . | 227 |
| 7 | General-purpose I/Os (GPIO) . . . . . | 228 |
| 7.1 | Introduction . . . . . | 228 |
| 7.2 | GPIO main features . . . . . | 228 |
| 7.3 | GPIO functional description . . . . . | 228 |
| 7.3.1 | General-purpose I/O (GPIO) . . . . . | 230 |
| 7.3.2 | I/O pin alternate function multiplexer and mapping . . . . . | 230 |
| 7.3.3 | I/O port control registers . . . . . | 232 |
| 7.3.4 | I/O port state in low-power modes . . . . . | 232 |
| 7.3.5 | I/O port data registers . . . . . | 232 |
| 7.3.6 | I/O data bitwise handling . . . . . | 232 |
| 7.3.7 | GPIO locking mechanism . . . . . | 233 |
| 7.3.8 | I/O alternate function input/output . . . . . | 233 |
| 7.3.9 | External interrupt/wake-up lines . . . . . | 233 |
| 7.3.10 | Input configuration . . . . . | 233 |
| 7.3.11 | Output configuration . . . . . | 234 |
| 7.3.12 | Alternate function configuration . . . . . | 235 |
| 7.3.13 | Analog configuration . . . . . | 236 |
| 7.3.14 | Using the HSE or LSE oscillator pins as GPIOs . . . . . | 237 |
| 7.3.15 | Using the GPIO pins in the RTC domain . . . . . | 237 |
| 7.3.16 | USB PD / Dead battery support . . . . . | 237 |
| 7.3.17 | Reset pin (PF2-NRST) in GPIO mode . . . . . | 237 |
| 7.4 | GPIO in low-power modes . . . . . | 238 |
| 7.5 | GPIO registers . . . . . | 238 |
| 7.5.1 | GPIO port mode register (GPIOx_MODER) (x = A to F) . . . . . | 238 |
| 7.5.2 | GPIO port output type register (GPIOx_OTYPER) (x = A to F) . . . . . | 239 |
| 7.5.3 | GPIO port output speed register (GPIOx_OSPEEDR) (x = A to F) . . . . . | 239 |
| 7.5.4 | GPIO port pull-up/pull-down register (GPIOx_PUPDR) (x = A to F) . . . . . | 240 |
| 7.5.5 | GPIO port input data register (GPIOx_IDR) (x = A to F) . . . . . | 240 |
| 7.5.6 | GPIO port output data register (GPIOx_ODR) (x = A to F) . . . . . | 241 |
| 7.5.7 | GPIO port bit set/reset register (GPIOx_BSRR) (x = A to F) . . . . . | 241 |
| 7.5.8 | GPIO port configuration lock register (GPIOx_LCKR) (x = A to F) . . . . . | 241 |
| 7.5.9 | GPIO port alternate function low register (GPIOx_AFRL) (x = A to F) . . . . . | 242 |
| 7.5.10 | GPIO port alternate function high register (GPIOx_AFRH) (x = A to F) . . . . . | 243 |
| 7.5.11 | GPIO port bit reset register (GPIOx_BRR) (x = A to F) . . . . . | 243 |
| 7.5.12 | GPIO register map . . . . . | 245 |
| 8 | System configuration controller (SYSCFG) . . . . . | 246 |
| 8.1 | SYSCFG registers . . . . . | 246 |
| 8.1.1 | SYSCFG configuration register 1 (SYSCFG_CFGR1) . . . . . | 246 |
| 8.1.2 | SYSCFG configuration register 2 (SYSCFG_CFGR2) . . . . . | 249 |
| 8.1.3 | SYSCFG interrupt line 0 status register (SYSCFG_ITLINE0) . . . . . | 251 |
| 8.1.4 | SYSCFG interrupt line 1 status register (SYSCFG_ITLINE1) . . . . . | 252 |
| 8.1.5 | SYSCFG interrupt line 2 status register (SYSCFG_ITLINE2) . . . . . | 252 |
| 8.1.6 | SYSCFG interrupt line 3 status register (SYSCFG_ITLINE3) . . . . . | 252 |
| 8.1.7 | SYSCFG interrupt line 4 status register (SYSCFG_ITLINE4) . . . . . | 253 |
| 8.1.8 | SYSCFG interrupt line 5 status register (SYSCFG_ITLINE5) . . . . . | 254 |
| 8.1.9 | SYSCFG interrupt line 6 status register (SYSCFG_ITLINE6) . . . . . | 254 |
| 8.1.10 | SYSCFG interrupt line 7 status register (SYSCFG_ITLINE7) . . . . . | 254 |
| 8.1.11 | SYSCFG interrupt line 8 status register (SYSCFG_ITLINE8) . . . . . | 255 |
| 8.1.12 | SYSCFG interrupt line 9 status register (SYSCFG_ITLINE9) . . . . . | 255 |
| 8.1.13 | SYSCFG interrupt line 10 status register (SYSCFG_ITLINE10) . . . . . | 256 |
| 8.1.14 | SYSCFG interrupt line 11 status register (SYSCFG_ITLINE11) . . . . . | 256 |
| 8.1.15 | SYSCFG interrupt line 12 status register (SYSCFG_ITLINE12) . . . . . | 257 |
| 8.1.16 | SYSCFG interrupt line 13 status register (SYSCFG_ITLINE13) . . . . . | 257 |
| 8.1.17 | SYSCFG interrupt line 14 status register (SYSCFG_ITLINE14) . . . . . | 258 |
| 8.1.18 | SYSCFG interrupt line 15 status register (SYSCFG_ITLINE15) . . . . . | 258 |
| 8.1.19 | SYSCFG interrupt line 16 status register (SYSCFG_ITLINE16) . . . . . | 258 |
| 8.1.20 | SYSCFG interrupt line 17 status register (SYSCFG_ITLINE17) . . . . . | 259 |
| 8.1.21 | SYSCFG interrupt line 18 status register (SYSCFG_ITLINE18) . . . . . | 259 |
| 8.1.22 | SYSCFG interrupt line 19 status register (SYSCFG_ITLINE19) . . . . . | 260 |
| 8.1.23 | SYSCFG interrupt line 20 status register (SYSCFG_ITLINE20) . . . . . | 260 |
| 8.1.24 | SYSCFG interrupt line 21 status register (SYSCFG_ITLINE21) . . . . . | 260 |
| 8.1.25 | SYSCFG interrupt line 22 status register (SYSCFG_ITLINE22) . . . . . | 261 |
| 8.1.26 | SYSCFG interrupt line 23 status register (SYSCFG_ITLINE23) . . . . . | 261 |
| 8.1.27 | SYSCFG interrupt line 24 status register (SYSCFG_ITLINE24) . . . . . | 262 |
| 8.1.28 | SYSCFG interrupt line 25 status register (SYSCFG_ITLINE25) . . . . . | 262 |
| 8.1.29 | SYSCFG interrupt line 26 status register (SYSCFG_ITLINE26) . . . . . | 262 |
| 8.1.30 | SYSCFG interrupt line 27 status register (SYSCFG_ITLINE27) . . . . . | 263 |
| 8.1.31 | SYSCFG interrupt line 28 status register (SYSCFG_ITLINE28) . . . . . | 263 |
| 8.1.32 | SYSCFG interrupt line 29 status register (SYSCFG_ITLINE29) . . . . . | 264 |
| 8.1.33 | SYSCFG interrupt line 30 status register (SYSCFG_ITLINE30) . . . . . | 264 |
| 8.1.34 | SYSCFG interrupt line 31 status register (SYSCFG_ITLINE31) . . . . . | 264 |
| 8.1.35 | SYSCFG register map . . . . . | 265 |
| 9 | Interconnect matrix . . . . . | 268 |
| 9.1 | Introduction . . . . . | 268 |
| 9.2 | Connection summary . . . . . | 268 |
| 9.3 | Interconnection details . . . . . | 269 |
| 9.3.1 | From TIM1, TIM2, TIM3, TIM4, TIM15, TIM16, and TIM17, to TIM1, TIM2, TIM3, TIM4, and TIM15 . . . . . | 269 |
| 9.3.2 | From TIM1, TIM2, TIM3, TIM4, TIM6, TIM15, and EXTI, to ADC . . . . . | 270 |
| 9.3.3 | From ADC to TIM1 . . . . . | 270 |
| 9.3.4 | From TIM1, TIM2, TIM3, TIM4, TIM6, TIM7, TIM15, LPTIM1, LPTIM2, and EXTI, to DAC . . . . . | 271 |
| 9.3.5 | From HSE, LSE, LSI, MCO, MCO2, RTC and TAMP, to TIM2, TIM14, TIM16, and TIM17 . . . . . | 271 |
| 9.3.6 | From RTC, TAMP, COMP1, COMP2, and COMP3 to LPTIM1 and LPTIM2 . . . . . | 272 |
| 9.3.7 | From TIM1, TIM2, TIM3, TIM4, and TIM15, to COMP1, COMP2, and COMP3 . . . . . | 272 |
| 9.3.8 | From internal analog sources to ADC . . . . . | 272 |
| 9.3.9 | From COMP1, COMP2, and COMP3 to TIM1, TIM2, TIM3, TIM4, TIM15, TIM16, and TIM17 . . . . . | 273 |
| 9.3.10 | From system errors to TIM1, TIM2, TIM3, TIM4, TIM15, TIM16, and TIM17 . . . . . | 273 |
- 9.3.11 From TIM16, TIM17, USART1, and USART4, to IRTIM . . . . . 274
- 9.3.12 From TIM14, LPTIM1, and LPTIM2, to DMAMUX . . . . . 274
- 10 Direct memory access controller (DMA) . . . . . 275
- 10.1 Introduction . . . . . 275
- 10.2 DMA main features . . . . . 275
- 10.3 DMA implementation . . . . . 276
- 10.3.1 DMA . . . . . 276
- 10.3.2 DMA request mapping . . . . . 276
- 10.4 DMA functional description . . . . . 277
- 10.4.1 DMA block diagram . . . . . 277
- 10.4.2 DMA pins and internal signals . . . . . 277
- 10.4.3 DMA transfers . . . . . 278
- 10.4.4 DMA arbitration . . . . . 279
- 10.4.5 DMA channels . . . . . 279
- 10.4.6 DMA data width, alignment, and endianness . . . . . 283
- 10.4.7 DMA error management . . . . . 284
- 10.5 DMA interrupts . . . . . 285
- 10.6 DMA registers . . . . . 285
- 10.6.1 DMA interrupt status register (DMA_ISR) . . . . . 285
- 10.6.2 DMA interrupt flag clear register (DMA_IFCR) . . . . . 287
- 10.6.3 DMA channel x configuration register (DMA_CCRx) . . . . . 289
- 10.6.4 DMA channel x number of data to transfer register (DMA_CNDTRx) . . . . . 291
- 10.6.5 DMA channel x peripheral address register (DMA_CPARx) . . . . . 292
- 10.6.6 DMA channel x memory address register (DMA_CMARx) . . . . . 293
- 10.6.7 DMA register map . . . . . 293
- 11 DMA request multiplexer (DMAMUX) . . . . . 296
- 11.1 Introduction . . . . . 296
- 11.2 DMAMUX main features . . . . . 297
- 11.3 DMAMUX implementation . . . . . 297
- 11.3.1 DMAMUX instantiation . . . . . 297
- 11.3.2 DMAMUX mapping . . . . . 297
- 11.4 DMAMUX functional description . . . . . 300
- 11.4.1 DMAMUX block diagram . . . . . 300
- 11.4.2 DMAMUX signals . . . . . 301
| 11.4.3 | DMAMUX channels . . . . . | 301 |
| 11.4.4 | DMAMUX request line multiplexer . . . . . | 301 |
| 11.4.5 | DMAMUX request generator . . . . . | 304 |
| 11.5 | DMAMUX interrupts . . . . . | 305 |
| 11.6 | DMAMUX registers . . . . . | 306 |
| 11.6.1 | DMAMUX request line multiplexer channel x configuration register (DMAMUX_CxCR) . . . . . | 306 |
| 11.6.2 | DMAMUX request line multiplexer interrupt channel status register (DMAMUX_CSR) . . . . . | 307 |
| 11.6.3 | DMAMUX request line multiplexer interrupt clear flag register (DMAMUX_CFR) . . . . . | 307 |
| 11.6.4 | DMAMUX request generator channel x configuration register (DMAMUX_RGxCR) . . . . . | 308 |
| 11.6.5 | DMAMUX request generator interrupt status register (DMAMUX_RGSR) . . . . . | 309 |
| 11.6.6 | DMAMUX request generator interrupt clear flag register (DMAMUX_RGCFR) . . . . . | 309 |
| 11.6.7 | DMAMUX register map . . . . . | 310 |
| 12 | Nested vectored interrupt controller (NVIC) . . . . . | 312 |
| 12.1 | Main features . . . . . | 312 |
| 12.2 | SysTick calibration value register . . . . . | 312 |
| 12.3 | Interrupt and exception vectors . . . . . | 312 |
| 13 | Extended interrupt and event controller (EXTI) . . . . . | 315 |
| 13.1 | EXTI main features . . . . . | 315 |
| 13.2 | EXTI block diagram . . . . . | 315 |
| 13.2.1 | EXTI connections between peripherals and CPU . . . . . | 317 |
| 13.3 | EXTI functional description . . . . . | 317 |
| 13.3.1 | EXTI configurable event input wake-up . . . . . | 318 |
| 13.3.2 | EXTI direct event input wake-up . . . . . | 319 |
| 13.3.3 | EXTI mux . . . . . | 319 |
| 13.4 | EXTI functional behavior . . . . . | 321 |
| 13.5 | EXTI registers . . . . . | 322 |
| 13.5.1 | EXTI rising trigger selection register (EXTI_RTSR1) . . . . . | 322 |
| 13.5.2 | EXTI falling trigger selection register 1 (EXTI_FTSR1) . . . . . | 323 |
| 13.5.3 | EXTI software interrupt event register 1 (EXTI_SWIER1) . . . . . | 323 |
| 13.5.4 | EXTI rising edge pending register 1 (EXTI_RPR1) . . . . . | 324 |
| 13.5.5 | EXTI falling edge pending register 1 (EXTI_FPR1) . . . . . | 325 |
| 13.5.6 | EXTI rising trigger selection register 2 (EXTI_RTSR2) . . . . . | 325 |
| 13.5.7 | EXTI falling trigger selection register 2 (EXTI_FTSR2) . . . . . | 326 |
| 13.5.8 | EXTI software interrupt event register 2 (EXTI_SWIER2) . . . . . | 326 |
| 13.5.9 | EXTI rising edge pending register 2 (EXTI_RPR2) . . . . . | 327 |
| 13.5.10 | EXTI falling edge pending register 2 (EXTI_FPR2) . . . . . | 327 |
| 13.5.11 | EXTI external interrupt selection register (EXTI_EXTICRx) . . . . . | 328 |
| 13.5.12 | EXTI CPU wake-up with interrupt mask register (EXTI_IMR1) . . . . . | 329 |
| 13.5.13 | EXTI CPU wake-up with event mask register (EXTI_EMR1) . . . . . | 330 |
| 13.5.14 | EXTI CPU wake-up with interrupt mask register (EXTI_IMR2) . . . . . | 330 |
| 13.5.15 | EXTI CPU wake-up with event mask register (EXTI_EMR2) . . . . . | 331 |
| 13.5.16 | EXTI register map . . . . . | 332 |
| 14 | Cyclic redundancy check calculation unit (CRC) . . . . . | 334 |
| 14.1 | Introduction . . . . . | 334 |
| 14.2 | CRC main features . . . . . | 334 |
| 14.3 | CRC functional description . . . . . | 335 |
| 14.3.1 | CRC block diagram . . . . . | 335 |
| 14.3.2 | CRC internal signals . . . . . | 335 |
| 14.3.3 | CRC operation . . . . . | 335 |
| 14.4 | CRC registers . . . . . | 337 |
| 14.4.1 | CRC data register (CRC_DR) . . . . . | 337 |
| 14.4.2 | CRC independent data register (CRC_IDR) . . . . . | 337 |
| 14.4.3 | CRC control register (CRC_CR) . . . . . | 338 |
| 14.4.4 | CRC initial value (CRC_INIT) . . . . . | 339 |
| 14.4.5 | CRC polynomial (CRC_POL) . . . . . | 339 |
| 14.4.6 | CRC register map . . . . . | 340 |
| 15 | Analog-to-digital converter (ADC) . . . . . | 341 |
| 15.1 | Introduction . . . . . | 341 |
| 15.2 | ADC main features . . . . . | 342 |
| 15.3 | ADC functional description . . . . . | 343 |
| 15.3.1 | ADC pins and internal signals . . . . . | 343 |
| 15.3.2 | ADC voltage regulator (ADVREGEN) . . . . . | 344 |
| 15.3.3 | Calibration (ADCAL) . . . . . | 345 |
| 15.3.4 | ADC on-off control (ADEN, ADDIS, ADRDY) . . . . . | 347 |
| 15.3.5 | ADC clock (CKMODE, PRESC[3:0]) | 349 |
| 15.3.6 | ADC connectivity | 351 |
| 15.3.7 | Configuring the ADC | 352 |
| 15.3.8 | Channel selection (CHSEL, SCANDIR, CHSELRMOD) | 352 |
| 15.3.9 | Programmable sampling time (SMPx[2:0]) | 353 |
| 15.3.10 | Single conversion mode (CONT = 0) | 354 |
| 15.3.11 | Continuous conversion mode (CONT = 1) | 354 |
| 15.3.12 | Starting conversions (ADSTART) | 355 |
| 15.3.13 | Timings | 356 |
| 15.3.14 | Stopping an ongoing conversion (ADSTP) | 357 |
| 15.4 | Conversion on external trigger and trigger polarity (EXTSEL, EXTEN) | 357 |
| 15.4.1 | Discontinuous mode (DISCEN) | 358 |
| 15.4.2 | Programmable resolution (RES) - Fast conversion mode | 358 |
| 15.4.3 | End of conversion, end of sampling phase (EOC, EOSMP flags) | 359 |
| 15.4.4 | End of conversion sequence (EOS flag) | 359 |
| 15.4.5 | Example timing diagrams (single/continuous modes hardware/software triggers) | 360 |
| 15.4.6 | Low frequency trigger mode | 362 |
| 15.5 | Data management | 362 |
| 15.5.1 | Data register and data alignment (ADC_DR, ALIGN) | 362 |
| 15.5.2 | ADC overrun (OVR, OVRMOD) | 362 |
| 15.5.3 | Managing a sequence of data converted without using the DMA | 364 |
| 15.5.4 | Managing converted data without using the DMA without overrun | 364 |
| 15.5.5 | Managing converted data using the DMA | 364 |
| 15.6 | Low-power features | 365 |
| 15.6.1 | Wait mode conversion | 365 |
| 15.6.2 | Auto-off mode (AUTOFF) | 366 |
| 15.7 | Analog window watchdogs | 367 |
| 15.7.1 | Description of analog watchdog 1 | 368 |
| 15.7.2 | Description of analog watchdog 2 and 3 | 369 |
| 15.7.3 | ADC_AWDx_OUT output signal generation | 369 |
| 15.7.4 | Analog watchdog threshold control | 371 |
| 15.8 | Oversampler | 372 |
| 15.8.1 | ADC operating modes supported when oversampling | 373 |
| 15.8.2 | Analog watchdog | 374 |
| 15.8.3 | Triggered mode | 374 |
| 15.9 | Temperature sensor and internal reference voltage | 374 |
| 15.10 | Battery voltage monitoring . . . . . | 377 |
| 15.11 | ADC interrupts . . . . . | 378 |
| 15.12 | ADC registers . . . . . | 379 |
| 15.12.1 | ADC interrupt and status register (ADC_ISR) . . . . . | 379 |
| 15.12.2 | ADC interrupt enable register (ADC_IER) . . . . . | 380 |
| 15.12.3 | ADC control register (ADC_CR) . . . . . | 382 |
| 15.12.4 | ADC configuration register 1 (ADC_CFGR1) . . . . . | 384 |
| 15.12.5 | ADC configuration register 2 (ADC_CFGR2) . . . . . | 387 |
| 15.12.6 | ADC sampling time register (ADC_SMPR) . . . . . | 389 |
| 15.12.7 | ADC watchdog threshold register (ADC_AWD1TR) . . . . . | 390 |
| 15.12.8 | ADC watchdog threshold register (ADC_AWD2TR) . . . . . | 390 |
| 15.12.9 | ADC channel selection register (ADC_CHSELR) . . . . . | 390 |
| 15.12.10 | ADC channel selection register [alternate] (ADC_CHSELR) . . . . . | 391 |
| 15.12.11 | ADC watchdog threshold register (ADC_AWD3TR) . . . . . | 393 |
| 15.12.12 | ADC data register (ADC_DR) . . . . . | 394 |
| 15.12.13 | ADC analog watchdog 2 configuration register (ADC_AWD2CR) . . . . . | 394 |
| 15.12.14 | ADC Analog Watchdog 3 Configuration register (ADC_AWD3CR) . . . . . | 395 |
| 15.12.15 | ADC calibration factor (ADC_CALFACT) . . . . . | 395 |
| 15.12.16 | ADC common configuration register (ADC_CCR) . . . . . | 396 |
| 15.13 | ADC register map . . . . . | 397 |
| 16 | Digital-to-analog converter (DAC) . . . . . | 400 |
| 16.1 | Introduction . . . . . | 400 |
| 16.2 | DAC main features . . . . . | 400 |
| 16.3 | DAC implementation . . . . . | 401 |
| 16.4 | DAC functional description . . . . . | 402 |
| 16.4.1 | DAC block diagram . . . . . | 402 |
| 16.4.2 | DAC pins and internal signals . . . . . | 403 |
| 16.4.3 | DAC channel enable . . . . . | 404 |
| 16.4.4 | DAC data format . . . . . | 404 |
| 16.4.5 | DAC conversion . . . . . | 406 |
| 16.4.6 | DAC output voltage . . . . . | 406 |
| 16.4.7 | DAC trigger selection . . . . . | 406 |
| 16.4.8 | DMA requests . . . . . | 407 |
| 16.4.9 | Noise generation . . . . . | 407 |
| 16.4.10 | Triangle-wave generation . . . . . | 409 |
| 16.4.11 | DAC channel modes . . . . . | 410 |
| 16.4.12 | DAC channel buffer calibration . . . . . | 413 |
| 16.4.13 | DAC channel conversion modes . . . . . | 414 |
| 16.4.14 | Dual DAC channel conversion modes (if dual channels are available) . . . . . | 415 |
| 16.5 | DAC in low-power modes . . . . . | 419 |
| 16.6 | DAC interrupts . . . . . | 420 |
| 16.7 | DAC registers . . . . . | 420 |
| 16.7.1 | DAC control register (DAC_CR) . . . . . | 420 |
| 16.7.2 | DAC software trigger register (DAC_SWTRGR) . . . . . | 423 |
| 16.7.3 | DAC channel1 12-bit right-aligned data holding register (DAC_DHR12R1) . . . . . | 424 |
| 16.7.4 | DAC channel1 12-bit left aligned data holding register (DAC_DHR12L1) . . . . . | 424 |
| 16.7.5 | DAC channel1 8-bit right aligned data holding register (DAC_DHR8R1) . . . . . | 425 |
| 16.7.6 | DAC channel2 12-bit right aligned data holding register (DAC_DHR12R2) . . . . . | 425 |
| 16.7.7 | DAC channel2 12-bit left aligned data holding register (DAC_DHR12L2) . . . . . | 426 |
| 16.7.8 | DAC channel2 8-bit right-aligned data holding register (DAC_DHR8R2) . . . . . | 426 |
| 16.7.9 | Dual DAC 12-bit right-aligned data holding register (DAC_DHR12RD) . . . . . | 427 |
| 16.7.10 | Dual DAC 12-bit left aligned data holding register (DAC_DHR12LD) . . . . . | 427 |
| 16.7.11 | Dual DAC 8-bit right aligned data holding register (DAC_DHR8RD) . . . . . | 428 |
| 16.7.12 | DAC channel1 data output register (DAC_DOR1) . . . . . | 428 |
| 16.7.13 | DAC channel2 data output register (DAC_DOR2) . . . . . | 429 |
| 16.7.14 | DAC status register (DAC_SR) . . . . . | 429 |
| 16.7.15 | DAC calibration control register (DAC_CCR) . . . . . | 431 |
| 16.7.16 | DAC mode control register (DAC_MCR) . . . . . | 431 |
| 16.7.17 | DAC channel1 sample and hold sample time register (DAC_SHSR1) . . . . . | 433 |
| 16.7.18 | DAC channel2 sample and hold sample time register (DAC_SHSR2) . . . . . | 433 |
| 16.7.19 | DAC sample and hold time register (DAC_SHHR) . . . . . | 433 |
| 16.7.20 | DAC sample and hold refresh time register (DAC_SHRR) . . . . . | 434 |
| 16.7.21 | DAC register map . . . . . | 435 |
| 17 | Voltage reference buffer (VREFBUF) . . . . . | 437 |
| 17.1 | Introduction . . . . . | 437 |
| 17.2 | VREFBUF functional description . . . . . | 437 |
| 17.3 | VREFBUF registers . . . . . | 438 |
| 17.3.1 | VREFBUF control and status register (VREFBUF_CSR) . . . . . | 438 |
| 17.3.2 | VREFBUF calibration control register (VREFBUF_CCR) . . . . . | 438 |
| 17.3.3 | VREFBUF register map . . . . . | 439 |
| 18 | Comparator (COMP) . . . . . | 440 |
| 18.1 | Introduction . . . . . | 440 |
| 18.2 | COMP main features . . . . . | 440 |
| 18.3 | COMP functional description . . . . . | 441 |
| 18.3.1 | COMP block diagram . . . . . | 441 |
| 18.3.2 | COMP pins and internal signals . . . . . | 441 |
| 18.3.3 | COMP reset and clocks . . . . . | 443 |
| 18.3.4 | Comparator LOCK mechanism . . . . . | 443 |
| 18.3.5 | Window comparator . . . . . | 444 |
| 18.3.6 | Hysteresis . . . . . | 444 |
| 18.3.7 | Comparator output blanking function . . . . . | 445 |
| 18.3.8 | COMP power and speed modes . . . . . | 445 |
| 18.4 | COMP low-power modes . . . . . | 446 |
| 18.5 | COMP interrupts . . . . . | 446 |
| 18.6 | COMP registers . . . . . | 446 |
| 18.6.1 | Comparator 1 control and status register (COMP1_CSR) . . . . . | 446 |
| 18.6.2 | Comparator 2 control and status register (COMP2_CSR) . . . . . | 448 |
| 18.6.3 | Comparator 3 control and status register (COMP3_CSR) . . . . . | 450 |
| 18.6.4 | COMP register map . . . . . | 453 |
| 19 | True random number generator (RNG) . . . . . | 454 |
| 19.1 | Introduction . . . . . | 454 |
| 19.2 | RNG main features . . . . . | 454 |
| 19.3 | RNG functional description . . . . . | 455 |
| 19.3.1 | RNG block diagram . . . . . | 455 |
| 19.3.2 | RNG internal signals . . . . . | 455 |
| 19.3.3 | Random number generation . . . . . | 456 |
| 19.3.4 | RNG initialization . . . . . | 458 |
| 19.3.5 | RNG operation . . . . . | 459 |
| 19.3.6 | RNG clocking . . . . . | 460 |
| 19.3.7 | Error management . . . . . | 460 |
| 19.3.8 | RNG low-power use . . . . . | 461 |
| 19.4 | RNG interrupts . . . . . | 461 |
| 19.5 | RNG processing time . . . . . | 461 |
| 19.6 | RNG entropy source validation . . . . . | 462 |
| 19.6.1 | Introduction . . . . . | 462 |
| 19.6.2 | Validation conditions . . . . . | 462 |
| 19.6.3 | Data collection . . . . . | 462 |
| 19.7 | RNG registers . . . . . | 463 |
| 19.7.1 | RNG control register (RNG_CR) . . . . . | 463 |
| 19.7.2 | RNG status register (RNG_SR) . . . . . | 464 |
| 19.7.3 | RNG data register (RNG_DR) . . . . . | 465 |
| 19.7.4 | RNG register map . . . . . | 465 |
| 20 | AES hardware accelerator (AES) . . . . . | 466 |
| 20.1 | Introduction . . . . . | 466 |
| 20.2 | AES main features . . . . . | 466 |
| 20.3 | AES implementation . . . . . | 466 |
| 20.4 | AES functional description . . . . . | 467 |
| 20.4.1 | AES block diagram . . . . . | 467 |
| 20.4.2 | AES internal signals . . . . . | 467 |
| 20.4.3 | AES cryptographic core . . . . . | 467 |
| 20.4.4 | AES procedure to perform a cipher operation . . . . . | 473 |
| 20.4.5 | AES decryption round key preparation . . . . . | 476 |
| 20.4.6 | AES ciphertext stealing and data padding . . . . . | 476 |
| 20.4.7 | AES task suspend and resume . . . . . | 477 |
| 20.4.8 | AES basic chaining modes (ECB, CBC) . . . . . | 477 |
| 20.4.9 | AES counter (CTR) mode . . . . . | 482 |
| 20.4.10 | AES Galois/counter mode (GCM) . . . . . | 485 |
| 20.4.11 | AES Galois message authentication code (GMAC) . . . . . | 490 |
| 20.4.12 | AES counter with CBC-MAC (CCM) . . . . . | 492 |
| 20.4.13 | AES data registers and data swapping . . . . . | 497 |
| 20.4.14 | AES key registers . . . . . | 499 |
| 20.4.15 | AES initialization vector registers . . . . . | 499 |
| 20.4.16 | AES DMA interface . . . . . | 500 |
| 20.4.17 | AES error management . . . . . | 501 |
| 20.5 | AES interrupts . . . . . | 502 |
| 20.6 | AES processing latency . . . . . | 502 |
| 20.7 | AES registers . . . . . | 503 |
| 20.7.1 | AES control register (AES_CR) . . . . . | 503 |
| 20.7.2 | AES status register (AES_SR) . . . . . | 506 |
| 20.7.3 | AES data input register (AES_DINR) . . . . . | 507 |
| 20.7.4 | AES data output register (AES_DOUTR) . . . . . | 507 |
| 20.7.5 | AES key register 0 (AES_KEYR0) . . . . . | 508 |
| 20.7.6 | AES key register 1 (AES_KEYR1) . . . . . | 508 |
| 20.7.7 | AES key register 2 (AES_KEYR2) . . . . . | 509 |
| 20.7.8 | AES key register 3 (AES_KEYR3) . . . . . | 509 |
| 20.7.9 | AES initialization vector register 0 (AES_IVR0) . . . . . | 509 |
| 20.7.10 | AES initialization vector register 1 (AES_IVR1) . . . . . | 510 |
| 20.7.11 | AES initialization vector register 2 (AES_IVR2) . . . . . | 510 |
| 20.7.12 | AES initialization vector register 3 (AES_IVR3) . . . . . | 510 |
| 20.7.13 | AES key register 4 (AES_KEYR4) . . . . . | 511 |
| 20.7.14 | AES key register 5 (AES_KEYR5) . . . . . | 511 |
| 20.7.15 | AES key register 6 (AES_KEYR6) . . . . . | 511 |
| 20.7.16 | AES key register 7 (AES_KEYR7) . . . . . | 512 |
| 20.7.17 | AES suspend registers (AES_SUSPxR) . . . . . | 512 |
| 20.7.18 | AES register map . . . . . | 513 |
| 21 | Advanced-control timer (TIM1) . . . . . | 515 |
| 21.1 | TIM1 introduction . . . . . | 515 |
| 21.2 | TIM1 main features . . . . . | 516 |
| 21.3 | TIM1 functional description . . . . . | 518 |
| 21.3.1 | Time-base unit . . . . . | 518 |
| 21.3.2 | Counter modes . . . . . | 520 |
| 21.3.3 | Repetition counter . . . . . | 531 |
| 21.3.4 | External trigger input . . . . . | 533 |
| 21.3.5 | Clock selection . . . . . | 534 |
| 21.3.6 | Capture/compare channels . . . . . | 538 |
| 21.3.7 | Input capture mode . . . . . | 540 |
| 21.3.8 | PWM input mode . . . . . | 541 |
| 21.3.9 | Forced output mode . . . . . | 542 |
| 21.3.10 | Output compare mode . . . . . | 543 |
| 21.3.11 | PWM mode . . . . . | 544 |
| 21.3.12 | Asymmetric PWM mode . . . . . | 547 |
| 21.3.13 | Combined PWM mode . . . . . | 548 |
| 21.3.14 | Combined 3-phase PWM mode . . . . . | 549 |
| 21.3.15 | Complementary outputs and dead-time insertion . . . . . | 550 |
| 21.3.16 | Using the break function . . . . . | 552 |
| 21.3.17 | Bidirectional break inputs . . . . . | 558 |
| 21.3.18 | Clearing the OCxREF signal on an external event . . . . . | 560 |
| 21.3.19 | 6-step PWM generation . . . . . | 561 |
| 21.3.20 | One-pulse mode . . . . . | 562 |
| 21.3.21 | Retriggerable one pulse mode . . . . . | 563 |
| 21.3.22 | Encoder interface mode . . . . . | 564 |
| 21.3.23 | UIF bit remapping . . . . . | 566 |
| 21.3.24 | Timer input XOR function . . . . . | 567 |
| 21.3.25 | Interfacing with Hall sensors . . . . . | 567 |
| 21.3.26 | Timer synchronization . . . . . | 570 |
| 21.3.27 | ADC synchronization . . . . . | 574 |
| 21.3.28 | DMA burst mode . . . . . | 574 |
| 21.3.29 | Debug mode . . . . . | 575 |
| 21.4 | TIM1 registers . . . . . | 576 |
| 21.4.1 | TIM1 control register 1 (TIM1_CR1) . . . . . | 576 |
| 21.4.2 | TIM1 control register 2 (TIM1_CR2) . . . . . | 577 |
| 21.4.3 | TIM1 slave mode control register (TIM1_SMCR) . . . . . | 580 |
| 21.4.4 | TIM1 DMA/interrupt enable register (TIM1_DIER) . . . . . | 582 |
| 21.4.5 | TIM1 status register (TIM1_SR) . . . . . | 584 |
| 21.4.6 | TIM1 event generation register (TIM1_EGR) . . . . . | 586 |
| 21.4.7 | TIM1 capture/compare mode register 1 (TIM1_CCMR1) . . . . . | 587 |
| 21.4.8 | TIM1 capture/compare mode register 1 [alternate] (TIM1_CCMR1) . . . . . | 588 |
| 21.4.9 | TIM1 capture/compare mode register 2 (TIM1_CCMR2) . . . . . | 591 |
| 21.4.10 | TIM1 capture/compare mode register 2 [alternate] (TIM1_CCMR2) . . . . . | 592 |
| 21.4.11 | TIM1 capture/compare enable register (TIM1_CCER) . . . . . | 594 |
| 21.4.12 | TIM1 counter (TIM1_CNT) . . . . . | 597 |
| 21.4.13 | TIM1 prescaler (TIM1_PSC) . . . . . | 597 |
| 21.4.14 | TIM1 auto-reload register (TIM1_ARR) . . . . . | 597 |
| 21.4.15 | TIM1 repetition counter register (TIM1_RCR) . . . . . | 598 |
| 21.4.16 | TIM1 capture/compare register 1 (TIM1_CCR1) . . . . . | 598 |
| 21.4.17 | TIM1 capture/compare register 2 (TIM1_CCR2) . . . . . | 599 |
| 21.4.18 | TIM1 capture/compare register 3 (TIM1_CCR3) . . . . . | 599 |
| 21.4.19 | TIM1 capture/compare register 4 (TIM1_CCR4) . . . . . | 600 |
| 21.4.20 | TIM1 break and dead-time register (TIM1_BDTR) . . . . . | 600 |
| 21.4.21 | TIM1 DMA control register (TIM1_DCR) . . . . . | 604 |
| 21.4.22 | TIM1 DMA address for full transfer (TIM1_DMAR) . . . . . | 605 |
| 21.4.23 | TIM1 option register 1 (TIM1_OR1) . . . . . | 606 |
| 21.4.24 | TIM1 capture/compare mode register 3 (TIM1_CCMR3) . . . . . | 606 |
| 21.4.25 | TIM1 capture/compare register 5 (TIM1_CCR5) . . . . . | 607 |
| 21.4.26 | TIM1 capture/compare register 6 (TIM1_CCR6) . . . . . | 608 |
| 21.4.27 | TIM1 alternate function option register 1 (TIM1_AF1) . . . . . | 609 |
| 21.4.28 | TIM1 Alternate function register 2 (TIM1_AF2) . . . . . | 611 |
| 21.4.29 | TIM1 timer input selection register (TIM1_TISEL) . . . . . | 612 |
| 21.4.30 | TIM1 register map . . . . . | 614 |
| 22 | General-purpose timers (TIM2/TIM3/TIM4) . . . . . | 617 |
| 22.1 | TIM2/TIM3/TIM4 introduction . . . . . | 617 |
| 22.2 | TIM2/TIM3/TIM4 main features . . . . . | 617 |
| 22.3 | TIM2/TIM3/TIM4 functional description . . . . . | 619 |
| 22.3.1 | Time-base unit . . . . . | 619 |
| 22.3.2 | Counter modes . . . . . | 621 |
| 22.3.3 | Clock selection . . . . . | 631 |
| 22.3.4 | Capture/Compare channels . . . . . | 635 |
| 22.3.5 | Input capture mode . . . . . | 637 |
| 22.3.6 | PWM input mode . . . . . | 638 |
| 22.3.7 | Forced output mode . . . . . | 639 |
| 22.3.8 | Output compare mode . . . . . | 639 |
| 22.3.9 | PWM mode . . . . . | 640 |
| 22.3.10 | Asymmetric PWM mode . . . . . | 644 |
| 22.3.11 | Combined PWM mode . . . . . | 644 |
| 22.3.12 | Clearing the OCxREF signal on an external event . . . . . | 645 |
| 22.3.13 | One-pulse mode . . . . . | 647 |
| 22.3.14 | Retriggerable one pulse mode . . . . . | 648 |
| 22.3.15 | Encoder interface mode . . . . . | 649 |
| 22.3.16 | UIF bit remapping . . . . . | 651 |
| 22.3.17 | Timer input XOR function . . . . . | 651 |
| 22.3.18 | Timers and external trigger synchronization . . . . . | 652 |
| 22.3.19 | Timer synchronization . . . . . | 655 |
| 22.3.20 | DMA burst mode . . . . . | 660 |
| 22.3.21 | Debug mode . . . . . | 661 |
| 22.4 | TIM2/TIM3/TIM4 registers . . . . . | 662 |
| 22.4.1 | TIMx control register 1 (TIMx_CR1)(x = 2 to 4) . . . . . | 662 |
| 22.4.2 | TIMx control register 2 (TIMx_CR2)(x = 2 to 4) . . . . . | 663 |
| 22.4.3 | TIMx slave mode control register (TIMx_SMCR)(x = 2 to 4) . . . . . | 665 |
| 22.4.4 | TIMx DMA/Interrupt enable register (TIMx_DIER)(x = 2 to 4) . . . . . | 668 |
| 22.4.5 | TIMx status register (TIMx_SR)(x = 2 to 4) . . . . . | 669 |
| 22.4.6 | TIMx event generation register (TIMx_EGR)(x = 2 to 4) . . . . . | 671 |
| 22.4.7 | TIMx capture/compare mode register 1 (TIMx_CCMR1)(x = 2 to 4) . . . . . | 672 |
| 22.4.8 | TIMx capture/compare mode register 1 [alternate] (TIMx_CCMR1) (x = 2 to 4) . . . . . | 674 |
| 22.4.9 | TIMx capture/compare mode register 2 (TIMx_CCMR2)(x = 2 to 4) . . . . . | 676 |
| 22.4.10 | TIMx capture/compare mode register 2 [alternate] (TIMx_CCMR2) (x = 2 to 4) . . . . . | 677 |
| 22.4.11 | TIMx capture/compare enable register (TIMx_CCER)(x = 2 to 4) . . . . . | 678 |
| 22.4.12 | TIMx counter (TIMx_CNT)(x = 2 to 4) . . . . . | 679 |
| 22.4.13 | TIMx counter [alternate] (TIMx_CNT)(x = 2 to 4) . . . . . | 680 |
| 22.4.14 | TIMx prescaler (TIMx_PSC)(x = 2 to 4) . . . . . | 680 |
| 22.4.15 | TIMx auto-reload register (TIMx_ARR)(x = 2 to 4) . . . . . | 681 |
| 22.4.16 | TIMx capture/compare register 1 (TIMx_CCR1)(x = 2 to 4) . . . . . | 681 |
| 22.4.17 | TIMx capture/compare register 2 (TIMx_CCR2)(x = 2 to 4) . . . . . | 682 |
| 22.4.18 | TIMx capture/compare register 3 (TIMx_CCR3)(x = 2 to 4) . . . . . | 682 |
| 22.4.19 | TIMx capture/compare register 4 (TIMx_CCR4)(x = 2 to 4) . . . . . | 683 |
- 22.4.20 TIMx DMA control register (TIMx_DCR)(x = 2 to 4) . . . . . 684
- 22.4.21 TIMx DMA address for full transfer (TIMx_DMAR)(x = 2 to 4) . . . . . 684
- 22.4.22 TIM2 option register 1 (TIM2_OR1) . . . . . 684
- 22.4.23 TIM3 option register 1 (TIM3_OR1) . . . . . 685
- 22.4.24 TIM4 option register 1 (TIM4_OR1) . . . . . 686
- 22.4.25 TIM2 alternate function option register 1 (TIM2_AF1) . . . . . 686
- 22.4.26 TIM3 alternate function option register 1 (TIM3_AF1) . . . . . 687
- 22.4.27 TIM4 alternate function option register 1 (TIM4_AF1) . . . . . 687
- 22.4.28 TIM2 timer input selection register (TIM2_TISEL) . . . . . 688
- 22.4.29 TIM3 timer input selection register (TIM3_TISEL) . . . . . 688
- 22.4.30 TIM4 timer input selection register (TIM4_TISEL) . . . . . 689
- 22.4.31 TIMx register map . . . . . 691
23 Basic timers (TIM6/TIM7) . . . . . 694
- 23.1 TIM6/TIM7 introduction . . . . . 694
- 23.2 TIM6/TIM7 main features . . . . . 694
- 23.3 TIM6/TIM7 functional description . . . . . 695
- 23.3.1 Time-base unit . . . . . 695
- 23.3.2 Counting mode . . . . . 697
- 23.3.3 UIF bit remapping . . . . . 700
- 23.3.4 Clock source . . . . . 700
- 23.3.5 Debug mode . . . . . 701
- 23.4 TIM6/TIM7 registers . . . . . 701
- 23.4.1 TIMx control register 1 (TIMx_CR1)(x = 6 to 7) . . . . . 701
- 23.4.2 TIMx control register 2 (TIMx_CR2)(x = 6 to 7) . . . . . 703
- 23.4.3 TIMx DMA/Interrupt enable register (TIMx_DIER)(x = 6 to 7) . . . . . 703
- 23.4.4 TIMx status register (TIMx_SR)(x = 6 to 7) . . . . . 704
- 23.4.5 TIMx event generation register (TIMx_EGR)(x = 6 to 7) . . . . . 704
- 23.4.6 TIMx counter (TIMx_CNT)(x = 6 to 7) . . . . . 704
- 23.4.7 TIMx prescaler (TIMx_PSC)(x = 6 to 7) . . . . . 705
- 23.4.8 TIMx auto-reload register (TIMx_ARR)(x = 6 to 7) . . . . . 705
- 23.4.9 TIMx register map . . . . . 706
24 General-purpose timers (TIM14) . . . . . 707
- 24.1 TIM14 introduction . . . . . 707
- 24.2 TIM14 main features . . . . . 707
- 24.2.1 TIM14 main features . . . . . 707
| 24.3 | TIM14 functional description . . . . . | 709 |
| 24.3.1 | Time-base unit . . . . . | 709 |
| 24.3.2 | Counter modes . . . . . | 711 |
| 24.3.3 | Clock selection . . . . . | 714 |
| 24.3.4 | Capture/compare channels . . . . . | 715 |
| 24.3.5 | Input capture mode . . . . . | 716 |
| 24.3.6 | Forced output mode . . . . . | 717 |
| 24.3.7 | Output compare mode . . . . . | 718 |
| 24.3.8 | PWM mode . . . . . | 719 |
| 24.3.9 | One-pulse mode . . . . . | 720 |
| 24.3.10 | UIF bit remapping . . . . . | 720 |
| 24.3.11 | Using timer output as trigger for other timers (TIM14) . . . . . | 721 |
| 24.3.12 | Debug mode . . . . . | 721 |
| 24.4 | TIM14 registers . . . . . | 722 |
| 24.4.1 | TIM14 control register 1 (TIM14_CR1) . . . . . | 722 |
| 24.4.2 | TIM14 Interrupt enable register (TIM14_DIER) . . . . . | 723 |
| 24.4.3 | TIM14 status register (TIM14_SR) . . . . . | 723 |
| 24.4.4 | TIM14 event generation register (TIM14_EGR) . . . . . | 724 |
| 24.4.5 | TIM14 capture/compare mode register 1 (TIM14_CCMR1) . . . . . | 725 |
| 24.4.6 | TIM14 capture/compare mode register 1 [alternate] (TIM14_CCMR1) . . . . . | 726 |
| 24.4.7 | TIM14 capture/compare enable register (TIM14_CCER) . . . . . | 728 |
| 24.4.8 | TIM14 counter (TIM14_CNT) . . . . . | 729 |
| 24.4.9 | TIM14 prescaler (TIM14_PSC) . . . . . | 730 |
| 24.4.10 | TIM14 auto-reload register (TIM14_ARR) . . . . . | 730 |
| 24.4.11 | TIM14 capture/compare register 1 (TIM14_CCR1) . . . . . | 730 |
| 24.4.12 | TIM14 timer input selection register (TIM14_TISEL) . . . . . | 731 |
| 24.4.13 | TIM14 register map . . . . . | 731 |
| 25 | General-purpose timers (TIM15/TIM16/TIM17) . . . . . | 733 |
| 25.1 | TIM15/TIM16/TIM17 introduction . . . . . | 733 |
| 25.2 | TIM15 main features . . . . . | 733 |
| 25.3 | TIM16/TIM17 main features . . . . . | 734 |
| 25.4 | TIM15/TIM16/TIM17 functional description . . . . . | 737 |
| 25.4.1 | Time-base unit . . . . . | 737 |
| 25.4.2 | Counter modes . . . . . | 739 |
| 25.4.3 | Repetition counter . . . . . | 743 |
| 25.4.4 | Clock selection . . . . . | 744 |
| 25.4.5 | Capture/compare channels . . . . . | 746 |
| 25.4.6 | Input capture mode . . . . . | 748 |
| 25.4.7 | PWM input mode (only for TIM15) . . . . . | 749 |
| 25.4.8 | Forced output mode . . . . . | 750 |
| 25.4.9 | Output compare mode . . . . . | 751 |
| 25.4.10 | PWM mode . . . . . | 752 |
| 25.4.11 | Combined PWM mode (TIM15 only) . . . . . | 753 |
| 25.4.12 | Complementary outputs and dead-time insertion . . . . . | 754 |
| 25.4.13 | Using the break function . . . . . | 756 |
| 25.4.14 | Bidirectional break inputs . . . . . | 761 |
| 25.4.15 | 6-step PWM generation . . . . . | 762 |
| 25.4.16 | One-pulse mode . . . . . | 764 |
| 25.4.17 | Retriggerable one pulse mode (TIM15 only) . . . . . | 765 |
| 25.4.18 | UIF bit remapping . . . . . | 766 |
| 25.4.19 | Timer input XOR function (TIM15 only) . . . . . | 767 |
| 25.4.20 | External trigger synchronization (TIM15 only) . . . . . | 768 |
| 25.4.21 | Slave mode – combined reset + trigger mode . . . . . | 770 |
| 25.4.22 | DMA burst mode . . . . . | 770 |
| 25.4.23 | Timer synchronization (TIM15) . . . . . | 772 |
| 25.4.24 | Using timer output as trigger for other timers (TIM16/TIM17) . . . . . | 772 |
| 25.4.25 | Debug mode . . . . . | 772 |
| 25.5 | TIM15 registers . . . . . | 773 |
| 25.5.1 | TIM15 control register 1 (TIM15_CR1) . . . . . | 773 |
| 25.5.2 | TIM15 control register 2 (TIM15_CR2) . . . . . | 774 |
| 25.5.3 | TIM15 slave mode control register (TIM15_SMCR) . . . . . | 776 |
| 25.5.4 | TIM15 DMA/interrupt enable register (TIM15_DIER) . . . . . | 777 |
| 25.5.5 | TIM15 status register (TIM15_SR) . . . . . | 778 |
| 25.5.6 | TIM15 event generation register (TIM15_EGR) . . . . . | 780 |
| 25.5.7 | TIM15 capture/compare mode register 1 (TIM15_CCMR1) . . . . . | 781 |
| 25.5.8 | TIM15 capture/compare mode register 1 [alternate] (TIM15_CCMR1) . . . . . | 782 |
| 25.5.9 | TIM15 capture/compare enable register (TIM15_CCER) . . . . . | 785 |
| 25.5.10 | TIM15 counter (TIM15_CNT) . . . . . | 788 |
| 25.5.11 | TIM15 prescaler (TIM15_PSC) . . . . . | 788 |
| 25.5.12 | TIM15 auto-reload register (TIM15_ARR) . . . . . | 788 |
| 25.5.13 | TIM15 repetition counter register (TIM15_RCR) . . . . . | 789 |
| 25.5.14 | TIM15 capture/compare register 1 (TIM15_CCR1) . . . . . | 789 |
| 25.5.15 | TIM15 capture/compare register 2 (TIM15_CCR2) . . . . . | 790 |
| 25.5.16 | TIM15 break and dead-time register (TIM15_BDTR) . . . . . | 790 |
| 25.5.17 | TIM15 DMA control register (TIM15_DCR) . . . . . | 793 |
| 25.5.18 | TIM15 DMA address for full transfer (TIM15_DMAR) . . . . . | 793 |
| 25.5.19 | TIM15 alternate register 1 (TIM15_AF1) . . . . . | 794 |
| 25.5.20 | TIM15 input selection register (TIM15_TISEL) . . . . . | 795 |
| 25.5.21 | TIM15 register map . . . . . | 796 |
| 25.6 | TIM16/TIM17 registers . . . . . | 799 |
| 25.6.1 | TIMx control register 1 (TIMx_CR1)(x = 16 to 17) . . . . . | 799 |
| 25.6.2 | TIMx control register 2 (TIMx_CR2)(x = 16 to 17) . . . . . | 800 |
| 25.6.3 | TIMx DMA/interrupt enable register (TIMx_DIER)(x = 16 to 17) . . . . . | 801 |
| 25.6.4 | TIMx status register (TIMx_SR)(x = 16 to 17) . . . . . | 802 |
| 25.6.5 | TIMx event generation register (TIMx_EGR)(x = 16 to 17) . . . . . | 803 |
| 25.6.6 | TIMx capture/compare mode register 1 (TIMx_CCMR1)(x = 16 to 17) . . . . . | 804 |
| 25.6.7 | TIMx capture/compare mode register 1 [alternate] (TIMx_CCMR1)(x = 16 to 17) . . . . . | 805 |
| 25.6.8 | TIMx capture/compare enable register (TIMx_CCER)(x = 16 to 17) . . . . . | 807 |
| 25.6.9 | TIMx counter (TIMx_CNT)(x = 16 to 17) . . . . . | 809 |
| 25.6.10 | TIMx prescaler (TIMx_PSC)(x = 16 to 17) . . . . . | 810 |
| 25.6.11 | TIMx auto-reload register (TIMx_ARR)(x = 16 to 17) . . . . . | 810 |
| 25.6.12 | TIMx repetition counter register (TIMx_RCR)(x = 16 to 17) . . . . . | 811 |
| 25.6.13 | TIMx capture/compare register 1 (TIMx_CCR1)(x = 16 to 17) . . . . . | 811 |
| 25.6.14 | TIMx break and dead-time register (TIMx_BDTR)(x = 16 to 17) . . . . . | 812 |
| 25.6.15 | TIMx DMA control register (TIMx_DCR)(x = 16 to 17) . . . . . | 815 |
| 25.6.16 | TIMx DMA address for full transfer (TIMx_DMAR)(x = 16 to 17) . . . . . | 815 |
| 25.6.17 | TIM16 alternate function register 1 (TIM16_AF1) . . . . . | 816 |
| 25.6.18 | TIM16 input selection register (TIM16_TISEL) . . . . . | 817 |
| 25.6.19 | TIM17 alternate function register 1 (TIM17_AF1) . . . . . | 818 |
| 25.6.20 | TIM17 input selection register (TIM17_TISEL) . . . . . | 819 |
| 25.6.21 | TIM16/TIM17 register map . . . . . | 821 |
| 26 | Low-power timer (LPTIM) . . . . . | 823 |
| 26.1 | Introduction . . . . . | 823 |
| 26.2 | LPTIM main features . . . . . | 823 |
| 26.3 | LPTIM implementation . . . . . | 824 |
- 26.4 LPTIM functional description . . . . . 824
- 26.4.1 LPTIM block diagram . . . . . 824
- 26.4.2 LPTIM pins and internal signals . . . . . 825
- 26.4.3 LPTIM input and trigger mapping . . . . . 825
- 26.4.4 LPTIM reset and clocks . . . . . 827
- 26.4.5 Glitch filter . . . . . 827
- 26.4.6 Prescaler . . . . . 828
- 26.4.7 Trigger multiplexer . . . . . 828
- 26.4.8 Operating mode . . . . . 829
- 26.4.9 Timeout function . . . . . 831
- 26.4.10 Waveform generation . . . . . 831
- 26.4.11 Register update . . . . . 832
- 26.4.12 Counter mode . . . . . 833
- 26.4.13 Timer enable . . . . . 833
- 26.4.14 Timer counter reset . . . . . 834
- 26.4.15 Encoder mode . . . . . 834
- 26.4.16 Debug mode . . . . . 836
- 26.5 LPTIM low-power modes . . . . . 836
- 26.6 LPTIM interrupts . . . . . 837
- 26.7 LPTIM registers . . . . . 837
- 26.7.1 LPTIM interrupt and status register (LPTIM_ISR) . . . . . 838
- 26.7.2 LPTIM interrupt clear register (LPTIM_ICR) . . . . . 839
- 26.7.3 LPTIM interrupt enable register (LPTIM_IER) . . . . . 839
- 26.7.4 LPTIM configuration register (LPTIM_CFGGR) . . . . . 840
- 26.7.5 LPTIM control register (LPTIM_CR) . . . . . 843
- 26.7.6 LPTIM compare register (LPTIM_CMP) . . . . . 845
- 26.7.7 LPTIM autoreload register (LPTIM_ARR) . . . . . 845
- 26.7.8 LPTIM counter register (LPTIM_CNT) . . . . . 846
- 26.7.9 LPTIM configuration register 2 (LPTIM_CFGGR2) . . . . . 846
- 26.7.10 LPTIM register map . . . . . 848
- 27 Infrared interface (IRTIM) . . . . . 849
- 28 Independent watchdog (IWDG) . . . . . 850
- 28.1 Introduction . . . . . 850
- 28.2 IWDG main features . . . . . 850
| 28.3 | IWDG functional description . . . . . | 850 |
| 28.3.1 | IWDG block diagram . . . . . | 850 |
| 28.3.2 | Window option . . . . . | 851 |
| 28.3.3 | Hardware watchdog . . . . . | 852 |
| 28.3.4 | Register access protection . . . . . | 852 |
| 28.3.5 | Debug mode . . . . . | 852 |
| 28.4 | IWDG registers . . . . . | 853 |
| 28.4.1 | IWDG key register (IWDG_KR) . . . . . | 853 |
| 28.4.2 | IWDG prescaler register (IWDG_PR) . . . . . | 854 |
| 28.4.3 | IWDG reload register (IWDG_RLR) . . . . . | 855 |
| 28.4.4 | IWDG status register (IWDG_SR) . . . . . | 856 |
| 28.4.5 | IWDG window register (IWDG_WINR) . . . . . | 857 |
| 28.4.6 | IWDG register map . . . . . | 858 |
| 29 | System window watchdog (WWDG) . . . . . | 859 |
| 29.1 | Introduction . . . . . | 859 |
| 29.2 | WWDG main features . . . . . | 859 |
| 29.3 | WWDG functional description . . . . . | 859 |
| 29.3.1 | WWDG block diagram . . . . . | 860 |
| 29.3.2 | Enabling the watchdog . . . . . | 860 |
| 29.3.3 | Controlling the down-counter . . . . . | 860 |
| 29.3.4 | How to program the watchdog timeout . . . . . | 860 |
| 29.3.5 | Debug mode . . . . . | 862 |
| 29.4 | WWDG interrupts . . . . . | 862 |
| 29.5 | WWDG registers . . . . . | 862 |
| 29.5.1 | WWDG control register (WWDG_CR) . . . . . | 862 |
| 29.5.2 | WWDG configuration register (WWDG_CFR) . . . . . | 863 |
| 29.5.3 | WWDG status register (WWDG_SR) . . . . . | 864 |
| 29.5.4 | WWDG register map . . . . . | 864 |
| 30 | Real-time clock (RTC) . . . . . | 865 |
| 30.1 | Introduction . . . . . | 865 |
| 30.2 | RTC main features . . . . . | 865 |
| 30.3 | RTC functional description . . . . . | 866 |
| 30.3.1 | RTC block diagram . . . . . | 866 |
| 30.3.2 | RTC pins and internal signals . . . . . | 867 |
| 30.3.3 | GPIOs controlled by the RTC and TAMP . . . . . | 868 |
| 30.3.4 | Clock and prescalers . . . . . | 870 |
| 30.3.5 | Real-time clock and calendar . . . . . | 871 |
| 30.3.6 | Programmable alarms . . . . . | 872 |
| 30.3.7 | Periodic auto-wake-up . . . . . | 872 |
| 30.3.8 | RTC initialization and configuration . . . . . | 873 |
| 30.3.9 | Reading the calendar . . . . . | 875 |
| 30.3.10 | Resetting the RTC . . . . . | 876 |
| 30.3.11 | RTC synchronization . . . . . | 876 |
| 30.3.12 | RTC reference clock detection . . . . . | 877 |
| 30.3.13 | RTC smooth digital calibration . . . . . | 877 |
| 30.3.14 | Timestamp function . . . . . | 879 |
| 30.3.15 | Calibration clock output . . . . . | 880 |
| 30.3.16 | Tamper and alarm output . . . . . | 880 |
| 30.4 | RTC low-power modes . . . . . | 881 |
| 30.5 | RTC interrupts . . . . . | 882 |
| 30.6 | RTC registers . . . . . | 882 |
| 30.6.1 | RTC time register (RTC_TR) . . . . . | 882 |
| 30.6.2 | RTC date register (RTC_DR) . . . . . | 883 |
| 30.6.3 | RTC sub second register (RTC_SSR) . . . . . | 884 |
| 30.6.4 | RTC initialization control and status register (RTC_ICSR) . . . . . | 884 |
| 30.6.5 | RTC prescaler register (RTC_PRER) . . . . . | 886 |
| 30.6.6 | RTC wake-up timer register (RTC_WUTR) . . . . . | 887 |
| 30.6.7 | RTC control register (RTC_CR) . . . . . | 887 |
| 30.6.8 | RTC write protection register (RTC_WPR) . . . . . | 890 |
| 30.6.9 | RTC calibration register (RTC_CALR) . . . . . | 891 |
| 30.6.10 | RTC shift control register (RTC_SHIFT) . . . . . | 892 |
| 30.6.11 | RTC timestamp time register (RTC_TSTR) . . . . . | 893 |
| 30.6.12 | RTC timestamp date register (RTC_TSDR) . . . . . | 893 |
| 30.6.13 | RTC timestamp sub second register (RTC_TSSSR) . . . . . | 894 |
| 30.6.14 | RTC alarm A register (RTC_ALRMAR) . . . . . | 895 |
| 30.6.15 | RTC alarm A sub second register (RTC_ALRMASSR) . . . . . | 896 |
| 30.6.16 | RTC alarm B register (RTC_ALRMBR) . . . . . | 897 |
| 30.6.17 | RTC alarm B sub second register (RTC_ALRMBSSR) . . . . . | 898 |
| 30.6.18 | RTC status register (RTC_SR) . . . . . | 898 |
| 30.6.19 | RTC masked interrupt status register (RTC_MISR) . . . . . | 899 |
| 30.6.20 | RTC status clear register (RTC_SCR) . . . . . | 900 |
| 30.6.21 | RTC register map ..... | 902 |
| 31 | Tamper and backup registers (TAMP) ..... | 904 |
| 31.1 | Introduction ..... | 904 |
| 31.2 | TAMP main features ..... | 904 |
| 31.3 | TAMP functional description ..... | 905 |
| 31.3.1 | TAMP block diagram ..... | 905 |
| 31.3.2 | TAMP pins and internal signals ..... | 906 |
| 31.3.3 | TAMP register write protection ..... | 906 |
| 31.3.4 | Tamper detection ..... | 907 |
| 31.4 | TAMP low-power modes ..... | 909 |
| 31.5 | TAMP interrupts ..... | 909 |
| 31.6 | TAMP registers ..... | 909 |
| 31.6.1 | TAMP control register 1 (TAMP_CR1) ..... | 910 |
| 31.6.2 | TAMP control register 2 (TAMP_CR2) ..... | 911 |
| 31.6.3 | TAMP filter control register (TAMP_FLTCR) ..... | 912 |
| 31.6.4 | TAMP interrupt enable register (TAMP_IER) ..... | 913 |
| 31.6.5 | TAMP status register (TAMP_SR) ..... | 914 |
| 31.6.6 | TAMP masked interrupt status register (TAMP_MISR) ..... | 915 |
| 31.6.7 | TAMP status clear register (TAMP_SCR) ..... | 916 |
| 31.6.8 | TAMP backup x register (TAMP_BKPxR) ..... | 917 |
| 31.6.9 | TAMP register map ..... | 918 |
| 32 | Inter-integrated circuit interface (I2C) ..... | 919 |
| 32.1 | Introduction ..... | 919 |
| 32.2 | I2C main features ..... | 919 |
| 32.3 | I2C implementation ..... | 920 |
| 32.4 | I2C functional description ..... | 920 |
| 32.4.1 | I2C block diagram ..... | 921 |
| 32.4.2 | I2C pins and internal signals ..... | 922 |
| 32.4.3 | I2C clock requirements ..... | 922 |
| 32.4.4 | I2C mode selection ..... | 922 |
| 32.4.5 | I2C initialization ..... | 923 |
| 32.4.6 | I2C reset ..... | 927 |
| 32.4.7 | I2C data transfer ..... | 928 |
| 32.4.8 | I2C target mode ..... | 930 |
| 32.4.9 | I2C controller mode . . . . . | 939 |
| 32.4.10 | I2C_TIMINGR register configuration examples . . . . . | 950 |
| 32.4.11 | SMBus specific features . . . . . | 952 |
| 32.4.12 | SMBus initialization . . . . . | 955 |
| 32.4.13 | SMBus I2C_TIMEOUTR register configuration examples . . . . . | 957 |
| 32.4.14 | SMBus target mode . . . . . | 958 |
| 32.4.15 | SMBus controller mode . . . . . | 961 |
| 32.4.16 | Wake-up from Stop mode on address match . . . . . | 964 |
| 32.4.17 | Error conditions . . . . . | 965 |
| 32.5 | I2C in low-power modes . . . . . | 967 |
| 32.6 | I2C interrupts . . . . . | 967 |
| 32.7 | I2C DMA requests . . . . . | 968 |
| 32.7.1 | Transmission using DMA . . . . . | 968 |
| 32.7.2 | Reception using DMA . . . . . | 968 |
| 32.8 | I2C debug modes . . . . . | 969 |
| 32.9 | I2C registers . . . . . | 969 |
| 32.9.1 | I2C control register 1 (I2C_CR1) . . . . . | 969 |
| 32.9.2 | I2C control register 2 (I2C_CR2) . . . . . | 972 |
| 32.9.3 | I2C own address 1 register (I2C_OAR1) . . . . . | 974 |
| 32.9.4 | I2C own address 2 register (I2C_OAR2) . . . . . | 975 |
| 32.9.5 | I2C timing register (I2C_TIMINGR) . . . . . | 976 |
| 32.9.6 | I2C timeout register (I2C_TIMEOUTR) . . . . . | 977 |
| 32.9.7 | I2C interrupt and status register (I2C_ISR) . . . . . | 978 |
| 32.9.8 | I2C interrupt clear register (I2C_ICR) . . . . . | 980 |
| 32.9.9 | I2C PEC register (I2C_PECR) . . . . . | 981 |
| 32.9.10 | I2C receive data register (I2C_RXDR) . . . . . | 981 |
| 32.9.11 | I2C transmit data register (I2C_TXDR) . . . . . | 982 |
| 32.9.12 | I2C register map . . . . . | 983 |
| 33 | Universal synchronous receiver transmitter (USART) . . . . . | 984 |
| 33.1 | USART introduction . . . . . | 984 |
| 33.2 | USART main features . . . . . | 985 |
| 33.3 | USART extended features . . . . . | 986 |
| 33.4 | USART implementation . . . . . | 986 |
| 33.5 | USART functional description . . . . . | 988 |
| 33.5.1 | USART block diagram . . . . . | 988 |
| 33.5.2 | USART signals . . . . . | 989 |
| 33.5.3 | USART character description . . . . . | 990 |
| 33.5.4 | USART FIFOs and thresholds . . . . . | 992 |
| 33.5.5 | USART transmitter . . . . . | 992 |
| 33.5.6 | USART receiver . . . . . | 996 |
| 33.5.7 | USART baud rate generation . . . . . | 1003 |
| 33.5.8 | Tolerance of the USART receiver to clock deviation . . . . . | 1004 |
| 33.5.9 | USART auto baud rate detection . . . . . | 1006 |
| 33.5.10 | USART multiprocessor communication . . . . . | 1008 |
| 33.5.11 | USART Modbus communication . . . . . | 1010 |
| 33.5.12 | USART parity control . . . . . | 1011 |
| 33.5.13 | USART LIN (local interconnection network) mode . . . . . | 1012 |
| 33.5.14 | USART synchronous mode . . . . . | 1014 |
| 33.5.15 | USART single-wire half-duplex communication . . . . . | 1018 |
| 33.5.16 | USART receiver timeout . . . . . | 1018 |
| 33.5.17 | USART smartcard mode . . . . . | 1019 |
| 33.5.18 | USART IrDA SIR ENDEC block . . . . . | 1023 |
| 33.5.19 | Continuous communication using USART and DMA . . . . . | 1026 |
| 33.5.20 | RS232 hardware flow control and RS485 Driver Enable . . . . . | 1028 |
| 33.5.21 | USART low-power management . . . . . | 1031 |
| 33.6 | USART in low-power modes . . . . . | 1034 |
| 33.7 | USART interrupts . . . . . | 1035 |
| 33.8 | USART registers . . . . . | 1036 |
| 33.8.1 | USART control register 1 (USART_CR1) . . . . . | 1036 |
| 33.8.2 | USART control register 1 [alternate] (USART_CR1) . . . . . | 1039 |
| 33.8.3 | USART control register 2 (USART_CR2) . . . . . | 1043 |
| 33.8.4 | USART control register 3 (USART_CR3) . . . . . | 1047 |
| 33.8.5 | USART baud rate register (USART_BRR) . . . . . | 1051 |
| 33.8.6 | USART guard time and prescaler register (USART_GTPR) . . . . . | 1051 |
| 33.8.7 | USART receiver timeout register (USART_RTOR) . . . . . | 1052 |
| 33.8.8 | USART request register (USART_RQR) . . . . . | 1053 |
| 33.8.9 | USART interrupt and status register (USART_ISR) . . . . . | 1054 |
| 33.8.10 | USART interrupt and status register [alternate] (USART_ISR) . . . . . | 1060 |
| 33.8.11 | USART interrupt flag clear register (USART_ICR) . . . . . | 1065 |
| 33.8.12 | USART receive data register (USART_RDR) . . . . . | 1067 |
| 33.8.13 | USART transmit data register (USART_TDR) . . . . . | 1067 |
| 33.8.14 | USART prescaler register (USART_PRESC) . . . . . | 1068 |
| 33.8.15 | USART register map . . . . . | 1069 |
| 34 | Low-power universal asynchronous receiver transmitter (LPUART) . . . . . | 1071 |
| 34.1 | LPUART introduction . . . . . | 1071 |
| 34.2 | LPUART main features . . . . . | 1072 |
| 34.3 | LPUART implementation . . . . . | 1073 |
| 34.4 | LPUART functional description . . . . . | 1074 |
| 34.4.1 | LPUART block diagram . . . . . | 1074 |
| 34.4.2 | LPUART signals . . . . . | 1075 |
| 34.4.3 | LPUART character description . . . . . | 1076 |
| 34.4.4 | LPUART FIFOs and thresholds . . . . . | 1077 |
| 34.4.5 | LPUART transmitter . . . . . | 1078 |
| 34.4.6 | LPUART receiver . . . . . | 1081 |
| 34.4.7 | LPUART baud rate generation . . . . . | 1085 |
| 34.4.8 | Tolerance of the LPUART receiver to clock deviation . . . . . | 1086 |
| 34.4.9 | LPUART multiprocessor communication . . . . . | 1087 |
| 34.4.10 | LPUART parity control . . . . . | 1089 |
| 34.4.11 | LPUART single-wire half-duplex communication . . . . . | 1090 |
| 34.4.12 | Continuous communication using DMA and LPUART . . . . . | 1090 |
| 34.4.13 | RS232 hardware flow control and RS485 Driver Enable . . . . . | 1093 |
| 34.4.14 | LPUART low-power management . . . . . | 1095 |
| 34.5 | LPUART in low-power modes . . . . . | 1098 |
| 34.6 | LPUART interrupts . . . . . | 1099 |
| 34.7 | LPUART registers . . . . . | 1100 |
| 34.7.1 | LPUART control register 1 (LPUART_CR1) . . . . . | 1100 |
| 34.7.2 | LPUART control register 1 [alternate] (LPUART_CR1) . . . . . | 1103 |
| 34.7.3 | LPUART control register 2 (LPUART_CR2) . . . . . | 1106 |
| 34.7.4 | LPUART control register 3 (LPUART_CR3) . . . . . | 1108 |
| 34.7.5 | LPUART baud rate register (LPUART_BRR) . . . . . | 1111 |
| 34.7.6 | LPUART request register (LPUART_RQR) . . . . . | 1111 |
| 34.7.7 | LPUART interrupt and status register (LPUART_ISR) . . . . . | 1112 |
| 34.7.8 | LPUART interrupt and status register [alternate] (LPUART_ISR) . . . . . | 1116 |
| 34.7.9 | LPUART interrupt flag clear register (LPUART_ICR) . . . . . | 1119 |
| 34.7.10 | LPUART receive data register (LPUART_RDR) . . . . . | 1120 |
| 34.7.11 | LPUART transmit data register (LPUART_TDR) . . . . . | 1120 |
| 34.7.12 | LPUART prescaler register (LPUART_PRESC) ..... | 1121 |
| 34.7.13 | LPUART register map ..... | 1122 |
| 35 | Serial peripheral interface / integrated interchip sound (SPI/I2S) . | 1124 |
| 35.1 | Introduction ..... | 1124 |
| 35.2 | SPI main features ..... | 1124 |
| 35.3 | I2S main features ..... | 1125 |
| 35.4 | SPI/I2S implementation ..... | 1125 |
| 35.5 | SPI functional description ..... | 1126 |
| 35.5.1 | General description ..... | 1126 |
| 35.5.2 | Communications between one master and one slave ..... | 1127 |
| 35.5.3 | Standard multislave communication ..... | 1129 |
| 35.5.4 | Multimaster communication ..... | 1130 |
| 35.5.5 | Slave select (NSS) pin management ..... | 1131 |
| 35.5.6 | Communication formats ..... | 1132 |
| 35.5.7 | Configuration of SPI ..... | 1134 |
| 35.5.8 | Procedure for enabling SPI ..... | 1135 |
| 35.5.9 | Data transmission and reception procedures ..... | 1135 |
| 35.5.10 | SPI status flags ..... | 1145 |
| 35.5.11 | SPI error flags ..... | 1146 |
| 35.5.12 | NSS pulse mode ..... | 1147 |
| 35.5.13 | TI mode ..... | 1147 |
| 35.5.14 | CRC calculation ..... | 1148 |
| 35.6 | SPI interrupts ..... | 1150 |
| 35.7 | I2S functional description ..... | 1151 |
| 35.7.1 | I2S general description ..... | 1151 |
| 35.7.2 | Supported audio protocols ..... | 1152 |
| 35.7.3 | Start-up description ..... | 1159 |
| 35.7.4 | Clock generator ..... | 1161 |
| 35.7.5 | I 2 S master mode ..... | 1164 |
| 35.7.6 | I 2 S slave mode ..... | 1165 |
| 35.7.7 | I2S status flags ..... | 1167 |
| 35.7.8 | I2S error flags ..... | 1168 |
| 35.7.9 | DMA features ..... | 1169 |
| 35.8 | I2S interrupts ..... | 1169 |
| 35.9 | SPI and I2S registers ..... | 1170 |
- 35.9.1 SPI control register 1 (SPIx_CR1) . . . . . 1170
- 35.9.2 SPI control register 2 (SPIx_CR2) . . . . . 1172
- 35.9.3 SPI status register (SPIx_SR) . . . . . 1174
- 35.9.4 SPI data register (SPIx_DR) . . . . . 1176
- 35.9.5 SPI CRC polynomial register (SPIx_CRCPR) . . . . . 1176
- 35.9.6 SPI Rx CRC register (SPIx_RXCRCR) . . . . . 1176
- 35.9.7 SPI Tx CRC register (SPIx_TXCRCR) . . . . . 1177
- 35.9.8 SPIx_I2S configuration register (SPIx_I2SCFGR) . . . . . 1177
- 35.9.9 SPIx_I2S prescaler register (SPIx_I2SPR) . . . . . 1179
- 35.9.10 SPI/I2S register map . . . . . 1181
- 36 FD controller area network (FDCAN) . . . . . 1182
- 36.1 Introduction . . . . . 1182
- 36.2 FDCAN main features . . . . . 1184
- 36.3 FDCAN functional description . . . . . 1185
- 36.3.1 FDCAN block diagram . . . . . 1185
- 36.3.2 FDCAN pins and internal signals . . . . . 1186
- 36.3.3 Bit timing . . . . . 1187
- 36.3.4 Operating modes . . . . . 1188
- 36.3.5 Error management . . . . . 1197
- 36.3.6 Message RAM . . . . . 1198
- 36.3.7 FIFO acknowledge handling . . . . . 1207
- 36.3.8 FDCAN Rx FIFO element . . . . . 1207
- 36.3.9 FDCAN Tx buffer element . . . . . 1209
- 36.3.10 FDCAN Tx event FIFO element . . . . . 1211
- 36.3.11 FDCAN standard message ID filter element . . . . . 1212
- 36.3.12 FDCAN extended message ID filter element . . . . . 1213
- 36.4 FDCAN registers . . . . . 1215
- 36.4.1 FDCAN core release register (FDCAN_CREL) . . . . . 1215
- 36.4.2 FDCAN endian register (FDCAN_ENDN) . . . . . 1215
- 36.4.3 FDCAN data bit timing and prescaler register (FDCAN_DBTP) . . . . . 1215
- 36.4.4 FDCAN test register (FDCAN_TEST) . . . . . 1216
- 36.4.5 FDCAN RAM watchdog register (FDCAN_RWD) . . . . . 1217
- 36.4.6 FDCAN CC control register (FDCAN_CCCR) . . . . . 1218
- 36.4.7 FDCAN nominal bit timing and prescaler register (FDCAN_NBTP) . . . . . 1219
- 36.4.8 FDCAN timestamp counter configuration register (FDCAN_TSCC) . . . . . 1221
- 36.4.9 FDCAN timestamp counter value register (FDCAN_TSCV) . . . . . 1221
| 36.4.10 | FDCAN timeout counter configuration register (FDCAN_TOCC) . . . | 1222 |
| 36.4.11 | FDCAN timeout counter value register (FDCAN_TOCV) . . . . . | 1223 |
| 36.4.12 | FDCAN error counter register (FDCAN_ECR) . . . . . | 1223 |
| 36.4.13 | FDCAN protocol status register (FDCAN_PSR) . . . . . | 1224 |
| 36.4.14 | FDCAN transmitter delay compensation register (FDCAN_TDCR) . . | 1226 |
| 36.4.15 | FDCAN interrupt register (FDCAN_IR) . . . . . | 1226 |
| 36.4.16 | FDCAN interrupt enable register (FDCAN_IE) . . . . . | 1229 |
| 36.4.17 | FDCAN interrupt line select register (FDCAN_ILS) . . . . . | 1231 |
| 36.4.18 | FDCAN interrupt line enable register (FDCAN_ILE) . . . . . | 1232 |
| 36.4.19 | FDCAN global filter configuration register (FDCAN_RXGFC) . . . . . | 1232 |
| 36.4.20 | FDCAN extended ID and mask register (FDCAN_XIDAM) . . . . . | 1234 |
| 36.4.21 | FDCAN high-priority message status register (FDCAN_HPMS) . . . . | 1234 |
| 36.4.22 | FDCAN Rx FIFO 0 status register (FDCAN_RXF0S) . . . . . | 1235 |
| 36.4.23 | CAN Rx FIFO 0 acknowledge register (FDCAN_RXF0A) . . . . . | 1236 |
| 36.4.24 | FDCAN Rx FIFO 1 status register (FDCAN_RXF1S) . . . . . | 1236 |
| 36.4.25 | FDCAN Rx FIFO 1 acknowledge register (FDCAN_RXF1A) . . . . . | 1237 |
| 36.4.26 | FDCAN Tx buffer configuration register (FDCAN_TXBC) . . . . . | 1237 |
| 36.4.27 | FDCAN Tx FIFO/queue status register (FDCAN_TXFQS) . . . . . | 1238 |
| 36.4.28 | FDCAN Tx buffer request pending register (FDCAN_TXBRP) . . . . . | 1238 |
| 36.4.29 | FDCAN Tx buffer add request register (FDCAN_TXBAR) . . . . . | 1239 |
| 36.4.30 | FDCAN Tx buffer cancellation request register (FDCAN_TXBCR) . . | 1240 |
| 36.4.31 | FDCAN Tx buffer transmission occurred register (FDCAN_TXBTO) | 1240 |
| 36.4.32 | FDCAN Tx buffer cancellation finished register (FDCAN_TXBCF) . . | 1241 |
| 36.4.33 | FDCAN Tx buffer transmission interrupt enable register (FDCAN_TXBTIE) . . . . . | 1241 |
| 36.4.34 | FDCAN Tx buffer cancellation finished interrupt enable register (FDCAN_TXBCIE) . . . . . | 1242 |
| 36.4.35 | FDCAN Tx event FIFO status register (FDCAN_TXEFS) . . . . . | 1242 |
| 36.4.36 | FDCAN Tx event FIFO acknowledge register (FDCAN_TXEFA) . . . | 1243 |
| 36.4.37 | FDCAN CFG clock divider register (FDCAN_CKDIV) . . . . . | 1243 |
| 36.4.38 | FDCAN register map . . . . . | 1244 |
| 37 | Universal serial bus full-speed host/device interface (USB) . . . . . | 1248 |
| 37.1 | Introduction . . . . . | 1248 |
| 37.2 | USB main features . . . . . | 1248 |
| 37.3 | USB implementation . . . . . | 1248 |
| 37.4 | USB functional description . . . . . | 1249 |
- 37.4.1 USB block diagram . . . . . 1249
- 37.4.2 USB pins and internal signals . . . . . 1249
- 37.4.3 USB reset and clocks . . . . . 1250
- 37.4.4 General description and Device mode functionality . . . . . 1250
- 37.4.5 Description of USB blocks used in both Device and Host modes . . . 1251
- 37.4.6 Description of host frame scheduler (HFS) specific to Host mode . . 1252
- 37.5 Programming considerations for Device and Host modes . . . . . 1253
- 37.5.1 Generic USB Device programming . . . . . 1253
- 37.5.2 System and power-on reset . . . . . 1254
- 37.5.3 Double-buffered endpoints and usage in Device mode . . . . . 1261
- 37.5.4 Double buffered channels: usage in Host mode . . . . . 1263
- 37.5.5 Isochronous transfers in Device mode . . . . . 1264
- 37.5.6 Isochronous transfers in Host mode . . . . . 1265
- 37.5.7 Suspend/resume events . . . . . 1266
- 37.6 USB registers . . . . . 1270
- 37.6.1 USB control register (USB_CNTR) . . . . . 1270
- 37.6.2 USB interrupt status register (USB_ISTR) . . . . . 1273
- 37.6.3 USB frame number register (USB_FNR) . . . . . 1276
- 37.6.4 USB Device address (USB_DADDR) . . . . . 1277
- 37.6.5 USB LPM control and status register (USB_LPMCSR) . . . . . 1278
- 37.6.6 USB battery charging detector (USB_BCDR) . . . . . 1278
- 37.6.7 USB endpoint/channel n register (USB_CHEPnR) . . . . . 1280
- 37.6.8 USB register map . . . . . 1289
- 37.7 USBSRAM registers . . . . . 1290
- 37.7.1 Channel/endpoint transmit buffer descriptor n
(USB_CHEP_TXRXBD_n) . . . . . 1291 - 37.7.2 Channel/endpoint receive buffer descriptor n [alternate]
(USB_CHEP_TXRXBD_n) . . . . . 1291 - 37.7.3 Channel/endpoint receive buffer descriptor n
(USB_CHEP_RXTXBD_n) . . . . . 1293 - 37.7.4 Channel/endpoint transmit buffer descriptor n [alternate]
(USB_CHEP_RXTXBD_n) . . . . . 1294 - 37.7.5 USBSRAM register map . . . . . 1295
- 37.7.1 Channel/endpoint transmit buffer descriptor n
- 38 USB Type-C
®
/USB Power Delivery interface (UCPD) . . . . . 1296
- 38.1 Introduction . . . . . 1296
- 38.2 UCPD main features . . . . . 1296
- 38.3 UCPD implementation . . . . . 1297
| 38.4 | UCPD functional description . . . . . | 1297 |
| 38.4.1 | UCPD block diagram . . . . . | 1298 |
| 38.4.2 | UCPD reset and clocks . . . . . | 1299 |
| 38.4.3 | Physical layer protocol . . . . . | 1300 |
| 38.4.4 | UCPD BMC transmitter . . . . . | 1306 |
| 38.4.5 | UCPD BMC receiver . . . . . | 1308 |
| 38.4.6 | UCPD Type-C pull-ups (Rp) and pull-downs (Rd) . . . . . | 1309 |
| 38.4.7 | UCPD Type-C voltage monitoring and de-bouncing . . . . . | 1310 |
| 38.4.8 | UCPD fast role swap (FRS) . . . . . | 1310 |
| 38.4.9 | UCPD DMA Interface . . . . . | 1310 |
| 38.4.10 | Wake-up from Stop mode . . . . . | 1310 |
| 38.5 | UCPD programming sequences . . . . . | 1311 |
| 38.5.1 | Initialization phase . . . . . | 1311 |
| 38.5.2 | Type-C state machine handling . . . . . | 1311 |
| 38.5.3 | USB PD transmit . . . . . | 1313 |
| 38.5.4 | USB PD receive . . . . . | 1314 |
| 38.6 | UCPD low-power modes . . . . . | 1315 |
| 38.7 | UCPD interrupts . . . . . | 1316 |
| 38.8 | UCPD registers . . . . . | 1317 |
| 38.8.1 | UCPD configuration register 1 (UCPD_CFGR1) . . . . . | 1317 |
| 38.8.2 | UCPD configuration register 2 (UCPD_CFGR2) . . . . . | 1319 |
| 38.8.3 | UCPD control register (UCPD_CR) . . . . . | 1320 |
| 38.8.4 | UCPD interrupt mask register (UCPD_IMR) . . . . . | 1322 |
| 38.8.5 | UCPD status register (UCPD_SR) . . . . . | 1324 |
| 38.8.6 | UCPD interrupt clear register (UCPD_ICR) . . . . . | 1327 |
| 38.8.7 | UCPD Tx ordered set type register (UCPD_TX_ORDSETR) . . . . . | 1328 |
| 38.8.8 | UCPD Tx payload size register (UCPD_TX_PAYSZR) . . . . . | 1328 |
| 38.8.9 | UCPD Tx data register (UCPD_TXDR) . . . . . | 1329 |
| 38.8.10 | UCPD Rx ordered set register (UCPD_RX_ORDSETR) . . . . . | 1329 |
| 38.8.11 | UCPD Rx payload size register (UCPD_RX_PAYSZR) . . . . . | 1330 |
| 38.8.12 | UCPD receive data register (UCPD_RXDR) . . . . . | 1331 |
| 38.8.13 | UCPD Rx ordered set extension register 1 (UCPD_RX_ORDEXTR1) . . . . . | 1331 |
| 38.8.14 | UCPD Rx ordered set extension register 2 (UCPD_RX_ORDEXTR2) . . . . . | 1332 |
| 38.8.15 | UCPD register map . . . . . | 1332 |
| 39 | HDMI-CEC controller (CEC) . . . . . | 1335 |
| 39.1 | HDMI-CEC introduction . . . . . | 1335 |
| 39.2 | HDMI-CEC controller main features . . . . . | 1335 |
| 39.3 | HDMI-CEC functional description . . . . . | 1336 |
| 39.3.1 | HDMI-CEC pin . . . . . | 1336 |
| 39.3.2 | HDMI-CEC block diagram . . . . . | 1336 |
| 39.3.3 | Message description . . . . . | 1336 |
| 39.3.4 | Bit timing . . . . . | 1337 |
| 39.4 | Arbitration . . . . . | 1338 |
| 39.4.1 | SFT option bit . . . . . | 1339 |
| 39.5 | Error handling . . . . . | 1340 |
| 39.5.1 | Bit error . . . . . | 1340 |
| 39.5.2 | Message error . . . . . | 1340 |
| 39.5.3 | Bit rising error (BRE) . . . . . | 1340 |
| 39.5.4 | Short bit period error (SBPE) . . . . . | 1341 |
| 39.5.5 | Long bit period error (LBPE) . . . . . | 1341 |
| 39.5.6 | Transmission error detection (TXERR) . . . . . | 1342 |
| 39.6 | HDMI-CEC interrupts . . . . . | 1344 |
| 39.7 | HDMI-CEC registers . . . . . | 1345 |
| 39.7.1 | CEC control register (CEC_CR) . . . . . | 1345 |
| 39.7.2 | CEC configuration register (CEC_CFGR) . . . . . | 1346 |
| 39.7.3 | CEC Tx data register (CEC_TXDR) . . . . . | 1348 |
| 39.7.4 | CEC Rx data register (CEC_RXDR) . . . . . | 1348 |
| 39.7.5 | CEC interrupt and status register (CEC_ISR) . . . . . | 1348 |
| 39.7.6 | CEC interrupt enable register (CEC_IER) . . . . . | 1350 |
| 39.7.7 | HDMI-CEC register map . . . . . | 1352 |
| 40 | Debug support (DBG) . . . . . | 1353 |
| 40.1 | Overview . . . . . | 1353 |
| 40.2 | Reference Arm documentation . . . . . | 1354 |
| 40.3 | Pinout and debug port pins . . . . . | 1354 |
| 40.3.1 | SWD port pins . . . . . | 1354 |
| 40.3.2 | SW-DP pin assignment . . . . . | 1354 |
| 40.3.3 | Internal pull-up & pull-down on SWD pins . . . . . | 1355 |
| 40.4 | ID codes and locking mechanism . . . . . | 1355 |
| 40.5 | SWD port . . . . . | 1355 |
| 40.5.1 | SWD protocol introduction . . . . . | 1355 |
| 40.5.2 | SWD protocol sequence . . . . . | 1355 |
| 40.5.3 | SW-DP state machine (reset, idle states, ID code) . . . . . | 1356 |
| 40.5.4 | DP and AP read/write accesses . . . . . | 1357 |
| 40.5.5 | SW-DP registers . . . . . | 1357 |
| 40.5.6 | SW-AP registers . . . . . | 1358 |
| 40.6 | Core debug . . . . . | 1359 |
| 40.7 | BPU (Break Point Unit) . . . . . | 1359 |
| 40.7.1 | BPU functionality . . . . . | 1360 |
| 40.8 | DWT (Data Watchpoint) . . . . . | 1360 |
| 40.8.1 | DWT functionality . . . . . | 1360 |
| 40.8.2 | DWT Program Counter Sample Register . . . . . | 1360 |
| 40.9 | MCU debug component (DBG) . . . . . | 1360 |
| 40.9.1 | Debug support for low-power modes . . . . . | 1360 |
| 40.9.2 | Debug support for timers, watchdog and I 2 C . . . . . | 1361 |
| 40.10 | DBG registers . . . . . | 1361 |
| 40.10.1 | DBG device ID code register (DBG_IDCODE) . . . . . | 1361 |
| 40.10.2 | DBG configuration register (DBG_CR) . . . . . | 1362 |
| 40.10.3 | DBG APB freeze register 1 (DBG_APB_FZ1) . . . . . | 1363 |
| 40.10.4 | DBG APB freeze register 2 (DBG_APB_FZ2) . . . . . | 1365 |
| 40.10.5 | DBG register map . . . . . | 1366 |
| 41 | Device electronic signature . . . . . | 1368 |
| 41.1 | Unique device ID register (96 bits) . . . . . | 1368 |
| 41.2 | Flash memory size data register . . . . . | 1369 |
| 41.3 | Package data register . . . . . | 1369 |
| 42 | Important security notice . . . . . | 1371 |
| 43 | Revision history . . . . . | 1372 |
List of tables
Table 1. Peripherals versus devices . . . . . 56
Table 2. STM32G0B1xx and STM32G0C1xx memory boundary addresses . . . . . 62
Table 3. STM32G071xx and STM32G081xx memory boundary addresses . . . . . 62
Table 4. STM32G051xx and STM32G061xx memory boundary addresses . . . . . 62
Table 5. STM32G031xx and STM32G041xx memory boundary addresses . . . . . 63
Table 6. STM32G0x1 peripheral register boundary addresses . . . . . 64
Table 7. SRAM size . . . . . 66
Table 8. Boot modes . . . . . 68
Table 9. Flash memory organization for single-bank devices . . . . . 71
Table 10. Flash memory organization for 256 KB dual-bank devices . . . . . 72
Table 11. Flash memory organization for 512 KB devices . . . . . 73
Table 12. Flash memory bank mapping . . . . . 73
Table 13. Number of wait states according to flash memory clock (HCLK) frequency . . . . . 75
Table 14. Page erase overview . . . . . 78
Table 15. Mass erase overview . . . . . 78
Table 16. Option byte format . . . . . 82
Table 17. Organization of option bytes . . . . . 83
Table 18. Flash memory read protection status . . . . . 86
Table 20. Access status versus protection level and execution modes . . . . . 88
Table 23. Securable memory erase at RDP Level 1 to Level 0 change . . . . . 92
Table 24. FLASH interrupt requests . . . . . 93
Table 25. FLASH register map and reset values . . . . . 112
Table 26. Low-power mode summary . . . . . 123
Table 27. Functionalities depending on the working mode . . . . . 124
Table 28. Low-power run . . . . . 127
Table 29. Sleep mode summary . . . . . 128
Table 30. Low-power sleep mode summary . . . . . 129
Table 31. Stop 0 mode summary . . . . . 131
Table 32. Stop 1 mode summary . . . . . 132
Table 33. Standby mode summary . . . . . 134
Table 34. Shutdown mode summary . . . . . 136
Table 35. PWR register map and reset values . . . . . 153
Table 36. Clock source frequency . . . . . 166
Table 37. RCC register map and reset values . . . . . 213
Table 38. CRS features . . . . . 217
Table 39. CRS internal input/output signals . . . . . 218
Table 40. CRS interconnection . . . . . 219
Table 41. Effect of low-power modes on CRS . . . . . 222
Table 42. Interrupt control bits . . . . . 222
Table 43. CRS register map and reset values . . . . . 227
Table 44. Port bit configuration table . . . . . 229
Table 45. Effect of low-power modes on the GPIO . . . . . 238
Table 46. GPIO register map and reset values . . . . . 245
Table 47. SYSCFG register map and reset values . . . . . 265
Table 48. Interconnect matrix . . . . . 268
Table 49. DMA implementation . . . . . 276
Table 50. DMA internal input/output signals . . . . . 277
Table 51. Programmable data width and endian behavior (when PINC = MINC = 1) . . . . . 283

| Table 52. | DMA interrupt requests . . . . . | 285 |
| Table 53. | DMA register map and reset values . . . . . | 293 |
| Table 54. | DMAMUX instantiation . . . . . | 297 |
| Table 55. | DMAMUX: assignment of multiplexer inputs to resources . . . . . | 298 |
| Table 56. | DMAMUX: assignment of trigger inputs to resources . . . . . | 298 |
| Table 57. | DMAMUX: assignment of synchronization inputs to resources . . . . . | 299 |
| Table 58. | DMAMUX signals . . . . . | 301 |
| Table 59. | DMAMUX interrupts . . . . . | 305 |
| Table 60. | DMAMUX register map and reset values . . . . . | 310 |
| Table 61. | Vector table . . . . . | 312 |
| Table 62. | EXTI signal overview . . . . . | 316 |
| Table 63. | EVG pin overview . . . . . | 316 |
| Table 64. | EXTI event input configurations and register control . . . . . | 318 |
| Table 65. | EXTI line connections . . . . . | 320 |
| Table 66. | Masking functionality . . . . . | 321 |
| Table 67. | EXTI register map sections . . . . . | 322 |
| Table 68. | EXTI controller register map and reset values . . . . . | 332 |
| Table 69. | CRC internal input/output signals . . . . . | 335 |
| Table 70. | CRC register map and reset values . . . . . | 340 |
| Table 71. | ADC input/output pins . . . . . | 343 |
| Table 72. | ADC internal input/output signals . . . . . | 344 |
| Table 73. | External triggers . . . . . | 344 |
| Table 74. | Latency between trigger and start of conversion . . . . . | 350 |
| Table 75. | Configuring the trigger polarity . . . . . | 357 |
| Table 76. | tSAR timings depending on resolution . . . . . | 359 |
| Table 77. | Analog watchdog comparison . . . . . | 368 |
| Table 78. | Analog watchdog 1 channel selection . . . . . | 368 |
| Table 79. | Maximum output results vs N and M. Grayed values indicates truncation . . . . . | 373 |
| Table 80. | ADC interrupts . . . . . | 378 |
| Table 81. | ADC register map and reset values . . . . . | 397 |
| Table 82. | DAC features . . . . . | 401 |
| Table 83. | DAC input/output pins . . . . . | 403 |
| Table 84. | DAC internal input/output signals . . . . . | 403 |
| Table 85. | DAC interconnection . . . . . | 404 |
| Table 86. | Sample and refresh timings . . . . . | 411 |
| Table 87. | Channel output modes summary . . . . . | 412 |
| Table 88. | Effect of low-power modes on DAC . . . . . | 419 |
| Table 89. | DAC interrupts . . . . . | 420 |
| Table 90. | DAC register map and reset values . . . . . | 435 |
| Table 91. | VREF buffer modes . . . . . | 437 |
| Table 92. | VREFBUF register map and reset values . . . . . | 439 |
| Table 93. | COMP1 non-inverting input assignment . . . . . | 441 |
| Table 94. | COMP1 inverting input assignment . . . . . | 442 |
| Table 95. | COMP2 non-inverting input assignment . . . . . | 442 |
| Table 96. | COMP2 inverting input assignment . . . . . | 442 |
| Table 97. | COMP3 non-inverting input assignment . . . . . | 443 |
| Table 98. | COMP3 inverting input assignment . . . . . | 443 |
| Table 99. | Comparator behavior in the low power modes . . . . . | 446 |
| Table 100. | Interrupt control bits . . . . . | 446 |
| Table 101. | COMP register map and reset values . . . . . | 453 |
| Table 102. | RNG internal input/output signals . . . . . | 455 |
| Table 103. | RNG interrupt requests . . . . . | 461 |
| Table 104. | RNG configurations . . . . . | 462 |
| Table 105. | RNG register map and reset map . . . . . | 465 |
| Table 106. | AES internal input/output signals . . . . . | 467 |
| Table 107. | CTR mode initialization vector definition . . . . . | 484 |
| Table 108. | GCM last block definition . . . . . | 486 |
| Table 109. | Initialization of AES_IVRx registers in GCM mode . . . . . | 487 |
| Table 110. | Initialization of AES_IVRx registers in CCM mode . . . . . | 494 |
| Table 111. | Key endianness in AES_KEYRx registers (128- or 256-bit key length) . . . . . | 499 |
| Table 112. | AES interrupt requests . . . . . | 502 |
| Table 113. | Processing latency for ECB, CBC and CTR . . . . . | 502 |
| Table 114. | Processing latency for GCM and CCM (in clock cycles) . . . . . | 503 |
| Table 115. | AES register map and reset values . . . . . | 513 |
| Table 116. | Behavior of timer outputs versus BRK/BRK2 inputs . . . . . | 557 |
| Table 117. | Break protection disarming conditions . . . . . | 559 |
| Table 118. | Counting direction versus encoder signals . . . . . | 565 |
| Table 119. | TIM1 internal trigger connection . . . . . | 582 |
| Table 120. | Output control bits for complementary OCx and OCxN channels with break feature . . . . . | 596 |
| Table 121. | TIM1 register map and reset values . . . . . | 614 |
| Table 122. | Counting direction versus encoder signals . . . . . | 650 |
| Table 123. | TIMx internal trigger connection . . . . . | 668 |
| Table 124. | Output control bit for standard OCx channels . . . . . | 679 |
| Table 125. | TIM2/TIM3/TIM4 register map and reset values . . . . . | 691 |
| Table 126. | TIMx register map and reset values . . . . . | 706 |
| Table 127. | Output control bit for standard OCx channels . . . . . | 729 |
| Table 128. | TIM14 register map and reset values . . . . . | 731 |
| Table 129. | Break protection disarming conditions . . . . . | 761 |
| Table 130. | TIMx Internal trigger connection . . . . . | 777 |
| Table 131. | Output control bits for complementary OCx and OCxN channels with break feature (TIM15) . . . . . | 787 |
| Table 132. | TIM15 register map and reset values . . . . . | 796 |
| Table 133. | Output control bits for complementary OCx and OCxN channels with break feature (TIM16/17) . . . . . | 809 |
| Table 134. | TIM16/TIM17 register map and reset values . . . . . | 821 |
| Table 135. | STM32G0x1 LPTIM features . . . . . | 824 |
| Table 136. | LPTIM input/output pins . . . . . | 825 |
| Table 137. | LPTIM internal signals . . . . . | 825 |
| Table 138. | LPTIM1 external trigger connection . . . . . | 825 |
| Table 139. | LPTIM2 external trigger connection . . . . . | 826 |
| Table 140. | LPTIM1 input 1 connection . . . . . | 826 |
| Table 141. | LPTIM1 input 2 connection . . . . . | 826 |
| Table 142. | LPTIM2 input 1 connection . . . . . | 826 |
| Table 143. | Prescaler division ratios . . . . . | 828 |
| Table 144. | Encoder counting scenarios . . . . . | 835 |
| Table 145. | Effect of low-power modes on the LPTIM . . . . . | 836 |
| Table 146. | Interrupt events . . . . . | 837 |
| Table 147. | LPTIM register map and reset values . . . . . | 848 |
| Table 148. | IWDG register map and reset values . . . . . | 858 |
| Table 149. | WWDG register map and reset values . . . . . | 864 |
| Table 150. | RTC input/output pins . . . . . | 867 |
| Table 151. | RTC internal input/output signals . . . . . | 867 |
| Table 152. | RTC interconnection . . . . . | 868 |
| Table 153. | PC13 configuration . . . . . | 868 |
| Table 154. | RTC_OUT mapping . . . . . | 870 |
| Table 155. | Effect of low-power modes on RTC . . . . . | 881 |
| Table 156. | RTC pins functionality over modes . . . . . | 881 |
| Table 157. | Interrupt requests . . . . . | 882 |
| Table 158. | RTC register map and reset values . . . . . | 902 |
| Table 159. | TAMP input/output pins . . . . . | 906 |
| Table 160. | TAMP internal input/output signals . . . . . | 906 |
| Table 161. | TAMP interconnection . . . . . | 906 |
| Table 162. | Effect of low-power modes on TAMP . . . . . | 909 |
| Table 163. | Interrupt requests . . . . . | 909 |
| Table 164. | TAMP register map and reset values . . . . . | 918 |
| Table 165. | I 2 C implementation . . . . . | 920 |
| Table 166. | I 2 C input/output pins . . . . . | 922 |
| Table 167. | I 2 C internal input/output signals . . . . . | 922 |
| Table 168. | Comparison of analog and digital filters . . . . . | 924 |
| Table 169. | I 2 C-bus and SMBus specification data setup and hold times . . . . . | 926 |
| Table 170. | I 2 C configuration . . . . . | 930 |
| Table 171. | I 2 C-bus and SMBus specification clock timings . . . . . | 941 |
| Table 172. | Timing settings for f I2CCLK of 8 MHz . . . . . | 951 |
| Table 173. | Timing settings for f I2CCLK of 16 MHz . . . . . | 951 |
| Table 174. | Timing settings for f I2CCLK of 48 MHz . . . . . | 952 |
| Table 175. | SMBus timeout specifications . . . . . | 954 |
| Table 176. | SMBus with PEC configuration . . . . . | 956 |
| Table 177. | TIMEOUTA[11:0] for maximum t TIMEOUT of 25 ms . . . . . | 957 |
| Table 178. | TIMEOUTB[11:0] for maximum t LOW:SEXT and t LOW:MEXT of 8 ms . . . . . | 957 |
| Table 179. | TIMEOUTA[11:0] for maximum t IDLE of 50 µs . . . . . | 957 |
| Table 180. | Effect of low-power modes to I 2 C . . . . . | 967 |
| Table 181. | I 2 C interrupt requests . . . . . | 967 |
| Table 182. | I 2 C register map and reset values . . . . . | 983 |
| Table 183. | Instance implementation on STM32G0x1 . . . . . | 986 |
| Table 184. | USART / LPUART features . . . . . | 987 |
| Table 185. | USART input/output pins . . . . . | 990 |
| Table 186. | USART internal input/output signals . . . . . | 990 |
| Table 187. | Noise detection from sampled data . . . . . | 1002 |
| Table 188. | Tolerance of the USART receiver when BRR [3:0] = 0000 . . . . . | 1005 |
| Table 189. | Tolerance of the USART receiver when BRR[3:0] is different from 0000 . . . . . | 1006 |
| Table 190. | USART frame formats . . . . . | 1011 |
| Table 191. | Effect of low-power modes on the USART . . . . . | 1034 |
| Table 192. | USART interrupt requests . . . . . | 1035 |
| Table 193. | USART register map and reset values . . . . . | 1069 |
| Table 194. | Instance implementation on STM32G0x1 . . . . . | 1073 |
| Table 195. | USART / LPUART features . . . . . | 1073 |
| Table 196. | LPUART input/output pins . . . . . | 1075 |
| Table 197. | LPUART internal input/output signals . . . . . | 1075 |
| Table 198. | Error calculation for programmed baud rates at lpuart_ker_ck_pres = 32.768 kHz . . . . . | 1085 |
| Table 199. | Error calculation for programmed baud rates at fCK = 100 MHz . . . . . | 1086 |
| Table 200. | Tolerance of the LPUART receiver . . . . . | 1087 |
| Table 202. | Effect of low-power modes on the LPUART . . . . . | 1098 |
| Table 203. | LPUART interrupt requests . . . . . | 1099 |
| Table 204. | LPUART register map and reset values . . . . . | 1122 |
| Table 205. | STM32G0x1 SPI and SPI/I2S implementation . . . . . | 1125 |
| Table 206. | SPI interrupt requests . . . . . | 1150 |
| Table 207. | Audio-frequency precision using 48 MHz clock derived from HSE . . . . . | 1163 |
| Table 208. | I2S interrupt requests . . . . . | 1169 |
| Table 209. | SPI/I2S register map and reset values . . . . . | 1181 |
| Table 210. | CAN subsystem I/O signals . . . . . | 1186 |
| Table 211. | CAN subsystem I/O pins . . . . . | 1186 |
| Table 212. | DLC coding in FDCAN . . . . . | 1190 |
| Table 213. | Possible configurations for frame transmission . . . . . | 1204 |
| Table 214. | Rx FIFO element . . . . . | 1207 |
| Table 215. | Rx FIFO element description . . . . . | 1207 |
| Table 216. | Tx buffer and FIFO element . . . . . | 1209 |
| Table 217. | Tx buffer element description . . . . . | 1209 |
| Table 218. | Tx event FIFO element . . . . . | 1211 |
| Table 219. | Tx event FIFO element description . . . . . | 1211 |
| Table 220. | Standard message ID filter element . . . . . | 1212 |
| Table 221. | Standard message ID filter element field description . . . . . | 1213 |
| Table 222. | Extended message ID filter element . . . . . | 1213 |
| Table 223. | Extended message ID filter element field description . . . . . | 1214 |
| Table 224. | FDCAN register map and reset values . . . . . | 1244 |
| Table 225. | STM32G0x1 USB implementation . . . . . | 1248 |
| Table 226. | USB input/output pins . . . . . | 1249 |
| Table 227. | Double-buffering buffer flag definition . . . . . | 1262 |
| Table 228. | Bulk double-buffering memory buffers usage (Device mode) . . . . . | 1262 |
| Table 229. | Bulk double-buffering memory buffers usage (Host mode) . . . . . | 1264 |
| Table 230. | Isochronous memory buffers usage . . . . . | 1265 |
| Table 231. | Isochronous memory buffers usage . . . . . | 1266 |
| Table 232. | Resume event detection . . . . . | 1268 |
| Table 233. | Resume event detection for host . . . . . | 1269 |
| Table 234. | Reception status encoding . . . . . | 1287 |
| Table 235. | Endpoint/channel type encoding . . . . . | 1287 |
| Table 236. | Endpoint/channel kind meaning . . . . . | 1287 |
| Table 237. | Transmission status encoding . . . . . | 1287 |
| Table 238. | USB register map and reset values . . . . . | 1289 |
| Table 239. | Definition of allocated buffer memory . . . . . | 1292 |
| Table 240. | USBFSRAM register map and reset values . . . . . | 1295 |
| Table 241. | UCPD implementation . . . . . | 1297 |
| Table 242. | UCPD signals on pins . . . . . | 1298 |
| Table 243. | UCPD internal signals . . . . . | 1299 |
| Table 244. | 4b5b symbol encoding table . . . . . | 1300 |
| Table 245. | Ordered sets . . . . . | 1302 |
| Table 246. | Validation of ordered sets . . . . . | 1302 |
| Table 247. | Data size . . . . . | 1303 |
| Table 248. | Coding for ANAMODE, ANASUBMODE and link with TYPEC_VSTATE_CCx . . . . . | 1311 |
| Table 249. | Type-C sequence (source: 3A); cable/sink connected (Rd on CC1; Ra on CC2) . . . . . | 1313 |
| Table 250. | Effect of low power modes on the UCPD . . . . . | 1315 |
| Table 251. | UCPD interrupt requests . . . . . | 1316 |
| Table 252. | UCPD register map and reset values . . . . . | 1332 |
| Table 253. | HDMI pin . . . . . | 1336 |
| Table 254. | Error handling timing parameters . . . . . | 1342 |
| Table 255. | TXERR timing parameters . . . . . | 1343 |
| Table 256. | HDMI-CEC interrupts . . . . . | 1344 |
| Table 257. | HDMI-CEC register map and reset values . . . . . | 1352 |
| Table 258. | SW debug port pins . . . . . | 1354 |
| Table 259. | Packet request (8-bits) . . . . . | 1356 |
| Table 260. | ACK response (3 bits). . . . . | 1356 |
| Table 261. | DATA transfer (33 bits). . . . . | 1356 |
| Table 262. | SW-DP registers . . . . . | 1357 |
| Table 263. | 32-bit debug port registers addressed through the shifted value A[3:2] . . . . . | 1358 |
| Table 264. | Core debug registers . . . . . | 1359 |
| Table 265. | DEV_ID and REV_ID field values. . . . . | 1361 |
| Table 266. | DBG register map and reset values . . . . . | 1366 |
| Table 267. | Document revision history . . . . . | 1372 |
List of figures
Figure 1. System architecture . . . . . 58
Figure 2. Memory map . . . . . 61
Figure 3. Changing read protection (RDP) level . . . . . 88
Figure 4. Example of disabling core debug access . . . . . 92
Figure 5. Power supply overview . . . . . 115
Figure 6. POR, PDR, and BOR thresholds . . . . . 119
Figure 7. PVD thresholds . . . . . 120
Figure 8. Low-power modes state diagram . . . . . 122
Figure 9. Simplified diagram of the reset circuit . . . . . 156
Figure 10. Clock tree . . . . . 161
Figure 11. HSE/ LSE clock sources . . . . . 162
Figure 12. Frequency measurement with TIM14 in capture mode . . . . . 170
Figure 13. Frequency measurement with TIM16 in capture mode . . . . . 171
Figure 14. Frequency measurement with TIM17 in capture mode . . . . . 171
Figure 15. CRS block diagram . . . . . 218
Figure 16. CRS counter behavior . . . . . 220
Figure 17. Basic structure of an I/O port bit . . . . . 229
Figure 18. Input floating/pull up/pull down configurations . . . . . 234
Figure 19. Output configuration . . . . . 235
Figure 20. Alternate function configuration- . . . . . 236
Figure 21. High impedance-analog configuration . . . . . 236
Figure 22. DMA block diagram . . . . . 277
Figure 23. DMAMUX block diagram . . . . . 300
Figure 24. Synchronization mode of the DMAMUX request line multiplexer channel . . . . . 303
Figure 25. Event generation of the DMA request line multiplexer channel . . . . . 303
Figure 26. EXTI block diagram . . . . . 316
Figure 27. Configurable event trigger logic CPU wake-up . . . . . 318
Figure 28. Direct event trigger logic CPU wake-up . . . . . 319
Figure 29. EXTI GPIO mux . . . . . 320
Figure 30. CRC calculation unit block diagram . . . . . 335
Figure 31. ADC block diagram . . . . . 343
Figure 32. ADC calibration . . . . . 346
Figure 33. Calibration factor forcing . . . . . 347
Figure 34. Enabling/disabling the ADC . . . . . 348
Figure 35. ADC clock scheme . . . . . 349
Figure 36. ADC connectivity . . . . . 351
Figure 37. Analog-to-digital conversion time . . . . . 356
Figure 38. ADC conversion timings . . . . . 356
Figure 39. Stopping an ongoing conversion . . . . . 357
Figure 40. Single conversions of a sequence, software trigger . . . . . 360
Figure 41. Continuous conversion of a sequence, software trigger . . . . . 360
Figure 42. Single conversions of a sequence, hardware trigger . . . . . 361
Figure 43. Continuous conversions of a sequence, hardware trigger . . . . . 361
Figure 44. Data alignment and resolution (oversampling disabled: OVSE = 0). . . . . 362
Figure 45. Example of overrun (OVR) . . . . . 363
Figure 46. Wait mode conversion (continuous mode, software trigger). . . . . 366
Figure 47. Behavior with WAIT = 0, AUTOFF = 1 . . . . . 367
Figure 48. Behavior with WAIT = 1, AUTOFF = 1 . . . . . 367
| Figure 49. | Analog watchdog guarded area . . . . . | 368 |
| Figure 50. | ADC_AWDx_OUT signal generation . . . . . | 370 |
| Figure 51. | ADC_AWDx_OUT signal generation (AWDx flag not cleared by software) . . . . . | 370 |
| Figure 52. | ADC_AWDx_OUT signal generation (on a single channel) . . . . . | 371 |
| Figure 53. | Analog watchdog threshold update . . . . . | 371 |
| Figure 54. | 20-bit to 16-bit result truncation . . . . . | 372 |
| Figure 55. | Numerical example with 5-bit shift and rounding . . . . . | 372 |
| Figure 56. | Triggered oversampling mode (TOVS bit = 1) . . . . . | 374 |
| Figure 57. | Temperature sensor and VREFINT channel block diagram . . . . . | 375 |
| Figure 58. | VBAT channel block diagram . . . . . | 377 |
| Figure 59. | Dual-channel DAC block diagram . . . . . | 402 |
| Figure 60. | Data registers in single DAC channel mode . . . . . | 405 |
| Figure 61. | Data registers in dual DAC channel mode . . . . . | 405 |
| Figure 62. | Timing diagram for conversion with trigger disabled TEN = 0 . . . . . | 406 |
| Figure 63. | DAC LFSR register calculation algorithm . . . . . | 408 |
| Figure 64. | DAC conversion (SW trigger enabled) with LFSR wave generation . . . . . | 408 |
| Figure 65. | DAC triangle wave generation . . . . . | 409 |
| Figure 66. | DAC conversion (SW trigger enabled) with triangle wave generation . . . . . | 409 |
| Figure 67. | DAC sample and hold mode phase diagram . . . . . | 412 |
| Figure 68. | Comparator block diagram . . . . . | 441 |
| Figure 69. | Window mode . . . . . | 444 |
| Figure 70. | Comparator hysteresis . . . . . | 444 |
| Figure 71. | Comparator output blanking . . . . . | 445 |
| Figure 72. | RNG block diagram . . . . . | 455 |
| Figure 73. | Entropy source model . . . . . | 456 |
| Figure 74. | RNG initialization overview . . . . . | 458 |
| Figure 75. | AES block diagram . . . . . | 467 |
| Figure 76. | ECB encryption and decryption principle . . . . . | 469 |
| Figure 77. | CBC encryption and decryption principle . . . . . | 470 |
| Figure 78. | CTR encryption and decryption principle . . . . . | 471 |
| Figure 79. | GCM encryption and authentication principle . . . . . | 472 |
| Figure 80. | GMAC authentication principle . . . . . | 472 |
| Figure 81. | CCM encryption and authentication principle . . . . . | 473 |
| Figure 82. | Example of suspend mode management . . . . . | 477 |
| Figure 83. | ECB encryption . . . . . | 478 |
| Figure 84. | ECB decryption . . . . . | 478 |
| Figure 85. | CBC encryption . . . . . | 479 |
| Figure 86. | CBC decryption . . . . . | 479 |
| Figure 87. | ECB/CBC encryption (Mode 1) . . . . . | 480 |
| Figure 88. | ECB/CBC decryption (Mode 3) . . . . . | 481 |
| Figure 89. | Message construction in CTR mode . . . . . | 483 |
| Figure 90. | CTR encryption . . . . . | 483 |
| Figure 91. | CTR decryption . . . . . | 484 |
| Figure 92. | Message construction in GCM . . . . . | 485 |
| Figure 93. | GCM authenticated encryption . . . . . | 487 |
| Figure 94. | Message construction in GMAC mode . . . . . | 491 |
| Figure 95. | GMAC authentication mode . . . . . | 491 |
| Figure 96. | Message construction in CCM mode . . . . . | 492 |
| Figure 97. | CCM mode authenticated encryption . . . . . | 494 |
| Figure 98. | 128-bit block construction with respect to data swap . . . . . | 498 |
| Figure 99. | DMA transfer of a 128-bit data block during input phase . . . . . | 500 |
| Figure 100. | DMA transfer of a 128-bit data block during output phase . . . . . | 501 |
| Figure 101. Advanced-control timer block diagram . . . . . | 517 |
| Figure 102. Counter timing diagram with prescaler division change from 1 to 2 . . . . . | 519 |
| Figure 103. Counter timing diagram with prescaler division change from 1 to 4 . . . . . | 519 |
| Figure 104. Counter timing diagram, internal clock divided by 1 . . . . . | 521 |
| Figure 105. Counter timing diagram, internal clock divided by 2 . . . . . | 521 |
| Figure 106. Counter timing diagram, internal clock divided by 4 . . . . . | 522 |
| Figure 107. Counter timing diagram, internal clock divided by N . . . . . | 522 |
| Figure 108. Counter timing diagram, update event when ARPE=0 (TIMx_ARR not preloaded) . . . . . | 523 |
| Figure 109. Counter timing diagram, update event when ARPE=1 (TIMx_ARR preloaded) . . . . . | 523 |
| Figure 110. Counter timing diagram, internal clock divided by 1 . . . . . | 525 |
| Figure 111. Counter timing diagram, internal clock divided by 2 . . . . . | 525 |
| Figure 112. Counter timing diagram, internal clock divided by 4 . . . . . | 526 |
| Figure 113. Counter timing diagram, internal clock divided by N . . . . . | 526 |
| Figure 114. Counter timing diagram, update event when repetition counter is not used . . . . . | 527 |
| Figure 115. Counter timing diagram, internal clock divided by 1, TIMx_ARR = 0x6 . . . . . | 528 |
| Figure 116. Counter timing diagram, internal clock divided by 2 . . . . . | 529 |
| Figure 117. Counter timing diagram, internal clock divided by 4, TIMx_ARR=0x36 . . . . . | 529 |
| Figure 118. Counter timing diagram, internal clock divided by N . . . . . | 530 |
| Figure 119. Counter timing diagram, update event with ARPE=1 (counter underflow) . . . . . | 530 |
| Figure 120. Counter timing diagram, Update event with ARPE=1 (counter overflow) . . . . . | 531 |
| Figure 121. Update rate examples depending on mode and TIMx_RCR register settings . . . . . | 532 |
| Figure 122. External trigger input block . . . . . | 533 |
| Figure 123. TIM1 ETR input circuitry . . . . . | 533 |
| Figure 124. Control circuit in normal mode, internal clock divided by 1 . . . . . | 534 |
| Figure 125. TI2 external clock connection example . . . . . | 535 |
| Figure 126. Control circuit in external clock mode 1 . . . . . | 536 |
| Figure 127. External trigger input block . . . . . | 536 |
| Figure 128. Control circuit in external clock mode 2 . . . . . | 537 |
| Figure 129. Capture/compare channel (example: channel 1 input stage) . . . . . | 538 |
| Figure 130. Capture/compare channel 1 main circuit . . . . . | 538 |
| Figure 131. Output stage of capture/compare channel (channel 1, idem ch. 2 and 3) . . . . . | 539 |
| Figure 132. Output stage of capture/compare channel (channel 4) . . . . . | 539 |
| Figure 133. Output stage of capture/compare channel (channel 5, idem ch. 6) . . . . . | 540 |
| Figure 134. PWM input mode timing . . . . . | 542 |
| Figure 135. Output compare mode, toggle on OC1 . . . . . | 544 |
| Figure 136. Edge-aligned PWM waveforms (ARR=8) . . . . . | 545 |
| Figure 137. Center-aligned PWM waveforms (ARR=8) . . . . . | 546 |
| Figure 138. Generation of 2 phase-shifted PWM signals with 50% duty cycle . . . . . | 548 |
| Figure 139. Combined PWM mode on channel 1 and 3 . . . . . | 549 |
| Figure 140. 3-phase combined PWM signals with multiple trigger pulses per period . . . . . | 550 |
| Figure 141. Complementary output with dead-time insertion . . . . . | 551 |
| Figure 142. Dead-time waveforms with delay greater than the negative pulse . . . . . | 551 |
| Figure 143. Dead-time waveforms with delay greater than the positive pulse . . . . . | 552 |
| Figure 144. Break and Break2 circuitry overview . . . . . | 554 |
| Figure 145. Various output behavior in response to a break event on BRK (OSSI = 1) . . . . . | 556 |
| Figure 146. PWM output state following BRK and BRK2 pins assertion (OSSI=1) . . . . . | 557 |
| Figure 147. PWM output state following BRK assertion (OSSI=0) . . . . . | 558 |
| Figure 148. Output redirection (BRK2 request not represented) . . . . . | 559 |
| Figure 149. Clearing TIMx_OCxREF . . . . . | 560 |
| Figure 150. 6-step generation, COM example (OSSR=1) . . . . . | 561 |
| Figure 151. Example of one pulse mode . . . . . | 562 |
| Figure 152. Retriggerable one pulse mode . . . . . | 564 |
| Figure 153. Example of counter operation in encoder interface mode. . . . . | 565 |
| Figure 154. Example of encoder interface mode with TI1FP1 polarity inverted. . . . . | 566 |
| Figure 155. Measuring time interval between edges on 3 signals . . . . . | 567 |
| Figure 156. Example of Hall sensor interface . . . . . | 569 |
| Figure 157. Control circuit in reset mode . . . . . | 570 |
| Figure 158. Control circuit in Gated mode . . . . . | 571 |
| Figure 159. Control circuit in trigger mode . . . . . | 572 |
| Figure 160. Control circuit in external clock mode 2 + trigger mode . . . . . | 573 |
| Figure 161. General-purpose timer block diagram . . . . . | 618 |
| Figure 162. Counter timing diagram with prescaler division change from 1 to 2 . . . . . | 620 |
| Figure 163. Counter timing diagram with prescaler division change from 1 to 4 . . . . . | 620 |
| Figure 164. Counter timing diagram, internal clock divided by 1 . . . . . | 621 |
| Figure 165. Counter timing diagram, internal clock divided by 2 . . . . . | 622 |
| Figure 166. Counter timing diagram, internal clock divided by 4 . . . . . | 622 |
| Figure 167. Counter timing diagram, internal clock divided by N . . . . . | 623 |
| Figure 168. Counter timing diagram, Update event when ARPE=0 (TIMx_ARR not preloaded). . . . . | 623 |
| Figure 169. Counter timing diagram, Update event when ARPE=1 (TIMx_ARR preloaded). . . . . | 624 |
| Figure 170. Counter timing diagram, internal clock divided by 1 . . . . . | 625 |
| Figure 171. Counter timing diagram, internal clock divided by 2 . . . . . | 625 |
| Figure 172. Counter timing diagram, internal clock divided by 4 . . . . . | 626 |
| Figure 173. Counter timing diagram, internal clock divided by N . . . . . | 626 |
| Figure 174. Counter timing diagram, Update event . . . . . | 627 |
| Figure 175. Counter timing diagram, internal clock divided by 1, TIMx_ARR=0x6 . . . . . | 628 |
| Figure 176. Counter timing diagram, internal clock divided by 2 . . . . . | 629 |
| Figure 177. Counter timing diagram, internal clock divided by 4, TIMx_ARR=0x36 . . . . . | 629 |
| Figure 178. Counter timing diagram, internal clock divided by N . . . . . | 630 |
| Figure 179. Counter timing diagram, Update event with ARPE=1 (counter underflow). . . . . | 630 |
| Figure 180. Counter timing diagram, Update event with ARPE=1 (counter overflow). . . . . | 631 |
| Figure 181. Control circuit in normal mode, internal clock divided by 1 . . . . . | 632 |
| Figure 182. TI2 external clock connection example. . . . . | 632 |
| Figure 183. Control circuit in external clock mode 1 . . . . . | 633 |
| Figure 184. External trigger input block . . . . . | 634 |
| Figure 185. Control circuit in external clock mode 2 . . . . . | 635 |
| Figure 186. Capture/Compare channel (example: channel 1 input stage) . . . . . | 635 |
| Figure 187. Capture/Compare channel 1 main circuit . . . . . | 636 |
| Figure 188. Output stage of Capture/Compare channel (channel 1). . . . . | 636 |
| Figure 189. PWM input mode timing . . . . . | 638 |
| Figure 190. Output compare mode, toggle on OC1 . . . . . | 640 |
| Figure 191. Edge-aligned PWM waveforms (ARR=8) . . . . . | 641 |
| Figure 192. Center-aligned PWM waveforms (ARR=8). . . . . | 643 |
| Figure 193. Generation of 2 phase-shifted PWM signals with 50% duty cycle . . . . . | 644 |
| Figure 194. Combined PWM mode on channels 1 and 3 . . . . . | 645 |
| Figure 195. Clearing TIMx_OCxREF . . . . . | 646 |
| Figure 196. Example of one-pulse mode. . . . . | 647 |
| Figure 197. Retriggerable one-pulse mode . . . . . | 649 |
| Figure 198. Example of counter operation in encoder interface mode . . . . . | 650 |
| Figure 199. Example of encoder interface mode with TI1FP1 polarity inverted . . . . . | 651 |
| Figure 200. Control circuit in reset mode . . . . . | 652 |
| Figure 201. Control circuit in gated mode . . . . . | 653 |
| Figure 202. Control circuit in trigger mode . . . . . | 654 |
| Figure 203. Control circuit in external clock mode 2 + trigger mode . . . . . | 655 |
| Figure 204. Master/Slave timer example . . . . . | 656 |
| Figure 205. Master/slave connection example with 1 channel only timers . . . . . | 656 |
| Figure 206. Gating TIM2 with OC1REF of TIM3 . . . . . | 657 |
| Figure 207. Gating TIM2 with Enable of TIM3 . . . . . | 658 |
| Figure 208. Triggering TIM2 with update of TIM3 . . . . . | 659 |
| Figure 209. Triggering TIM2 with Enable of TIM3 . . . . . | 659 |
| Figure 210. Triggering TIM3 and TIM2 with TIM3 TI1 input. . . . . | 660 |
| Figure 211. Basic timer block diagram. . . . . | 694 |
| Figure 212. Counter timing diagram with prescaler division change from 1 to 2 . . . . . | 696 |
| Figure 213. Counter timing diagram with prescaler division change from 1 to 4 . . . . . | 696 |
| Figure 214. Counter timing diagram, internal clock divided by 1 . . . . . | 697 |
| Figure 215. Counter timing diagram, internal clock divided by 2 . . . . . | 698 |
| Figure 216. Counter timing diagram, internal clock divided by 4 . . . . . | 698 |
| Figure 217. Counter timing diagram, internal clock divided by N . . . . . | 699 |
| Figure 218. Counter timing diagram, update event when ARPE = 0 (TIMx_ARR not preloaded). . . . . | 699 |
| Figure 219. Counter timing diagram, update event when ARPE=1 (TIMx_ARR preloaded). . . . . | 700 |
| Figure 220. Control circuit in normal mode, internal clock divided by 1 . . . . . | 701 |
| Figure 221. General-purpose timer block diagram (TIM14). . . . . | 708 |
| Figure 222. Counter timing diagram with prescaler division change from 1 to 2 . . . . . | 710 |
| Figure 223. Counter timing diagram with prescaler division change from 1 to 4 . . . . . | 710 |
| Figure 224. Counter timing diagram, internal clock divided by 1 . . . . . | 711 |
| Figure 225. Counter timing diagram, internal clock divided by 2 . . . . . | 712 |
| Figure 226. Counter timing diagram, internal clock divided by 4 . . . . . | 712 |
| Figure 227. Counter timing diagram, internal clock divided by N . . . . . | 713 |
| Figure 228. Counter timing diagram, update event when ARPE=0 (TIMx_ARR not preloaded). . . . . | 713 |
| Figure 229. Counter timing diagram, update event when ARPE=1 (TIMx_ARR preloaded). . . . . | 714 |
| Figure 230. Control circuit in normal mode, internal clock divided by 1 . . . . . | 715 |
| Figure 231. Capture/compare channel (example: channel 1 input stage). . . . . | 715 |
| Figure 232. Capture/compare channel 1 main circuit . . . . . | 716 |
| Figure 233. Output stage of capture/compare channel (channel 1). . . . . | 716 |
| Figure 234. Output compare mode, toggle on OC1. . . . . | 719 |
| Figure 235. Edge-aligned PWM waveforms (ARR=8). . . . . | 720 |
| Figure 236. TIM15 block diagram . . . . . | 735 |
| Figure 237. TIM16/TIM17 block diagram . . . . . | 736 |
| Figure 238. Counter timing diagram with prescaler division change from 1 to 2 . . . . . | 738 |
| Figure 239. Counter timing diagram with prescaler division change from 1 to 4 . . . . . | 738 |
| Figure 240. Counter timing diagram, internal clock divided by 1 . . . . . | 740 |
| Figure 241. Counter timing diagram, internal clock divided by 2 . . . . . | 740 |
| Figure 242. Counter timing diagram, internal clock divided by 4 . . . . . | 741 |
| Figure 243. Counter timing diagram, internal clock divided by N . . . . . | 741 |
| Figure 244. Counter timing diagram, update event when ARPE=0 (TIMx_ARR not preloaded). . . . . | 742 |
| Figure 245. Counter timing diagram, update event when ARPE=1 (TIMx_ARR preloaded). . . . . | 742 |
| Figure 246. Update rate examples depending on mode and TIMx_RCR register settings . . . . . | 744 |
| Figure 247. Control circuit in normal mode, internal clock divided by 1 . . . . . | 745 |
| Figure 248. TI2 external clock connection example. . . . . | 745 |
| Figure 249. Control circuit in external clock mode 1 . . . . . | 746 |
| Figure 250. Capture/compare channel (example: channel 1 input stage). . . . . | 747 |
| Figure 251. Capture/compare channel 1 main circuit . . . . . | 747 |
| Figure 252. Output stage of capture/compare channel (channel 1). . . . . | 748 |
| Figure 253. Output stage of capture/compare channel (channel 2 for TIM15) . . . . . | 748 |
| Figure 254. PWM input mode timing . . . . . | 750 |
| Figure 255. Output compare mode, toggle on OC1 . . . . . | 752 |
| Figure 256. Edge-aligned PWM waveforms (ARR=8) . . . . . | 753 |
| Figure 257. Combined PWM mode on channel 1 and 2 . . . . . | 754 |
| Figure 258. Complementary output with dead-time insertion. . . . . | 755 |
| Figure 259. Dead-time waveforms with delay greater than the negative pulse. . . . . | 755 |
| Figure 260. Dead-time waveforms with delay greater than the positive pulse. . . . . | 756 |
| Figure 261. Break circuitry overview . . . . . | 758 |
| Figure 262. Output behavior in response to a break . . . . . | 760 |
| Figure 263. Output redirection . . . . . | 762 |
| Figure 264. 6-step generation, COM example (OSSR=1) . . . . . | 763 |
| Figure 265. Example of one pulse mode . . . . . | 764 |
| Figure 266. Retriggerable one pulse mode . . . . . | 766 |
| Figure 267. Measuring time interval between edges on 2 signals . . . . . | 767 |
| Figure 268. Control circuit in reset mode . . . . . | 768 |
| Figure 269. Control circuit in gated mode . . . . . | 769 |
| Figure 270. Control circuit in trigger mode . . . . . | 770 |
| Figure 271. Low-power timer block diagram (LPTIM1 and LPTIM2 (1) ) . . . . . | 824 |
| Figure 272. Glitch filter timing diagram . . . . . | 828 |
| Figure 273. LPTIM output waveform, single counting mode configuration . . . . . | 829 |
| Figure 274. LPTIM output waveform, Single counting mode configuration and Set-once mode activated (WAVE bit is set). . . . . | 830 |
| Figure 275. LPTIM output waveform, Continuous counting mode configuration . . . . . | 830 |
| Figure 276. Waveform generation . . . . . | 832 |
| Figure 277. Encoder mode counting sequence . . . . . | 836 |
| Figure 278. IRTIM internal hardware connections . . . . . | 849 |
| Figure 279. Independent watchdog block diagram . . . . . | 850 |
| Figure 280. Watchdog block diagram . . . . . | 860 |
| Figure 281. Window watchdog timing diagram . . . . . | 861 |
| Figure 282. RTC block diagram . . . . . | 866 |
| Figure 283. TAMP block diagram . . . . . | 905 |
| Figure 284. Block diagram . . . . . | 921 |
| Figure 285. I 2 C-bus protocol . . . . . | 923 |
| Figure 286. Setup and hold timings . . . . . | 925 |
| Figure 287. I2C initialization flow . . . . . | 927 |
| Figure 288. Data reception . . . . . | 928 |
| Figure 289. Data transmission . . . . . | 929 |
| Figure 290. Target initialization flow . . . . . | 932 |
| Figure 291. Transfer sequence flow for I2C target transmitter, NOSTRETCH = 0 . . . . . | 934 |
| Figure 292. Transfer sequence flow for I2C target transmitter, NOSTRETCH = 1 . . . . . | 935 |
| Figure 293. Transfer bus diagrams for I2C target transmitter (mandatory events only) . . . . . | 936 |
| Figure 294. Transfer sequence flow for I2C target receiver, NOSTRETCH = 0 . . . . . | 937 |
| Figure 295. Transfer sequence flow for I2C target receiver, NOSTRETCH = 1 . . . . . | 938 |
| Figure 296. Transfer bus diagrams for I2C target receiver (mandatory events only) . . . . . | 938 |
| Figure 297. Controller clock generation . . . . . | 940 |
| Figure 298. Controller initialization flow . . . . . | 942 |
| Figure 299. 10-bit address read access with HEAD10R = 0 . . . . . | 942 |
| Figure 300. 10-bit address read access with HEAD10R = 1 . . . . . | 943 |
| Figure 301. | Transfer sequence flow for I2C controller transmitter, \( N \leq 255 \) bytes . . . . . | 944 |
| Figure 302. | Transfer sequence flow for I2C controller transmitter, \( N > 255 \) bytes . . . . . | 945 |
| Figure 303. | Transfer bus diagrams for I2C controller transmitter (mandatory events only) . . . . . | 946 |
| Figure 304. | Transfer sequence flow for I2C controller receiver, \( N \leq 255 \) bytes . . . . . | 948 |
| Figure 305. | Transfer sequence flow for I2C controller receiver, \( N > 255 \) bytes . . . . . | 949 |
| Figure 306. | Transfer bus diagrams for I2C controller receiver (mandatory events only) . . . . . | 950 |
| Figure 307. | Timeout intervals for \( t_{LOW:SEXT} \) , \( t_{LOW:MEXT} \) . . . . . | 955 |
| Figure 308. | Transfer sequence flow for SMBus target transmitter N bytes + PEC . . . . . | 958 |
| Figure 309. | Transfer bus diagram for SMBus target transmitter (SBC = 1) . . . . . | 959 |
| Figure 310. | Transfer sequence flow for SMBus target receiver N bytes + PEC . . . . . | 960 |
| Figure 311. | Bus transfer diagrams for SMBus target receiver (SBC = 1) . . . . . | 961 |
| Figure 312. | Bus transfer diagrams for SMBus controller transmitter . . . . . | 962 |
| Figure 313. | Bus transfer diagrams for SMBus controller receiver . . . . . | 964 |
| Figure 314. | USART block diagram . . . . . | 988 |
| Figure 315. | Word length programming . . . . . | 991 |
| Figure 316. | Configurable stop bits . . . . . | 993 |
| Figure 317. | TC/TXE behavior when transmitting . . . . . | 996 |
| Figure 318. | Start bit detection when oversampling by 16 or 8 . . . . . | 997 |
| Figure 319. | usart_ker_ck clock divider block diagram . . . . . | 1000 |
| Figure 320. | Data sampling when oversampling by 16 . . . . . | 1001 |
| Figure 321. | Data sampling when oversampling by 8 . . . . . | 1002 |
| Figure 322. | Mute mode using Idle line detection . . . . . | 1009 |
| Figure 323. | Mute mode using address mark detection . . . . . | 1010 |
| Figure 324. | Break detection in LIN mode (11-bit break length - LBDL bit is set) . . . . . | 1013 |
| Figure 325. | Break detection in LIN mode vs. Framing error detection. . . . . | 1014 |
| Figure 326. | USART example of synchronous master transmission. . . . . | 1015 |
| Figure 327. | USART data clock timing diagram in synchronous master mode (M bits = 00) . . . . . | 1015 |
| Figure 328. | USART data clock timing diagram in synchronous master mode (M bits = 01) . . . . . | 1016 |
| Figure 329. | USART data clock timing diagram in synchronous slave mode (M bits = 00) . . . . . | 1017 |
| Figure 330. | ISO 7816-3 asynchronous protocol . . . . . | 1019 |
| Figure 331. | Parity error detection using the 1.5 stop bits . . . . . | 1021 |
| Figure 332. | IrDA SIR ENDEC block diagram. . . . . | 1025 |
| Figure 333. | IrDA data modulation (3/16) - normal mode . . . . . | 1025 |
| Figure 334. | Transmission using DMA . . . . . | 1027 |
| Figure 335. | Reception using DMA . . . . . | 1028 |
| Figure 336. | Hardware flow control between 2 USARTs . . . . . | 1028 |
| Figure 337. | RS232 RTS flow control . . . . . | 1029 |
| Figure 338. | RS232 CTS flow control . . . . . | 1030 |
| Figure 339. | Wake-up event verified (wake-up event = address match, FIFO disabled) . . . . . | 1033 |
| Figure 340. | Wake-up event not verified (wake-up event = address match, FIFO disabled) . . . . . | 1033 |
| Figure 341. | LPUART block diagram . . . . . | 1074 |
| Figure 342. | LPUART word length programming . . . . . | 1077 |
| Figure 343. | Configurable stop bits . . . . . | 1079 |
| Figure 344. | TC/TXE behavior when transmitting . . . . . | 1081 |
| Figure 345. | lpuart_ker_ck clock divider block diagram . . . . . | 1084 |
| Figure 346. | Mute mode using Idle line detection . . . . . | 1088 |
| Figure 347. Mute mode using address mark detection . . . . . | 1089 |
| Figure 348. Transmission using DMA . . . . . | 1091 |
| Figure 349. Reception using DMA . . . . . | 1092 |
| Figure 350. Hardware flow control between 2 LPUARTs . . . . . | 1093 |
| Figure 351. RS232 RTS flow control . . . . . | 1093 |
| Figure 352. RS232 CTS flow control . . . . . | 1094 |
| Figure 353. Wake-up event verified (wake-up event = address match, FIFO disabled) . . . . . | 1097 |
| Figure 354. Wake-up event not verified (wake-up event = address match, FIFO disabled) . . . . . | 1097 |
| Figure 355. SPI block diagram. . . . . | 1126 |
| Figure 356. Full-duplex single master/ single slave application. . . . . | 1127 |
| Figure 357. Half-duplex single master/ single slave application . . . . . | 1128 |
| Figure 358. Simplex single master/single slave application (master in transmit-only/ slave in receive-only mode) . . . . . | 1129 |
| Figure 359. Master and three independent slaves. . . . . | 1130 |
| Figure 360. Multimaster application. . . . . | 1131 |
| Figure 361. Hardware/software slave select management . . . . . | 1132 |
| Figure 362. Data clock timing diagram . . . . . | 1133 |
| Figure 363. Data alignment when data length is not equal to 8-bit or 16-bit . . . . . | 1134 |
| Figure 364. Packing data in FIFO for transmission and reception. . . . . | 1138 |
| Figure 365. Master full-duplex communication . . . . . | 1141 |
| Figure 366. Slave full-duplex communication . . . . . | 1142 |
| Figure 367. Master full-duplex communication with CRC . . . . . | 1143 |
| Figure 368. Master full-duplex communication in packed mode . . . . . | 1144 |
| Figure 369. NSSP pulse generation in Motorola SPI master mode. . . . . | 1147 |
| Figure 370. TI mode transfer . . . . . | 1148 |
| Figure 371. I2S block diagram . . . . . | 1151 |
| Figure 372. I 2 S Philips protocol waveforms (16/32-bit full accuracy). . . . . | 1153 |
| Figure 373. I 2 S Philips standard waveforms (24-bit frame) . . . . . | 1153 |
| Figure 374. Transmitting 0x8EAA33 . . . . . | 1154 |
| Figure 375. Receiving 0x8EAA33 . . . . . | 1154 |
| Figure 376. I 2 S Philips standard (16-bit extended to 32-bit packet frame) . . . . . | 1154 |
| Figure 377. Example of 16-bit data frame extended to 32-bit channel frame . . . . . | 1154 |
| Figure 378. MSB Justified 16-bit or 32-bit full-accuracy length . . . . . | 1155 |
| Figure 379. MSB justified 24-bit frame length . . . . . | 1155 |
| Figure 380. MSB justified 16-bit extended to 32-bit packet frame . . . . . | 1156 |
| Figure 381. LSB justified 16-bit or 32-bit full-accuracy . . . . . | 1156 |
| Figure 382. LSB justified 24-bit frame length. . . . . | 1156 |
| Figure 383. Operations required to transmit 0x3478AE. . . . . | 1157 |
| Figure 384. Operations required to receive 0x3478AE . . . . . | 1157 |
| Figure 385. LSB justified 16-bit extended to 32-bit packet frame . . . . . | 1157 |
| Figure 386. Example of 16-bit data frame extended to 32-bit channel frame . . . . . | 1158 |
| Figure 387. PCM standard waveforms (16-bit) . . . . . | 1158 |
| Figure 388. PCM standard waveforms (16-bit extended to 32-bit packet frame). . . . . | 1159 |
| Figure 389. Start sequence in master mode . . . . . | 1160 |
| Figure 390. Audio sampling frequency definition . . . . . | 1161 |
| Figure 391. I 2 S clock generator architecture . . . . . | 1161 |
| Figure 392. CAN subsystem. . . . . | 1183 |
| Figure 393. FDCAN block diagram . . . . . | 1185 |
| Figure 394. Bit timing . . . . . | 1187 |
| Figure 395. Transceiver delay measurement . . . . . | 1192 |
| Figure 396. Pin control in bus monitoring mode . . . . . | 1193 |
| Figure 397. Pin control in loop-back mode . . . . . | 1196 |
| Figure 398. CAN error state diagram. . . . . | 1197 |
| Figure 399. Message RAM configuration. . . . . | 1198 |
| Figure 400. Standard message ID filter path . . . . . | 1201 |
| Figure 401. Extended message ID filter path. . . . . | 1202 |
| Figure 402. USB peripheral block diagram . . . . . | 1249 |
| Figure 403. Packet buffer areas with examples of buffer description table locations . . . . . | 1256 |
| Figure 404. UCPD block diagram . . . . . | 1298 |
| Figure 405. Clock division and timing elements. . . . . | 1299 |
| Figure 406. K-code transmission . . . . . | 1302 |
| Figure 407. Transmit order for various sizes of data . . . . . | 1303 |
| Figure 408. Packet format . . . . . | 1304 |
| Figure 409. Line format of Hard Reset. . . . . | 1304 |
| Figure 410. Line format of Cable Reset. . . . . | 1305 |
| Figure 411. BIST test data frame. . . . . | 1306 |
| Figure 412. BIST Carrier Mode 2 frame. . . . . | 1306 |
| Figure 413. UCPD BMC transmitter architecture. . . . . | 1307 |
| Figure 414. UCPD BMC receiver architecture . . . . . | 1308 |
| Figure 415. HDMI-CEC block diagram . . . . . | 1336 |
| Figure 416. Message structure . . . . . | 1337 |
| Figure 417. Blocks . . . . . | 1337 |
| Figure 418. Bit timings . . . . . | 1338 |
| Figure 419. Signal free time. . . . . | 1338 |
| Figure 420. Arbitration phase. . . . . | 1339 |
| Figure 421. SFT of three nominal bit periods. . . . . | 1339 |
| Figure 422. Error bit timing . . . . . | 1340 |
| Figure 423. Error handling . . . . . | 1341 |
| Figure 424. TXERR detection . . . . . | 1343 |
| Figure 425. Block diagram of STM32G0x1 MCU and Cortex ® -M0+-level debug support . . . . . | 1353 |
Chapters
- 1. Documentation conventions
- 2. Memory and bus architecture
- 3. Embedded flash memory (FLASH)
- 4. Power control (PWR)
- 5. Reset and clock control (RCC)
- 6. Clock recovery system (CRS)
- 7. General-purpose I/Os (GPIO)
- 8. System configuration controller (SYSCFG)
- 9. Interconnect matrix
- 10. Direct memory access controller (DMA)
- 11. DMA request multiplexer (DMAMUX)
- 12. Nested vectored interrupt controller (NVIC)
- 13. Extended interrupt and event controller (EXTI)
- 14. Cyclic redundancy check calculation unit (CRC)
- 15. Analog-to-digital converter (ADC)
- 16. Digital-to-analog converter (DAC)
- 17. Voltage reference buffer (VREFBUF)
- 18. Comparator (COMP)
- 19. True random number generator (RNG)
- 20. AES hardware accelerator (AES)
- 21. Advanced-control timer (TIM1)
- 22. General-purpose timers (TIM2/TIM3/TIM4)
- 23. Basic timers (TIM6/TIM7)
- 24. General-purpose timers (TIM14)
- 25. General-purpose timers (TIM15/TIM16/TIM17)
- 26. Low-power timer (LPTIM)
- 27. Infrared interface (IRTIM)
- 28. Independent watchdog (IWDG)
- 29. System window watchdog (WWDG)
- 30. Real-time clock (RTC)
- 31. Tamper and backup registers (TAMP)
- 32. Inter-integrated circuit interface (I2C)
- 33. Universal synchronous receiver transmitter (USART)
- 34. Low-power universal asynchronous receiver transmitter (LPUART)
- 35. Serial peripheral interface / integrated interchip sound (SPI/I2S)
- 36. FD controller area network (FDCAN)
- 37. Universal serial bus full-speed host/device interface (USB)
- 38. USB Type-C ® /USB Power Delivery interface (UCPD)
- 39. HDMI-CEC controller (CEC)
- 40. Debug support (DBG)
- 41. Device electronic signature
- 42. Important security notice
- 43. Revision history
- Index