RM0490-STM32C0

This reference manual complements the datasheets of the STM32C0 series microcontrollers, providing information required for application and in particular for software development. It pertains to the superset of feature sets available on STM32C0 series microcontrollers.

For feature set, ordering information, and mechanical and electrical characteristics of a particular STM32C0 series device, refer to its corresponding datasheet.

For information on the Arm® Cortex®-M0+ core, refer to the Cortex®-M0+ technical reference manual.

The STM32C0 series microcontrollers include ST state-of-the-art patented technology.


a. Available on STMicroelectronics website www.st.com

Contents

1Documentation conventions41
1.1General information41
1.2List of abbreviations for registers41
1.3Register reset value42
1.4Glossary42
1.5Availability of peripherals42
2Memory and bus architecture43
2.1System architecture43
2.2Memory organization45
2.2.1Introduction45
2.2.2Memory map and register boundary addresses46
2.3Embedded SRAM51
2.4FDCAN RAM52
2.5Flash memory overview52
3Boot modes53
3.1Boot configuration53
3.1.1Physical remap54
3.1.2Embedded boot loader54
3.1.3Forcing boot from main flash memory54
3.1.4Empty check54
4Embedded flash memory (FLASH)56
4.1FLASH Introduction56
4.2FLASH main features56
4.3FLASH functional description56
4.3.1Flash memory organization56
4.3.2FLASH read access latency59
4.3.3Flash memory acceleration59
4.3.4FLASH program and erase operations60
4.3.5FLASH main memory erase sequences61
4.3.6FLASH main memory programming sequences62
4.4FLASH option bytes .....66
4.4.1FLASH option byte description .....66
4.4.2FLASH option byte programming .....67
4.5Flash memory protection .....69
4.5.1FLASH read protection (RDP) .....69
4.5.2FLASH proprietary code readout protection (PCROP) .....72
4.5.3FLASH write protection (WRP) .....73
4.5.4Securable memory area .....74
4.5.5Disabling core debug access .....75
4.5.6Forcing boot from main flash memory .....75
4.6FLASH interrupts .....76
4.7FLASH registers .....77
4.7.1FLASH access control register (FLASH_ACR) .....77
4.7.2FLASH key register (FLASH_KEYR) .....78
4.7.3FLASH option key register (FLASH_OPTKEYR) .....78
4.7.4FLASH status register (FLASH_SR) .....79
4.7.5FLASH control register (FLASH_CR) .....81
4.7.6FLASH option register (FLASH_OPTR) .....83
4.7.7FLASH PCROP area A start address register
(FLASH_PCROP1ASR) .....
85
4.7.8FLASH PCROP area A end address register
(FLASH_PCROP1AER) .....
86
4.7.9FLASH WRP area A address register (FLASH_WRP1AR) .....86
4.7.10FLASH WRP area B address register (FLASH_WRP1BR) .....87
4.7.11FLASH PCROP area B start address register
(FLASH_PCROP1BSR) .....
88
4.7.12FLASH PCROP area B end address register
(FLASH_PCROP1BER) .....
88
4.7.13FLASH security register (FLASH_SECR) .....89
4.7.14FLASH register map .....90
5Power control (PWR) .....92
5.1Power supplies and voltage references .....92
5.1.1ADC reference voltage .....92
5.1.2Voltage regulator .....93
5.2Power supply supervisor .....93
5.2.1Power-on reset (POR) / power-down reset (PDR) / brown-out reset
(BOR) .....
93
5.3Operating modes95
5.3.1Power saving in run mode97
5.3.2Low-power modes98
5.4PWR registers102
5.4.1PWR control register 1 (PWR_CR1)102
5.4.2PWR control register 1 (PWR_CR2)103
5.4.3PWR control register 3 (PWR_CR3)104
5.4.4PWR control register 4 (PWR_CR4)105
5.4.5PWR status register 1 (PWR_SR1)106
5.4.6PWR status register 2 (PWR_SR2)107
5.4.7PWR status clear register (PWR_SCR)108
5.4.8PWR Port A pull-up control register (PWR_PUCRA)109
5.4.9PWR Port A pull-down control register (PWR_PDCRA)109
5.4.10PWR Port B pull-up control register (PWR_PUCRB)110
5.4.11PWR Port B pull-down control register (PWR_PDCRB)110
5.4.12PWR Port C pull-up control register (PWR_PUCRC)111
5.4.13PWR Port C pull-down control register (PWR_PDCRC)111
5.4.14PWR Port D pull-up control register (PWR_PUCRD)112
5.4.15PWR Port D pull-down control register (PWR_PDCRD)113
5.4.16PWR Port F pull-up control register (PWR_PUCRF)114
5.4.17PWR Port F pull-down control register (PWR_PDCRF)114
5.4.18PWR backup x register (PWR_BKPxR)115
5.4.19PWR register map115
6Reset and clock control (RCC)118
6.1Reset118
6.1.1Power reset118
6.1.2System reset118
6.1.3RTC domain reset120
6.2Clocks121
6.2.1HSE clock123
6.2.2HSI48 clock125
6.2.3HSIUSB48 clock125
6.2.4LSE clock126
6.2.5LSI clock126
6.2.6System clock (SYSCLK) selection127
6.2.7Clock security system (CSS)127
6.2.8Clock security system for LSE clock (LSECSS) .....127
6.2.9ADC clock .....128
6.2.10RTC clock .....128
6.2.11Timer clock .....128
6.2.12Watchdog clock .....129
6.2.13Clock-out capability .....129
6.2.14Internal/external clock measurement with TIM14/TIM16/TIM17 .....129
6.2.15Peripheral clock enable registers .....132
6.3Low-power modes .....132
6.4RCC registers .....133
6.4.1RCC clock control register (RCC_CR) .....133
6.4.2RCC internal clock source calibration register (RCC_ICSCR) .....135
6.4.3RCC clock configuration register (RCC_CFGR) .....136
6.4.4RCC clock recovery RC register (RCC_CRRCR) .....139
6.4.5RCC clock interrupt enable register (RCC_CIER) .....139
6.4.6RCC clock interrupt flag register (RCC_CIFR) .....140
6.4.7RCC clock interrupt clear register (RCC_CICR) .....142
6.4.8RCC I/O port reset register (RCC_IOPRSTR) .....143
6.4.9RCC AHB peripheral reset register (RCC_AHBRSTR) .....144
6.4.10RCC APB peripheral reset register 1 (RCC_APBRSTR1) .....144
6.4.11RCC APB peripheral reset register 2 (RCC_APBRSTR2) .....146
6.4.12RCC I/O port clock enable register (RCC_IOPENR) .....147
6.4.13RCC AHB peripheral clock enable register (RCC_AHBENR) .....148
6.4.14RCC APB peripheral clock enable register 1 (RCC_APBENR1) .....149
6.4.15RCC APB peripheral clock enable register 2 (RCC_APBENR2) .....151
6.4.16RCC I/O port in Sleep mode clock enable register
(RCC_IOPSMENR) .....
153
6.4.17RCC AHB peripheral clock enable in Sleep/Stop mode register
(RCC_AHBSMENR) .....
154
6.4.18RCC APB peripheral clock enable in Sleep/Stop mode register 1
(RCC_APBSMENR1) .....
154
6.4.19RCC APB peripheral clock enable in Sleep/Stop mode register 2
(RCC_APBSMENR2) .....
157
6.4.20RCC peripherals independent clock configuration register 1
(RCC_CCIPR) .....
158
6.4.21RCC peripherals independent clock configuration register 2
(RCC_CCIPR2) .....
159
6.4.22RCC control/status register 1 (RCC_CSR1) .....159
6.4.23RCC control/status register 2 (RCC_CSR2) .....161
6.4.24RCC register map .....163
7Clock recovery system (CRS) .....166
7.1CRS introduction .....166
7.2CRS main features .....166
7.3CRS implementation .....166
7.4CRS functional description .....167
7.4.1CRS block diagram .....167
7.4.2CRS internal signals .....167
7.4.3Synchronization input .....168
7.4.4Frequency error measurement .....168
7.4.5Frequency error evaluation and automatic trimming .....169
7.4.6CRS initialization and configuration .....170
7.5CRS in low-power modes .....171
7.6CRS interrupts .....171
7.7CRS registers .....171
7.7.1CRS control register (CRS_CR) .....171
7.7.2CRS configuration register (CRS_CFGR) .....173
7.7.3CRS interrupt and status register (CRS_ISR) .....174
7.7.4CRS interrupt flag clear register (CRS_ICR) .....176
7.7.5CRS register map .....176
8General-purpose I/Os (GPIO) .....178
8.1Introduction .....178
8.2GPIO main features .....178
8.3GPIO functional description .....178
8.3.1General-purpose I/O (GPIO) .....180
8.3.2I/O pin alternate function multiplexer and mapping .....181
8.3.3I/O port control registers .....182
8.3.4I/O port data registers .....182
8.3.5I/O data bitwise handling .....182
8.3.6GPIO locking mechanism .....182
8.3.7I/O alternate function input/output .....183
8.3.8External interrupt/wake-up lines .....183
8.3.9Input configuration .....183
8.3.10Output configuration .....184
8.3.11Alternate function configuration185
8.3.12Analog configuration186
8.3.13Using the HSE or LSE oscillator pins as GPIOs187
8.3.14Low pin count package adjustment187
8.3.15Reset pin (PF2-NRST) in GPIO mode187
8.4GPIO in low-power modes187
8.5GPIO registers188
8.5.1GPIO port mode register (GPIOx_MODER)
(x = A, B, C, D, F)
188
8.5.2GPIO port output type register (GPIOx_OTYPER)
(x = A, B, C, D, F)
189
8.5.3GPIO port output speed register (GPIOx_OSPEEDR)
(x = A, B, C, D, F)
189
8.5.4GPIO port pull-up/pull-down register (GPIOx_PUPDR)
(x = A, B, C, D, F)
189
8.5.5GPIO port input data register (GPIOx_IDR)
(x = A, B, C, D, F)
190
8.5.6GPIO port output data register (GPIOx_ODR)
(x = A, B, C, D, F)
190
8.5.7GPIO port bit set/reset register (GPIOx_BSRR)
(x = A, B, C, D, F)
191
8.5.8GPIO port configuration lock register (GPIOx_LCKR)
(x = A, B, C, D, F)
191
8.5.9GPIO alternate function low register (GPIOx_AFRL)
(x = A, B, C, D, F)
192
8.5.10GPIO alternate function high register (GPIOx_AFRH)
(x = A, B, C, D, F)
193
8.5.11GPIO port bit reset register (GPIOx_BRR) (x = A, B, C, D, F)194
8.5.12GPIO register map195
9System configuration controller (SYSCFG)196
9.1SYSCFG registers196
9.1.1SYSCFG configuration register 1 (SYSCFG_CFGR1)196
9.1.2SYSCFG configuration register 2 (SYSCFG_CFGR2)198
9.1.3SYSCFG configuration register 3 (SYSCFG_CFGR3)199
9.1.4SYSCFG interrupt line 0 status register (SYSCFG_ITLINE0)202
9.1.5SYSCFG interrupt line 1 status register (SYSCFG_ITLINE1)203
9.1.6SYSCFG interrupt line 2 status register (SYSCFG_ITLINE2)203
9.1.7SYSCFG interrupt line 3 status register (SYSCFG_ITLINE3)204
9.1.8SYSCFG interrupt line 4 status register (SYSCFG_ITLINE4)204
9.1.9SYSCFG interrupt line 5 status register (SYSCFG_ITLINE5) . . . . .205
9.1.10SYSCFG interrupt line 6 status register (SYSCFG_ITLINE6) . . . . .205
9.1.11SYSCFG interrupt line 7 status register (SYSCFG_ITLINE7) . . . . .205
9.1.12SYSCFG interrupt line 8 status register (SYSCFG_ITLINE8) . . . . .206
9.1.13SYSCFG interrupt line 9 status register (SYSCFG_ITLINE9) . . . . .206
9.1.14SYSCFG interrupt line 10 status register (SYSCFG_ITLINE10) . . . . .207
9.1.15SYSCFG interrupt line 11 status register (SYSCFG_ITLINE11) . . . . .207
9.1.16SYSCFG interrupt line 12 status register (SYSCFG_ITLINE12) . . . . .208
9.1.17SYSCFG interrupt line 13 status register (SYSCFG_ITLINE13) . . . . .208
9.1.18SYSCFG interrupt line 14 status register (SYSCFG_ITLINE14) . . . . .208
9.1.19SYSCFG interrupt line 15 status register (SYSCFG_ITLINE15) . . . . .209
9.1.20SYSCFG interrupt line 16 status register (SYSCFG_ITLINE16) . . . . .209
9.1.21SYSCFG interrupt line 19 status register (SYSCFG_ITLINE19) . . . . .209
9.1.22SYSCFG interrupt line 20 status register (SYSCFG_ITLINE20) . . . . .210
9.1.23SYSCFG interrupt line 21 status register (SYSCFG_ITLINE21) . . . . .210
9.1.24SYSCFG interrupt line 22 status register (SYSCFG_ITLINE22) . . . . .210
9.1.25SYSCFG interrupt line 23 status register (SYSCFG_ITLINE23) . . . . .211
9.1.26SYSCFG interrupt line 24 status register (SYSCFG_ITLINE24) . . . . .211
9.1.27SYSCFG interrupt line 25 status register (SYSCFG_ITLINE25) . . . . .211
9.1.28SYSCFG interrupt line 26 status register (SYSCFG_ITLINE26) . . . . .212
9.1.29SYSCFG interrupt line 27 status register (SYSCFG_ITLINE27) . . . . .212
9.1.30SYSCFG interrupt line 28 status register (SYSCFG_ITLINE28) . . . . .212
9.1.31SYSCFG interrupt line 29 status register (SYSCFG_ITLINE29) . . . . .213
9.1.32SYSCFG interrupt line 30 status register (SYSCFG_ITLINE30) . . . . .213
9.1.33SYSCFG interrupt line 31 status register (SYSCFG_ITLINE31) . . . . .214
9.1.34SYSCFG register map . . . . .214
10Interconnect matrix . . . . .218
10.1Introduction . . . . .218
10.2Connection summary . . . . .218
10.3Interconnection details . . . . .219
10.3.1From TIM1, TIM2, TIM3, TIM14, TIM15, and TIM17, to TIM1, TIM2,
and TIM3 . . . . .
219
10.3.2From TIM1, TIM2, TIM3, TIM15, and EXTI, to ADC . . . . .220
10.3.3From ADC to TIM1 . . . . .220
10.3.4From HSE, LSE, LSI, MCO, MCO2, and RTC, to TIM14,
TIM16, and TIM17 . . . . .
220
10.3.5From internal analog sources to ADC221
10.3.6From system errors to TIM1, TIM15, TIM16, and TIM17221
10.3.7From TIM16, TIM17, USART1, and USART2, to IRTIM221
10.3.8From TIM14 and EXTI to DMAMUX222
11Direct memory access controller (DMA)223
11.1Introduction223
11.2DMA main features223
11.3DMA implementation224
11.3.1DMA1224
11.3.2DMA request mapping224
11.4DMA functional description224
11.4.1DMA block diagram224
11.4.2DMA pins and internal signals225
11.4.3DMA transfers225
11.4.4DMA arbitration226
11.4.5DMA channels226
11.4.6DMA data width, alignment, and endianness230
11.4.7DMA error management231
11.5DMA interrupts232
11.6DMA registers232
11.6.1DMA interrupt status register (DMA_ISR)232
11.6.2DMA interrupt flag clear register (DMA_IFCR)234
11.6.3DMA channel x configuration register (DMA_CCRx)236
11.6.4DMA channel x number of data to transfer register (DMA_CNDTRx)238
11.6.5DMA channel x peripheral address register (DMA_CPARx)239
11.6.6DMA channel x memory address register (DMA_CMARx)240
11.6.7DMA register map240
12DMA request multiplexer (DMAMUX)243
12.1Introduction243
12.2DMAMUX main features244
12.3DMAMUX implementation244
12.3.1DMAMUX instantiation244
12.3.2DMAMUX mapping244
12.4DMAMUX functional description247
12.4.1DMAMUX block diagram247
12.4.2DMAMUX signals248
12.4.3DMAMUX channels248
12.4.4DMAMUX request line multiplexer248
12.4.5DMAMUX request generator251
12.5DMAMUX interrupts252
12.6DMAMUX registers253
12.6.1DMAMUX request line multiplexer channel x configuration register (DMAMUX_CxCR)253
12.6.2DMAMUX request line multiplexer interrupt channel status register (DMAMUX_CSR)254
12.6.3DMAMUX request line multiplexer interrupt clear flag register (DMAMUX_CFR)254
12.6.4DMAMUX request generator channel x configuration register (DMAMUX_RGxCR)255
12.6.5DMAMUX request generator interrupt status register (DMAMUX_RGSR)256
12.6.6DMAMUX request generator interrupt clear flag register (DMAMUX_RGCFR)256
12.6.7DMAMUX register map257
13Nested vectored interrupt controller (NVIC)259
13.1Main features259
13.2SysTick calibration value register259
13.3Interrupt and exception vectors259
14Extended interrupt and event controller (EXTI)262
14.1EXTI main features262
14.2EXTI block diagram262
14.2.1EXTI connections between peripherals and CPU264
14.3EXTI functional description264
14.3.1EXTI configurable event input wake-up265
14.3.2EXTI direct event input wake-up265
14.3.3EXTI multiplexer266
14.4EXTI functional behavior267
14.5EXTI registers268
14.5.1EXTI rising trigger selection register 1 (EXTI_RTSR1)268
14.5.2EXTI falling trigger selection register 1 (EXTI_FTSR1)269
14.5.3EXTI software interrupt event register 1 (EXTI_SWIER1) . . . . .269
14.5.4EXTI rising edge pending register 1 (EXTI_RPR1) . . . . .270
14.5.5EXTI falling edge pending register 1 (EXTI_FPR1) . . . . .270
14.5.6EXTI rising trigger selection register 2 (EXTI_RTSR2) . . . . .271
14.5.7EXTI falling trigger selection register 2 (EXTI_FTSR2) . . . . .271
14.5.8EXTI software interrupt event register 2 (EXTI_SWIER2) . . . . .272
14.5.9EXTI rising edge pending register 2 (EXTI_RPR2) . . . . .272
14.5.10EXTI falling edge pending register 2 (EXTI_FPR2) . . . . .273
14.5.11EXTI external interrupt selection register (EXTI_EXTICRx) . . . . .273
14.5.12EXTI CPU wake-up with interrupt mask register 1 (EXTI_IMR1) . . . . .275
14.5.13EXTI CPU wake-up with event mask register (EXTI_EMR1) . . . . .276
14.5.14EXTI CPU wake-up with interrupt mask register 2 (EXTI_IMR2) . . . . .276
14.5.15EXTI CPU wake-up with event mask register 2 (EXTI_EMR2) . . . . .277
14.5.16EXTI register map . . . . .278
15Cyclic redundancy check calculation unit (CRC) . . . . .280
15.1CRC introduction . . . . .280
15.2CRC main features . . . . .280
15.3CRC functional description . . . . .281
15.3.1CRC block diagram . . . . .281
15.3.2CRC internal signals . . . . .281
15.3.3CRC operation . . . . .281
15.4CRC registers . . . . .283
15.4.1CRC data register (CRC_DR) . . . . .283
15.4.2CRC independent data register (CRC_IDR) . . . . .283
15.4.3CRC control register (CRC_CR) . . . . .284
15.4.4CRC initial value (CRC_INIT) . . . . .285
15.4.5CRC polynomial (CRC_POL) . . . . .285
15.4.6CRC register map . . . . .286
16Analog-to-digital converter (ADC) . . . . .287
16.1Introduction . . . . .287
16.2ADC main features . . . . .288
16.3ADC implementation . . . . .289
16.4ADC functional description . . . . .290
16.4.1ADC pins and internal signals . . . . .291
16.4.2ADC voltage regulator (ADVREGEN) .....292
16.4.3Calibration (ADCAL) .....292
16.4.4ADC on-off control (ADEN, ADDIS, ADRDY) .....294
16.4.5ADC clock (CKMODE, PRESC[3:0]) .....296
16.4.6ADC connectivity .....298
16.4.7Configuring the ADC .....299
16.4.8Channel selection (CHSEL, SCANDIR, CHSELRMOD) .....299
16.4.9Programmable sampling time (SMPx[2:0]) .....300
16.4.10Single conversion mode (CONT = 0) .....301
16.4.11Continuous conversion mode (CONT = 1) .....301
16.4.12Starting conversions (ADSTART) .....302
16.4.13Timings .....303
16.4.14Stopping an ongoing conversion (ADSTP) .....304
16.5Conversion on external trigger and trigger polarity (EXTSEL, EXTEN) ..304
16.5.1Discontinuous mode (DISCEN) .....305
16.5.2Programmable resolution (RES) - Fast conversion mode .....305
16.5.3End of conversion, end of sampling phase (EOC, EOSMP flags) ....306
16.5.4End of conversion sequence (EOS flag) .....306
16.5.5Example timing diagrams (single/continuous modes
hardware/software triggers) .....
307
16.5.6Low frequency trigger mode .....309
16.6Data management .....309
16.6.1Data register and data alignment (ADC_DR, ALIGN) .....309
16.6.2ADC overrun (OVR, OVRMOD) .....309
16.6.3Managing a sequence of data converted without using the DMA ....311
16.6.4Managing converted data without using the DMA without overrun ...311
16.6.5Managing converted data using the DMA .....311
16.7Low-power features .....312
16.7.1Wait mode conversion .....312
16.7.2Auto-off mode (AUTOFF) .....313
16.8Analog window watchdogs .....315
16.8.1Description of analog watchdog 1 .....315
16.8.2Description of analog watchdog 2 and 3 .....316
16.8.3ADC_AWDx_OUT output signal generation .....316
16.8.4Analog watchdog threshold control .....318
16.9Oversampler .....319
16.9.1ADC operating modes supported when oversampling .....320
16.9.2Analog watchdog321
16.9.3Triggered mode321
16.10Temperature sensor and internal reference voltage321
16.11ADC interrupts324
16.12ADC registers326
16.12.1ADC interrupt and status register (ADC_ISR)326
16.12.2ADC interrupt enable register (ADC_IER)327
16.12.3ADC control register (ADC_CR)329
16.12.4ADC configuration register 1 (ADC_CFGR1)331
16.12.5ADC configuration register 2 (ADC_CFGR2)334
16.12.6ADC sampling time register (ADC_SMPR)336
16.12.7ADC watchdog threshold register (ADC_AWD1TR)337
16.12.8ADC watchdog threshold register (ADC_AWD2TR)337
16.12.9ADC channel selection register (ADC_CHSELR)337
16.12.10ADC channel selection register [alternate] (ADC_CHSELR)338
16.12.11ADC watchdog threshold register (ADC_AWD3TR)340
16.12.12ADC data register (ADC_DR)341
16.12.13ADC analog watchdog 2 configuration register (ADC_AWD2CR)341
16.12.14ADC Analog Watchdog 3 Configuration register (ADC_AWD3CR)342
16.12.15ADC calibration factor (ADC_CALFACT)342
16.12.16ADC common configuration register (ADC_CCR)343
16.13ADC register map344
17Advanced-control timer (TIM1)346
17.1TIM1 introduction346
17.2TIM1 main features347
17.3TIM1 functional description349
17.3.1Time-base unit349
17.3.2Counter modes351
17.3.3Repetition counter362
17.3.4External trigger input364
17.3.5Clock selection365
17.3.6Capture/compare channels369
17.3.7Input capture mode371
17.3.8PWM input mode372
17.3.9Forced output mode373
17.3.10Output compare mode374
17.3.11PWM mode375
17.3.12Asymmetric PWM mode378
17.3.13Combined PWM mode379
17.3.14Combined 3-phase PWM mode380
17.3.15Complementary outputs and dead-time insertion381
17.3.16Using the break function383
17.3.17Bidirectional break inputs389
17.3.18Clearing the OCxREF signal on an external event391
17.3.196-step PWM generation392
17.3.20One-pulse mode393
17.3.21Retriggerable one pulse mode394
17.3.22Encoder interface mode395
17.3.23UIF bit remapping397
17.3.24Timer input XOR function398
17.3.25Interfacing with Hall sensors398
17.3.26Timer synchronization401
17.3.27ADC synchronization405
17.3.28DMA burst mode405
17.3.29Debug mode406
17.4TIM1 registers407
17.4.1TIM1 control register 1 (TIM1_CR1)407
17.4.2TIM1 control register 2 (TIM1_CR2)408
17.4.3TIM1 slave mode control register
(TIM1_SMCR)
411
17.4.4TIM1 DMA/interrupt enable register
(TIM1_DIER)
413
17.4.5TIM1 status register (TIM1_SR)415
17.4.6TIM1 event generation register (TIM1_EGR)417
17.4.7TIM1 capture/compare mode register 1 (TIM1_CCMR1)418
17.4.8TIM1 capture/compare mode register 1 [alternate]
(TIM1_CCMR1)
419
17.4.9TIM1 capture/compare mode register 2 (TIM1_CCMR2)422
17.4.10TIM1 capture/compare mode register 2 [alternate]
(TIM1_CCMR2)
423
17.4.11TIM1 capture/compare enable register
(TIM1_CCER)
424
17.4.12TIM1 counter (TIM1_CNT)428
17.4.13TIM1 prescaler (TIM1_PSC) .....428
17.4.14TIM1 auto-reload register (TIM1_ARR) .....428
17.4.15TIM1 repetition counter register (TIM1_RCR) .....429
17.4.16TIM1 capture/compare register 1
(TIM1_CCR1) .....
429
17.4.17TIM1 capture/compare register 2
(TIM1_CCR2) .....
430
17.4.18TIM1 capture/compare register 3
(TIM1_CCR3) .....
430
17.4.19TIM1 capture/compare register 4
(TIM1_CCR4) .....
431
17.4.20TIM1 break and dead-time register
(TIM1_BDTR) .....
431
17.4.21TIM1 DMA control register
(TIM1_DCR) .....
435
17.4.22TIM1 DMA address for full transfer
(TIM1_DMAR) .....
436
17.4.23TIM1 capture/compare mode register 3
(TIM1_CCMR3) .....
437
17.4.24TIM1 capture/compare register 5
(TIM1_CCR5) .....
438
17.4.25TIM1 capture/compare register 6
(TIM1_CCR6) .....
439
17.4.26TIM1 alternate function option register 1 (TIM1_AF1) .....439
17.4.27TIM1 Alternate function register 2 (TIM1_AF2) .....440
17.4.28TIM1 timer input selection register (TIM1_TISEL) .....441
17.4.29TIM1 register map .....442
18General-purpose timers (TIM2/TIM3) .....445
18.1TIM2/TIM3 introduction .....445
18.2TIM2/TIM3 main features .....445
18.3TIM2/TIM3 functional description .....447
18.3.1Time-base unit .....447
18.3.2Counter modes .....449
18.3.3Clock selection .....459
18.3.4Capture/Compare channels .....463
18.3.5Input capture mode .....465
18.3.6PWM input mode .....466
18.3.7Forced output mode .....467
18.3.8Output compare mode .....467
18.3.9PWM mode .....468
18.3.10Asymmetric PWM mode .....472
18.3.11Combined PWM mode .....472
18.3.12Clearing the OCxREF signal on an external event .....473
18.3.13One-pulse mode .....475
18.3.14Retriggerable one pulse mode .....476
18.3.15Encoder interface mode .....477
18.3.16UIF bit remapping .....479
18.3.17Timer input XOR function .....479
18.3.18Timers and external trigger synchronization .....480
18.3.19Timer synchronization .....483
18.3.20DMA burst mode .....488
18.3.21Debug mode .....489
18.4TIM2/TIM3 registers .....490
18.4.1TIMx control register 1 (TIMx_CR1)(x = 2 to 3) .....490
18.4.2TIMx control register 2 (TIMx_CR2)(x = 2 to 3) .....491
18.4.3TIMx slave mode control register (TIMx_SMCR)(x = 2 to 3) .....493
18.4.4TIMx DMA/Interrupt enable register (TIMx_DIER)(x = 2 to 3) .....496
18.4.5TIMx status register (TIMx_SR)(x = 2 to 3) .....498
18.4.6TIMx event generation register (TIMx_EGR)(x = 2 to 3) .....499
18.4.7TIMx capture/compare mode register 1 (TIMx_CCMR1)(x = 2 to 3) ..500
18.4.8TIMx capture/compare mode register 1 [alternate] (TIMx_CCMR1)
(x = 2 to 3) .....
502
18.4.9TIMx capture/compare mode register 2 (TIMx_CCMR2)(x = 2 to 3) ..504
18.4.10TIMx capture/compare mode register 2 [alternate] (TIMx_CCMR2)
(x = 2 to 3) .....
505
18.4.11TIMx capture/compare enable register
(TIMx_CCER)(x = 2 to 3) .....
506
18.4.12TIMx counter (TIMx_CNT)(x = 2 to 3) .....507
18.4.13TIMx counter [alternate] (TIMx_CNT)(x = 2 to 3) .....508
18.4.14TIMx prescaler (TIMx_PSC)(x = 2 to 3) .....508
18.4.15TIMx auto-reload register (TIMx_ARR)(x = 2 to 3) .....509
18.4.16TIMx capture/compare register 1 (TIMx_CCR1)(x = 2 to 3) .....509
18.4.17TIMx capture/compare register 2 (TIMx_CCR2)(x = 2 to 3) .....509
18.4.18TIMx capture/compare register 3 (TIMx_CCR3)(x = 2 to 3) .....510
18.4.19TIMx capture/compare register 4 (TIMx_CCR4)(x = 2 to 3) .....510
18.4.20TIMx DMA control register (TIMx_DCR)(x = 2 to 3) .....511
18.4.21TIMx DMA address for full transfer (TIMx_DMAR)(x = 2 to 3) .....512
18.4.22TIM2 alternate function option register 1 (TIM2_AF1) .....512
18.4.23TIM3 alternate function option register 1 (TIM3_AF1) .....512
18.4.24TIM2 timer input selection register (TIM2_TISEL) .....513
18.4.25TIM3 timer input selection register (TIM3_TISEL) .....513
18.4.26TIMx register map .....515
19General-purpose timers (TIM14) .....518
19.1TIM14 introduction .....518
19.2TIM14 main features .....518
19.2.1TIM14 main features .....518
19.3TIM14 functional description .....520
19.3.1Time-base unit .....520
19.3.2Counter modes .....522
19.3.3Clock selection .....525
19.3.4Capture/compare channels .....526
19.3.5Input capture mode .....527
19.3.6Forced output mode .....528
19.3.7Output compare mode .....529
19.3.8PWM mode .....530
19.3.9One-pulse mode .....531
19.3.10UIF bit remapping .....531
19.3.11Using timer output as trigger for other timers (TIM14) .....532
19.3.12Debug mode .....532
19.4TIM14 registers .....533
19.4.1TIM14 control register 1 (TIM14_CR1) .....533
19.4.2TIM14 Interrupt enable register (TIM14_DIER) .....534
19.4.3TIM14 status register (TIM14_SR) .....534
19.4.4TIM14 event generation register (TIM14_EGR) .....535
19.4.5TIM14 capture/compare mode register 1 (TIM14_CCMR1) .....536
19.4.6TIM14 capture/compare mode register 1 [alternate] (TIM14_CCMR1) .....537
19.4.7TIM14 capture/compare enable register (TIM14_CCER) .....539
19.4.8TIM14 counter (TIM14_CNT) .....540
19.4.9TIM14 prescaler (TIM14_PSC) .....541
19.4.10TIM14 auto-reload register (TIM14_ARR) .....541
19.4.11TIM14 capture/compare register 1 (TIM14_CCR1) .....541
19.4.12TIM14 timer input selection register (TIM14_TISEL) .....542
19.4.13TIM14 register map .....542
20General-purpose timers (TIM15/TIM16/TIM17)544
20.1TIM15/TIM16/TIM17 introduction544
20.2TIM15 main features544
20.3TIM16/TIM17 main features545
20.4TIM15/TIM16/TIM17 functional description548
20.4.1Time-base unit548
20.4.2Counter modes550
20.4.3Repetition counter554
20.4.4Clock selection555
20.4.5Capture/compare channels557
20.4.6Input capture mode559
20.4.7PWM input mode (only for TIM15)560
20.4.8Forced output mode561
20.4.9Output compare mode562
20.4.10PWM mode563
20.4.11Combined PWM mode (TIM15 only)564
20.4.12Complementary outputs and dead-time insertion565
20.4.13Using the break function567
20.4.14Bidirectional break inputs572
20.4.156-step PWM generation573
20.4.16One-pulse mode575
20.4.17Retriggerable one pulse mode (TIM15 only)576
20.4.18UIF bit remapping577
20.4.19Timer input XOR function (TIM15 only)578
20.4.20External trigger synchronization (TIM15 only)579
20.4.21Slave mode – combined reset + trigger mode581
20.4.22DMA burst mode581
20.4.23Timer synchronization (TIM15)583
20.4.24Using timer output as trigger for other timers (TIM16/TIM17)583
20.4.25Debug mode583
20.5TIM15 registers584
20.5.1TIM15 control register 1 (TIM15_CR1)584
20.5.2TIM15 control register 2 (TIM15_CR2)585
20.5.3TIM15 slave mode control register (TIM15_SMCR)587
20.5.4TIM15 DMA/interrupt enable register (TIM15_DIER)588
20.5.5TIM15 status register (TIM15_SR)589
20.5.6TIM15 event generation register (TIM15_EGR) . . . . .591
20.5.7TIM15 capture/compare mode register 1 (TIM15_CCMR1) . . . . .592
20.5.8TIM15 capture/compare mode register 1 [alternate]
(TIM15_CCMR1) . . . . .
593
20.5.9TIM15 capture/compare enable register (TIM15_CCER) . . . . .596
20.5.10TIM15 counter (TIM15_CNT) . . . . .599
20.5.11TIM15 prescaler (TIM15_PSC) . . . . .599
20.5.12TIM15 auto-reload register (TIM15_ARR) . . . . .599
20.5.13TIM15 repetition counter register (TIM15_RCR) . . . . .600
20.5.14TIM15 capture/compare register 1 (TIM15_CCR1) . . . . .600
20.5.15TIM15 capture/compare register 2 (TIM15_CCR2) . . . . .601
20.5.16TIM15 break and dead-time register (TIM15_BDTR) . . . . .601
20.5.17TIM15 DMA control register (TIM15_DCR) . . . . .604
20.5.18TIM15 DMA address for full transfer (TIM15_DMAR) . . . . .604
20.5.19TIM15 alternate register 1 (TIM15_AF1) . . . . .605
20.5.20TIM15 input selection register (TIM15_TISEL) . . . . .605
20.5.21TIM15 register map . . . . .606
20.6TIM16/TIM17 registers . . . . .609
20.6.1TIMx control register 1 (TIMx_CR1)(x = 16 to 17) . . . . .609
20.6.2TIMx control register 2 (TIMx_CR2)(x = 16 to 17) . . . . .610
20.6.3TIMx DMA/interrupt enable register (TIMx_DIER)(x = 16 to 17) . . . . .611
20.6.4TIMx status register (TIMx_SR)(x = 16 to 17) . . . . .612
20.6.5TIMx event generation register (TIMx_EGR)(x = 16 to 17) . . . . .613
20.6.6TIMx capture/compare mode register 1
(TIMx_CCMR1)(x = 16 to 17) . . . . .
614
20.6.7TIMx capture/compare mode register 1 [alternate]
(TIMx_CCMR1)(x = 16 to 17) . . . . .
615
20.6.8TIMx capture/compare enable register (TIMx_CCER)(x = 16 to 17) . . . . .617
20.6.9TIMx counter (TIMx_CNT)(x = 16 to 17) . . . . .619
20.6.10TIMx prescaler (TIMx_PSC)(x = 16 to 17) . . . . .620
20.6.11TIMx auto-reload register (TIMx_ARR)(x = 16 to 17) . . . . .620
20.6.12TIMx repetition counter register (TIMx_RCR)(x = 16 to 17) . . . . .621
20.6.13TIMx capture/compare register 1 (TIMx_CCR1)(x = 16 to 17) . . . . .621
20.6.14TIMx break and dead-time register (TIMx_BDTR)(x = 16 to 17) . . . . .622
20.6.15TIMx DMA control register (TIMx_DCR)(x = 16 to 17) . . . . .625
20.6.16TIMx DMA address for full transfer (TIMx_DMAR)(x = 16 to 17) . . . . .625
20.6.17TIM16 alternate function register 1 (TIM16_AF1) . . . . .626
20.6.18TIM16 input selection register (TIM16_TISEL) . . . . .626
20.6.19TIM17 alternate function register 1 (TIM17_AF1) .....627
20.6.20TIM17 input selection register (TIM17_TISEL) .....627
20.6.21TIM16/TIM17 register map .....629
21Infrared interface (IRTIM) .....631
22Independent watchdog (IWDG) .....632
22.1Introduction .....632
22.2IWDG main features .....632
22.3IWDG functional description .....632
22.3.1IWDG block diagram .....632
22.3.2Window option .....633
22.3.3Hardware watchdog .....634
22.3.4Register access protection .....634
22.3.5Debug mode .....634
22.4IWDG registers .....635
22.4.1IWDG key register (IWDG_KR) .....635
22.4.2IWDG prescaler register (IWDG_PR) .....636
22.4.3IWDG reload register (IWDG_RLR) .....637
22.4.4IWDG status register (IWDG_SR) .....638
22.4.5IWDG window register (IWDG_WINR) .....639
22.4.6IWDG register map .....640
23System window watchdog (WWDG) .....641
23.1WWDG introduction .....641
23.2WWDG main features .....641
23.3WWDG functional description .....641
23.3.1WWDG block diagram .....642
23.3.2Enabling the watchdog .....642
23.3.3Controlling the down-counter .....642
23.3.4How to program the watchdog timeout .....642
23.3.5Debug mode .....644
23.4WWDG interrupts .....644
23.5WWDG registers .....644
23.5.1WWDG control register (WWDG_CR) .....644
23.5.2WWDG configuration register (WWDG_CFR) .....645
23.5.3WWDG status register (WWDG_SR) .....646
23.5.4WWDG register map .....646
24Real-time clock (RTC) .....647
24.1Introduction .....647
24.2RTC main features .....647
24.3RTC functional description .....648
24.3.1RTC block diagram .....648
24.3.2RTC pins and internal signals .....649
24.3.3GPIO controlled by the RTC .....649
24.3.4Clock and prescalers .....651
24.3.5Real-time clock and calendar .....652
24.3.6Programmable alarms .....652
24.3.7RTC initialization and configuration .....653
24.3.8Reading the calendar .....654
24.3.9Resetting the RTC .....655
24.3.10RTC synchronization .....655
24.3.11RTC reference clock detection .....656
24.3.12RTC smooth digital calibration .....657
24.3.13Timestamp function .....658
24.3.14Calibration clock output .....659
24.3.15Alarm output .....659
24.4RTC low-power modes .....660
24.5RTC interrupts .....660
24.6RTC registers .....661
24.6.1RTC time register (RTC_TR) .....661
24.6.2RTC date register (RTC_DR) .....662
24.6.3RTC sub second register (RTC_SSR) .....663
24.6.4RTC initialization control and status register (RTC_ICSR) .....663
24.6.5RTC prescaler register (RTC_PRER) .....665
24.6.6RTC control register (RTC_CR) .....665
24.6.7RTC write protection register (RTC_WPR) .....668
24.6.8RTC calibration register (RTC_CALR) .....668
24.6.9RTC shift control register (RTC_SHIFTR) .....669
24.6.10RTC timestamp time register (RTC_TSTR) .....670
24.6.11RTC timestamp date register (RTC_TSDR) .....671
24.6.12RTC timestamp sub second register (RTC_TSSSR) . . . . .671
24.6.13RTC alarm A register (RTC_ALRMAR) . . . . .672
24.6.14RTC alarm A sub second register (RTC_ALRMASSR) . . . . .673
24.6.15RTC status register (RTC_SR) . . . . .673
24.6.16RTC masked interrupt status register (RTC_MISR) . . . . .674
24.6.17RTC status clear register (RTC_SCR) . . . . .675
24.6.18RTC register map . . . . .676
25Inter-integrated circuit interface (I2C) . . . . .678
25.1I2C introduction . . . . .678
25.2I2C main features . . . . .678
25.3I2C implementation . . . . .679
25.4I2C functional description . . . . .679
25.4.1I2C block diagram . . . . .680
25.4.2I2C pins and internal signals . . . . .681
25.4.3I2C clock requirements . . . . .681
25.4.4I2C mode selection . . . . .681
25.4.5I2C initialization . . . . .682
25.4.6I2C reset . . . . .686
25.4.7I2C data transfer . . . . .687
25.4.8I2C target mode . . . . .689
25.4.9I2C controller mode . . . . .698
25.4.10I2C_TIMINGR register configuration examples . . . . .709
25.4.11SMBus specific features . . . . .711
25.4.12SMBus initialization . . . . .714
25.4.13SMBus I2C_TIMEOUTR register configuration examples . . . . .716
25.4.14SMBus target mode . . . . .717
25.4.15SMBus controller mode . . . . .720
25.4.16Wake-up from Stop mode on address match . . . . .723
25.4.17Error conditions . . . . .724
25.5I2C in low-power modes . . . . .726
25.6I2C interrupts . . . . .726
25.7I2C DMA requests . . . . .727
25.7.1Transmission using DMA . . . . .727
25.7.2Reception using DMA . . . . .727
25.8I2C debug modes . . . . .728
25.9I2C registers728
25.9.1I2C control register 1 (I2C_CR1)728
25.9.2I2C control register 2 (I2C_CR2)731
25.9.3I2C own address 1 register (I2C_OAR1)733
25.9.4I2C own address 2 register (I2C_OAR2)733
25.9.5I2C timing register (I2C_TIMINGR)734
25.9.6I2C timeout register (I2C_TIMEOUTR)735
25.9.7I2C interrupt and status register (I2C_ISR)736
25.9.8I2C interrupt clear register (I2C_ICR)739
25.9.9I2C PEC register (I2C_PECR)740
25.9.10I2C receive data register (I2C_RXDR)740
25.9.11I2C transmit data register (I2C_TXDR)741
25.9.12I2C register map742
26Universal synchronous receiver transmitter (USART)743
26.1USART introduction743
26.2USART main features744
26.3USART extended features745
26.4USART implementation745
26.5USART functional description747
26.5.1USART block diagram747
26.5.2USART signals748
26.5.3USART character description749
26.5.4USART FIFOs and thresholds751
26.5.5USART transmitter751
26.5.6USART receiver755
26.5.7USART baud rate generation762
26.5.8Tolerance of the USART receiver to clock deviation763
26.5.9USART auto baud rate detection765
26.5.10USART multiprocessor communication767
26.5.11USART Modbus communication769
26.5.12USART parity control770
26.5.13USART LIN (local interconnection network) mode771
26.5.14USART synchronous mode773
26.5.15USART single-wire half-duplex communication777
26.5.16USART receiver timeout777
26.5.17USART smartcard mode778
26.5.18USART IrDA SIR ENDEC block782
26.5.19Continuous communication using USART and DMA785
26.5.20RS232 hardware flow control and RS485 Driver Enable787
26.5.21USART low-power management790
26.6USART in low-power modes793
26.7USART interrupts794
26.8USART registers795
26.8.1USART control register 1 (USART_CR1)795
26.8.2USART control register 1 [alternate] (USART_CR1)798
26.8.3USART control register 2 (USART_CR2)802
26.8.4USART control register 3 (USART_CR3)806
26.8.5USART baud rate register (USART_BRR)810
26.8.6USART guard time and prescaler register (USART_GTPR)810
26.8.7USART receiver timeout register (USART_RTOR)811
26.8.8USART request register (USART_RQR)812
26.8.9USART interrupt and status register (USART_ISR)813
26.8.10USART interrupt and status register [alternate] (USART_ISR)819
26.8.11USART interrupt flag clear register (USART_ICR)824
26.8.12USART receive data register (USART_RDR)826
26.8.13USART transmit data register (USART_TDR)826
26.8.14USART prescaler register (USART_PRESC)827
26.8.15USART register map828
27Serial peripheral interface / integrated interchip sound (SPI/I2S)830
27.1Introduction830
27.2SPI main features830
27.3I2S main features831
27.4SPI/I2S implementation831
27.5SPI functional description832
27.5.1General description832
27.5.2Communications between one master and one slave833
27.5.3Standard multislave communication835
27.5.4Multimaster communication836
27.5.5Slave select (NSS) pin management837
27.5.6Communication formats838
27.5.7Configuration of SPI840
27.5.8Procedure for enabling SPI841
27.5.9Data transmission and reception procedures841
27.5.10SPI status flags851
27.5.11SPI error flags852
27.5.12NSS pulse mode853
27.5.13TI mode853
27.5.14CRC calculation854
27.6SPI interrupts856
27.7I2S functional description857
27.7.1I2S general description857
27.7.2Supported audio protocols858
27.7.3Start-up description865
27.7.4Clock generator867
27.7.5I2S master mode870
27.7.6I2S slave mode871
27.7.7I2S status flags873
27.7.8I2S error flags874
27.7.9DMA features875
27.8I2S interrupts875
27.9SPI and I2S registers876
27.9.1SPI control register 1 (SPIx_CR1)876
27.9.2SPI control register 2 (SPIx_CR2)878
27.9.3SPI status register (SPIx_SR)880
27.9.4SPI data register (SPIx_DR)882
27.9.5SPI CRC polynomial register (SPIx_CRCPR)882
27.9.6SPI Rx CRC register (SPIx_RXCRCR)882
27.9.7SPI Tx CRC register (SPIx_TXCRCR)883
27.9.8SPIx_I2S configuration register (SPIx_I2SCFGR)883
27.9.9SPIx_I2S prescaler register (SPIx_I2SPR)885
27.9.10SPI/I2S register map887
28FD controller area network (FDCAN)888
28.1FDCAN introduction888
28.2FDCAN main features890
28.3FDCAN functional description891
28.3.1FDCAN block diagram . . . . .891
28.3.2FDCAN pins and internal signals . . . . .892
28.3.3Bit timing . . . . .893
28.3.4Operating modes . . . . .894
28.3.5Error management . . . . .903
28.3.6Message RAM . . . . .904
28.3.7FIFO acknowledge handling . . . . .913
28.3.8FDCAN Rx FIFO element . . . . .913
28.3.9FDCAN Tx buffer element . . . . .915
28.3.10FDCAN Tx event FIFO element . . . . .917
28.3.11FDCAN standard message ID filter element . . . . .918
28.3.12FDCAN extended message ID filter element . . . . .919
28.4FDCAN registers . . . . .921
28.4.1FDCAN core release register (FDCAN_CREL) . . . . .921
28.4.2FDCAN endian register (FDCAN_ENDN) . . . . .921
28.4.3FDCAN data bit timing and prescaler register (FDCAN_DBTP) . . . . .921
28.4.4FDCAN test register (FDCAN_TEST) . . . . .922
28.4.5FDCAN RAM watchdog register (FDCAN_RWD) . . . . .923
28.4.6FDCAN CC control register (FDCAN_CCCR) . . . . .924
28.4.7FDCAN nominal bit timing and prescaler register (FDCAN_NBTP) . . . . .925
28.4.8FDCAN timestamp counter configuration register (FDCAN_TSCC) . . . . .927
28.4.9FDCAN timestamp counter value register (FDCAN_TSCV) . . . . .927
28.4.10FDCAN timeout counter configuration register (FDCAN_TOCC) . . . . .928
28.4.11FDCAN timeout counter value register (FDCAN_TOCV) . . . . .929
28.4.12FDCAN error counter register (FDCAN_ECR) . . . . .929
28.4.13FDCAN protocol status register (FDCAN_PSR) . . . . .930
28.4.14FDCAN transmitter delay compensation register (FDCAN_TDCR) . . . . .932
28.4.15FDCAN interrupt register (FDCAN_IR) . . . . .932
28.4.16FDCAN interrupt enable register (FDCAN_IE) . . . . .935
28.4.17FDCAN interrupt line select register (FDCAN_ILS) . . . . .937
28.4.18FDCAN interrupt line enable register (FDCAN_ILE) . . . . .938
28.4.19FDCAN global filter configuration register (FDCAN_RXGFC) . . . . .938
28.4.20FDCAN extended ID and mask register (FDCAN_XIDAM) . . . . .940
28.4.21FDCAN high-priority message status register (FDCAN_HPMS) . . . . .940
28.4.22FDCAN Rx FIFO 0 status register (FDCAN_RXF0S) . . . . .941
28.4.23CAN Rx FIFO 0 acknowledge register (FDCAN_RXF0A) . . . . .942
28.4.24FDCAN Rx FIFO 1 status register (FDCAN_RXF1S) . . . . .942
28.4.25FDCAN Rx FIFO 1 acknowledge register (FDCAN_RXF1A) . . . . .943
28.4.26FDCAN Tx buffer configuration register (FDCAN_TXBC) . . . . .943
28.4.27FDCAN Tx FIFO/queue status register (FDCAN_TXFQS) . . . . .944
28.4.28FDCAN Tx buffer request pending register (FDCAN_TXBRP) . . . . .944
28.4.29FDCAN Tx buffer add request register (FDCAN_TXBAR) . . . . .945
28.4.30FDCAN Tx buffer cancellation request register (FDCAN_TXBCR) . . .946
28.4.31FDCAN Tx buffer transmission occurred register (FDCAN_TXBTO) . .946
28.4.32FDCAN Tx buffer cancellation finished register (FDCAN_TXBCF) . . .947
28.4.33FDCAN Tx buffer transmission interrupt enable register
(FDCAN_TXBTIE) . . . . .
947
28.4.34FDCAN Tx buffer cancellation finished interrupt enable register
(FDCAN_TXBCIE) . . . . .
948
28.4.35FDCAN Tx event FIFO status register (FDCAN_TXEFS) . . . . .948
28.4.36FDCAN Tx event FIFO acknowledge register (FDCAN_TXEFA) . . . .949
28.4.37FDCAN CFG clock divider register (FDCAN_CKDIV) . . . . .949
28.4.38FDCAN register map . . . . .950
29Universal serial bus full-speed host/device interface (USB) . . . . .954
29.1USB introduction . . . . .954
29.2USB main features . . . . .954
29.3USB implementation . . . . .954
29.4USB functional description . . . . .955
29.4.1USB block diagram . . . . .955
29.4.2USB pins and internal signals . . . . .956
29.4.3USB reset and clocks . . . . .956
29.4.4General description and Device mode functionality . . . . .956
29.4.5Description of USB blocks used in both Device and Host modes . . .957
29.4.6Description of host frame scheduler (HFS) specific to Host mode . .958
29.5Programming considerations for Device and Host modes . . . . .959
29.5.1Generic USB Device programming . . . . .959
29.5.2System and power-on reset . . . . .960
29.5.3Double-buffered endpoints and usage in Device mode . . . . .967
29.5.4Double buffered channels: usage in Host mode . . . . .969
29.5.5Isochronous transfers in Device mode . . . . .970
29.5.6Isochronous transfers in Host mode . . . . .971
29.5.7Suspend/resume events . . . . .972
29.6USB registers . . . . .975
29.6.1USB control register (USB_CNTR) .....976
29.6.2USB interrupt status register (USB_ISTR) .....979
29.6.3USB frame number register (USB_FNR) .....983
29.6.4USB Device address (USB_DADDR) .....983
29.6.5USB LPM control and status register (USB_LPMCSR) .....984
29.6.6USB battery charging detector (USB_BCDR) .....985
29.6.7USB endpoint/channel n register (USB_CHEPnR) .....986
29.7USBSRAM registers .....995
29.7.1Channel/endpoint transmit buffer descriptor n
(USB_CHEP_TXRXBD_n) .....
996
29.7.2Channel/endpoint receive buffer descriptor n [alternate]
(USB_CHEP_TXRXBD_n) .....
996
29.7.3Channel/endpoint receive buffer descriptor n
(USB_CHEP_RXTXBD_n) .....
998
29.7.4Channel/endpoint transmit buffer descriptor n [alternate]
(USB_CHEP_RXTXBD_n) .....
999
29.7.5USBSRAM register map .....1000
30Debug support (DBG) .....1001
30.1Overview .....1001
30.2Reference Arm documentation .....1002
30.3Pinout and debug port pins .....1002
30.3.1SWD port pins .....1002
30.3.2SW-DP pin assignment .....1002
30.3.3Internal pull-up & pull-down on SWD pins .....1003
30.4ID codes and locking mechanism .....1003
30.5SWD port .....1003
30.5.1SWD protocol introduction .....1003
30.5.2SWD protocol sequence .....1003
30.5.3SW-DP state machine (reset, idle states, ID code) .....1004
30.5.4DP and AP read/write accesses .....1005
30.5.5SW-DP registers .....1005
30.5.6SW-AP registers .....1006
30.6Core debug .....1007
30.7BPU (break point unit) .....1007
30.7.1BPU functionality .....1008
30.8DWT (data watchpoint) .....1008
30.8.1DWT functionality . . . . .1008
30.8.2DWT Program counter sample register . . . . .1008
30.9MCU debug component (DBG) . . . . .1008
30.9.1Debug support for low-power modes . . . . .1008
30.9.2Debug support for timers, watchdog, and I2C . . . . .1009
30.10DBG registers . . . . .1009
30.10.1DBG device ID code register (DBG_IDCODE) . . . . .1009
30.10.2DBG configuration register (DBG_CR) . . . . .1010
30.10.3DBG APB freeze register 1 (DBG_APB_FZ1) . . . . .1010
30.10.4DBG APB freeze register 2 (DBG_APB_FZ2) . . . . .1012
30.10.5DBG register map . . . . .1014
31Device electronic signature . . . . .1015
31.1Unique device ID register (96 bits) (UID) . . . . .1015
31.2Flash memory size data register (FSIZER) . . . . .1016
31.3Package data register (PCKR) . . . . .1016
32Important security notice . . . . .1018
33Revision history . . . . .1019

List of tables

Table 1.Peripherals or functions versus products .....42
Table 2.STM32C011xx and STM32C031xx boundary addresses.....47
Table 3.STM32C051xx boundary addresses .....47
Table 4.STM32C071xx boundary addresses .....48
Table 5.STM32C091xx boundary addresses .....48
Table 6.STM32C092xx boundary addresses .....49
Table 7.STM32C0 series peripheral register boundary addresses .....49
Table 8.SRAM size .....51
Table 9.Boot modes.....53
Table 10.Flash memory organization for STM32C011xx and STM32C031xx.....57
Table 11.Flash memory organization for STM32C051xx.....57
Table 12.Flash memory organization for STM32C071xx.....58
Table 13.Flash memory organization for STM32C091xx/92xx .....58
Table 14.LATENCY[2:0] setting as function of HCLK frequency .....59
Table 15.Page erase overview .....61
Table 16.Mass erase overview .....62
Table 17.Option byte format .....66
Table 18.Organization of option bytes .....66
Table 19.Flash memory read protection status .....69
Table 21.Access status versus protection level and execution modes .....71
Table 22.PCROP protection .....73
Table 24.Securable memory erase at RDP level 1 to level 0 change .....75
Table 25.FLASH interrupt requests .....76
Table 26.FLASH register map and reset values .....90
Table 27.Device resources enabled in different operating modes.....96
Table 28.Low-power mode entry overview .....99
Table 29.Low-power mode exit overview .....101
Table 30.PWR register map and reset values .....115
Table 31.RCC register map and reset values .....163
Table 32.CRS features .....166
Table 33.CRS internal input/output signals .....167
Table 34.CRS interconnection.....168
Table 35.Effect of low-power modes on CRS .....171
Table 36.Interrupt control bits .....171
Table 37.CRS register map and reset values .....176
Table 38.Port bit configuration table .....179
Table 39.Effect of low-power modes on the GPIO .....187
Table 40.GPIO register map and reset values .....195
Table 41.SYSCFG register map and reset values.....214
Table 42.Interconnect matrix .....218
Table 43.DMA implementation .....224
Table 44.DMA internal input/output signals .....225
Table 45.Programmable data width and endian behavior (when PINC = MINC = 1) .....230
Table 46.DMA interrupt requests.....232
Table 47.DMA register map and reset values .....240
Table 48.DMAMUX instantiation .....244
Table 49.DMAMUX: assignment of multiplexer inputs to resources .....245
Table 50.DMAMUX: assignment of trigger inputs to resources .....245
Table 51.DMAMUX: assignment of synchronization inputs to resources246
Table 52.DMAMUX signals248
Table 53.DMAMUX interrupts252
Table 54.DMAMUX register map and reset values257
Table 55.DMAMUX register map and reset values258
Table 56.Vector table259
Table 57.EXTI signal overview263
Table 58.EVG pin overview263
Table 59.EXTI event input configurations and register control264
Table 60.EXTI line connections267
Table 61.Masking functionality267
Table 62.EXTI register map sections268
Table 63.EXTI controller register map and reset values278
Table 64.CRC internal input/output signals281
Table 65.CRC register map and reset values286
Table 66.ADC main features289
Table 67.ADC input/output pins291
Table 68.ADC internal input/output signals291
Table 69.External triggers291
Table 70.Latency between trigger and start of conversion297
Table 71.Configuring the trigger polarity304
Table 72.tSAR timings depending on resolution306
Table 73.Analog watchdog comparison315
Table 74.Analog watchdog 1 channel selection316
Table 75.Maximum output results vs N and M. Grayed values indicates truncation320
Table 76.ADC interrupts324
Table 77.ADC register map and reset values344
Table 78.Behavior of timer outputs versus BRK/BRK2 inputs388
Table 79.Break protection disarming conditions390
Table 80.Counting direction versus encoder signals396
Table 81.TIM1 internal trigger connection413
Table 82.Output control bits for complementary OCx and OCxN channels with break feature427
Table 83.TIM1 register map and reset values442
Table 84.Counting direction versus encoder signals478
Table 85.TIM2/TIM3 internal trigger connection496
Table 86.Output control bit for standard OCx channels507
Table 87.TIM2/TIM3 register map and reset values515
Table 88.Output control bit for standard OCx channels540
Table 89.TIM14 register map and reset values542
Table 90.Break protection disarming conditions572
Table 91.TIMx Internal trigger connection588
Table 92.Output control bits for complementary OCx and OCxN channels with break feature (TIM15)598
Table 93.TIM15 register map and reset values606
Table 94.Output control bits for complementary OCx and OCxN channels with break feature (TIM16/17)619
Table 95.TIM16/TIM17 register map and reset values629
Table 96.IWDG register map and reset values640
Table 97.WWDG register map and reset values646
Table 98.RTC input/output pins649
Table 99.RTC internal input/output signals649
Table 100.Pin configuration650
Table 101.RTC_OUT mapping651
Table 102.Effect of low-power modes on RTC660
Table 103.RTC pins functionality over modes660
Table 104.Interrupt requests660
Table 105.RTC register map and reset values676
Table 106.I2C implementation679
Table 107.I2C input/output pins681
Table 108.I2C internal input/output signals681
Table 109.Comparison of analog and digital filters683
Table 110.I2C-bus and SMBus specification data setup and hold times685
Table 111.I2C configuration689
Table 112.I2C-bus and SMBus specification clock timings700
Table 113.Timing settings for fI2CCLK of 8 MHz710
Table 114.Timing settings for fI2CCLK of 16 MHz710
Table 115.Timing settings for fI2CCLK of 48 MHz711
Table 116.SMBus timeout specifications713
Table 117.SMBus with PEC configuration715
Table 118.TIMEOUTA[11:0] for maximum tTIMEOUT of 25 ms716
Table 119.TIMEOUTB[11:0] for maximum tLOW:SEXT and tLOW:MEXT of 8 ms716
Table 120.TIMEOUTA[11:0] for maximum tIDLE of 50 µs716
Table 121.Effect of low-power modes to I2C726
Table 122.I2C interrupt requests726
Table 123.I2C register map and reset values742
Table 124.Instance implementation on STM32C0 series745
Table 125.USART features746
Table 126.USART input/output pins749
Table 127.USART internal input/output signals749
Table 128.Noise detection from sampled data761
Table 129.Tolerance of the USART receiver when BRR [3:0] = 0000764
Table 130.Tolerance of the USART receiver when BRR[3:0] is different from 0000765
Table 131.USART frame formats770
Table 132.Effect of low-power modes on the USART793
Table 133.USART interrupt requests794
Table 134.USART register map and reset values828
Table 135.STM32C0 series SPI/I2S implementation831
Table 136.SPI interrupt requests856
Table 137.Audio-frequency precision using 48 MHz clock derived from HSE869
Table 138.I2S interrupt requests875
Table 139.SPI/I2S register map and reset values887
Table 140.CAN subsystem I/O signals892
Table 141.CAN subsystem I/O pins892
Table 142.DLC coding in FDCAN896
Table 143.Possible configurations for frame transmission910
Table 144.Rx FIFO element913
Table 145.Rx FIFO element description913
Table 146.Tx buffer and FIFO element915
Table 147.Tx buffer element description915
Table 148.Tx event FIFO element917
Table 149.Tx event FIFO element description917
Table 150.Standard message ID filter element918
Table 151.Standard message ID filter element field description919
Table 152.Extended message ID filter element919
Table 153.Extended message ID filter element field description . . . . .920
Table 154.FDCAN register map and reset values . . . . .950
Table 155.STM32C0 series USB implementation . . . . .954
Table 156.USB input/output pins . . . . .956
Table 157.Double-buffering buffer flag definition . . . . .968
Table 158.Bulk double-buffering memory buffers usage (Device mode) . . . . .968
Table 159.Bulk double-buffering memory buffers usage (Host mode) . . . . .970
Table 160.Isochronous memory buffers usage . . . . .971
Table 161.Isochronous memory buffers usage . . . . .972
Table 162.Resume event detection . . . . .974
Table 163.Resume event detection for host . . . . .975
Table 164.Reception status encoding . . . . .993
Table 165.Endpoint/channel type encoding . . . . .993
Table 166.Endpoint/channel kind meaning . . . . .993
Table 167.Transmission status encoding . . . . .993
Table 168.USB register map and reset values . . . . .994
Table 169.Definition of allocated buffer memory . . . . .997
Table 170.USBSRAM register map and reset values . . . . .1000
Table 171.SW debug port pins . . . . .1002
Table 172.Packet request (8-bits) . . . . .1004
Table 173.ACK response (3 bits) . . . . .1004
Table 174.DATA transfer (33 bits) . . . . .1004
Table 175.SW-DP registers . . . . .1005
Table 176.32-bit debug port registers addressed through the shifted value A[3:2] . . . . .1006
Table 177.Core debug registers . . . . .1007
Table 178.DEV_ID bitfield values . . . . .1009
Table 179.DBG register map and reset values . . . . .1014
Table 180.Document revision history . . . . .1019

List of figures

Figure 1.System architecture .....43
Figure 2.Memory map .....46
Figure 3.Changing read protection (RDP) level .....71
Figure 4.Example of disabling core debug access .....75
Figure 5.Power supply overview .....92
Figure 6.POR, PDR, and BOR thresholds .....94
Figure 7.Low-power mode transit diagram .....95
Figure 8.Simplified diagram of the reset circuit .....119
Figure 9.Clock tree .....123
Figure 10.HSE/ LSE clock sources .....124
Figure 11.Frequency measurement with TIM14 in capture mode .....130
Figure 12.Frequency measurement with TIM16 in capture mode .....130
Figure 13.Frequency measurement with TIM17 in capture mode .....131
Figure 14.CRS block diagram .....167
Figure 15.CRS counter behavior .....169
Figure 16.Basic structure of an I/O port bit .....179
Figure 17.Input floating/pull up/pull down configurations .....184
Figure 18.Output configuration .....185
Figure 19.Alternate function configuration- .....186
Figure 20.High impedance-analog configuration .....186
Figure 21.DMA block diagram .....224
Figure 22.DMAMUX block diagram .....247
Figure 23.Synchronization mode of the DMAMUX request line multiplexer channel .....250
Figure 24.Event generation of the DMA request line multiplexer channel .....250
Figure 25.EXTI block diagram .....263
Figure 26.Configurable event trigger logic CPU wake-up .....265
Figure 27.Direct event trigger logic CPU wake-up .....266
Figure 28.EXTI GPIO multiplexer .....266
Figure 29.CRC calculation unit block diagram .....281
Figure 30.ADC block diagram .....290
Figure 31.ADC calibration .....294
Figure 32.Calibration factor forcing .....294
Figure 33.Enabling/disabling the ADC .....295
Figure 34.ADC clock scheme .....296
Figure 35.ADC connectivity .....298
Figure 36.Analog-to-digital conversion time .....303
Figure 37.ADC conversion timings .....303
Figure 38.Stopping an ongoing conversion .....304
Figure 39.Single conversions of a sequence, software trigger .....307
Figure 40.Continuous conversion of a sequence, software trigger .....307
Figure 41.Single conversions of a sequence, hardware trigger .....308
Figure 42.Continuous conversions of a sequence, hardware trigger .....308
Figure 43.Data alignment and resolution (oversampling disabled: OVSE = 0) .....309
Figure 44.Example of overrun (OVR) .....310
Figure 45.Wait mode conversion (continuous mode, software trigger) .....313
Figure 46.Behavior with WAIT = 0, AUTOFF = 1 .....314
Figure 47.Behavior with WAIT = 1, AUTOFF = 1 .....314
Figure 48.Analog watchdog guarded area .....315
Figure 49.ADC_AWDx_OUT signal generation317
Figure 50.ADC_AWDx_OUT signal generation (AWDx flag not cleared by software)317
Figure 51.ADC_AWDx_OUT signal generation (on a single channel)318
Figure 52.Analog watchdog threshold update318
Figure 53.20-bit to 16-bit result truncation319
Figure 54.Numerical example with 5-bit shift and rounding319
Figure 55.Triggered oversampling mode (TOVS bit = 1)321
Figure 56.Temperature sensor and VREFINT channel block diagram322
Figure 57.Advanced-control timer block diagram348
Figure 58.Counter timing diagram with prescaler division change from 1 to 2350
Figure 59.Counter timing diagram with prescaler division change from 1 to 4350
Figure 60.Counter timing diagram, internal clock divided by 1352
Figure 61.Counter timing diagram, internal clock divided by 2352
Figure 62.Counter timing diagram, internal clock divided by 4353
Figure 63.Counter timing diagram, internal clock divided by N353
Figure 64.Counter timing diagram, update event when ARPE=0 (TIMx_ARR not preloaded)354
Figure 65.Counter timing diagram, update event when ARPE=1 (TIMx_ARR preloaded)354
Figure 66.Counter timing diagram, internal clock divided by 1356
Figure 67.Counter timing diagram, internal clock divided by 2356
Figure 68.Counter timing diagram, internal clock divided by 4357
Figure 69.Counter timing diagram, internal clock divided by N357
Figure 70.Counter timing diagram, update event when repetition counter is not used358
Figure 71.Counter timing diagram, internal clock divided by 1, TIMx_ARR = 0x6359
Figure 72.Counter timing diagram, internal clock divided by 2360
Figure 73.Counter timing diagram, internal clock divided by 4, TIMx_ARR=0x36360
Figure 74.Counter timing diagram, internal clock divided by N361
Figure 75.Counter timing diagram, update event with ARPE=1 (counter underflow)361
Figure 76.Counter timing diagram, Update event with ARPE=1 (counter overflow)362
Figure 77.Update rate examples depending on mode and TIMx_RCR register settings363
Figure 78.External trigger input block364
Figure 79.TIM1 ETR input circuitry364
Figure 80.Control circuit in normal mode, internal clock divided by 1365
Figure 81.TI2 external clock connection example366
Figure 82.Control circuit in external clock mode 1367
Figure 83.External trigger input block367
Figure 84.Control circuit in external clock mode 2368
Figure 85.Capture/compare channel (example: channel 1 input stage)369
Figure 86.Capture/compare channel 1 main circuit369
Figure 87.Output stage of capture/compare channel (channel 1, idem ch. 2 and 3)370
Figure 88.Output stage of capture/compare channel (channel 4)370
Figure 89.Output stage of capture/compare channel (channel 5, idem ch. 6)371
Figure 90.PWM input mode timing373
Figure 91.Output compare mode, toggle on OC1375
Figure 92.Edge-aligned PWM waveforms (ARR=8)376
Figure 93.Center-aligned PWM waveforms (ARR=8)377
Figure 94.Generation of 2 phase-shifted PWM signals with 50% duty cycle379
Figure 95.Combined PWM mode on channel 1 and 3380
Figure 96.3-phase combined PWM signals with multiple trigger pulses per period381
Figure 97.Complementary output with dead-time insertion382
Figure 98.Dead-time waveforms with delay greater than the negative pulse382
Figure 99.Dead-time waveforms with delay greater than the positive pulse383
Figure 100.Break and Break2 circuitry overview385
Figure 101. Various output behavior in response to a break event on BRK (OSSI = 1) .....387
Figure 102. PWM output state following BRK and BRK2 pins assertion (OSSI=1) .....388
Figure 103. PWM output state following BRK assertion (OSSI=0) .....389
Figure 104. Output redirection (BRK2 request not represented) .....390
Figure 105. Clearing TIMx OCxREF .....391
Figure 106. 6-step generation, COM example (OSSR=1) .....392
Figure 107. Example of one pulse mode. ....393
Figure 108. Retriggerable one pulse mode .....395
Figure 109. Example of counter operation in encoder interface mode. ....396
Figure 110. Example of encoder interface mode with TI1FP1 polarity inverted. ....397
Figure 111. Measuring time interval between edges on 3 signals .....398
Figure 112. Example of Hall sensor interface .....400
Figure 113. Control circuit in reset mode .....401
Figure 114. Control circuit in Gated mode .....402
Figure 115. Control circuit in trigger mode. ....403
Figure 116. Control circuit in external clock mode 2 + trigger mode .....404
Figure 117. General-purpose timer block diagram .....446
Figure 118. Counter timing diagram with prescaler division change from 1 to 2 .....448
Figure 119. Counter timing diagram with prescaler division change from 1 to 4 .....448
Figure 120. Counter timing diagram, internal clock divided by 1 .....449
Figure 121. Counter timing diagram, internal clock divided by 2 .....450
Figure 122. Counter timing diagram, internal clock divided by 4 .....450
Figure 123. Counter timing diagram, internal clock divided by N. ....451
Figure 124. Counter timing diagram, Update event when ARPE=0 (TIMx_ARR not preloaded). ....451
Figure 125. Counter timing diagram, Update event when ARPE=1 (TIMx_ARR preloaded). ....452
Figure 126. Counter timing diagram, internal clock divided by 1 .....453
Figure 127. Counter timing diagram, internal clock divided by 2 .....453
Figure 128. Counter timing diagram, internal clock divided by 4 .....454
Figure 129. Counter timing diagram, internal clock divided by N. ....454
Figure 130. Counter timing diagram, Update event. ....455
Figure 131. Counter timing diagram, internal clock divided by 1, TIMx_ARR=0x6 .....456
Figure 132. Counter timing diagram, internal clock divided by 2 .....457
Figure 133. Counter timing diagram, internal clock divided by 4, TIMx_ARR=0x36 .....457
Figure 134. Counter timing diagram, internal clock divided by N. ....458
Figure 135. Counter timing diagram, Update event with ARPE=1 (counter underflow). ....458
Figure 136. Counter timing diagram, Update event with ARPE=1 (counter overflow). ....459
Figure 137. Control circuit in normal mode, internal clock divided by 1. ....460
Figure 138. TI2 external clock connection example. ....460
Figure 139. Control circuit in external clock mode 1 .....461
Figure 140. External trigger input block .....462
Figure 141. Control circuit in external clock mode 2 .....463
Figure 142. Capture/Compare channel (example: channel 1 input stage) .....463
Figure 143. Capture/Compare channel 1 main circuit .....464
Figure 144. Output stage of Capture/Compare channel (channel 1). ....464
Figure 145. PWM input mode timing .....466
Figure 146. Output compare mode, toggle on OC1. ....468
Figure 147. Edge-aligned PWM waveforms (ARR=8) .....469
Figure 148. Center-aligned PWM waveforms (ARR=8). ....471
Figure 149. Generation of 2 phase-shifted PWM signals with 50% duty cycle .....472
Figure 150. Combined PWM mode on channels 1 and 3 .....473
Figure 151. Clearing TIMx OCxREF .....474
Figure 152. Example of one-pulse mode. ....475
Figure 153.Retriggerable one-pulse mode .....477
Figure 154.Example of counter operation in encoder interface mode .....478
Figure 155.Example of encoder interface mode with TI1FP1 polarity inverted .....479
Figure 156.Control circuit in reset mode .....480
Figure 157.Control circuit in gated mode .....481
Figure 158.Control circuit in trigger mode .....482
Figure 159.Control circuit in external clock mode 2 + trigger mode .....483
Figure 160.Master/Slave timer example .....484
Figure 161.Master/slave connection example with 1 channel only timers .....484
Figure 162.Gating TIMz with OC1REF of TIMy .....485
Figure 163.Gating TIMz with Enable of TIMy .....486
Figure 164.Triggering TIMz with update of TIMy .....487
Figure 165.Triggering TIMz with Enable of TIMy .....487
Figure 166.Triggering TIMy and TIMz with TIMy TI1 input .....488
Figure 167.General-purpose timer block diagram (TIM14) .....519
Figure 168.Counter timing diagram with prescaler division change from 1 to 2 .....521
Figure 169.Counter timing diagram with prescaler division change from 1 to 4 .....521
Figure 170.Counter timing diagram, internal clock divided by 1 .....522
Figure 171.Counter timing diagram, internal clock divided by 2 .....523
Figure 172.Counter timing diagram, internal clock divided by 4 .....523
Figure 173.Counter timing diagram, internal clock divided by N .....524
Figure 174.Counter timing diagram, update event when ARPE=0 (TIMx_ARR not
preloaded) .....
524
Figure 175.Counter timing diagram, update event when ARPE=1 (TIMx_ARR
preloaded) .....
525
Figure 176.Control circuit in normal mode, internal clock divided by 1 .....526
Figure 177.Capture/compare channel (example: channel 1 input stage) .....526
Figure 178.Capture/compare channel 1 main circuit .....527
Figure 179.Output stage of capture/compare channel (channel 1) .....527
Figure 180.Output compare mode, toggle on OC1 .....530
Figure 181.Edge-aligned PWM waveforms (ARR=8) .....531
Figure 182.TIM15 block diagram .....546
Figure 183.TIM16/TIM17 block diagram .....547
Figure 184.Counter timing diagram with prescaler division change from 1 to 2 .....549
Figure 185.Counter timing diagram with prescaler division change from 1 to 4 .....549
Figure 186.Counter timing diagram, internal clock divided by 1 .....551
Figure 187.Counter timing diagram, internal clock divided by 2 .....551
Figure 188.Counter timing diagram, internal clock divided by 4 .....552
Figure 189.Counter timing diagram, internal clock divided by N .....552
Figure 190.Counter timing diagram, update event when ARPE=0 (TIMx_ARR not
preloaded) .....
553
Figure 191.Counter timing diagram, update event when ARPE=1 (TIMx_ARR
preloaded) .....
553
Figure 192.Update rate examples depending on mode and TIMx_RCR register settings .....555
Figure 193.Control circuit in normal mode, internal clock divided by 1 .....556
Figure 194.TI2 external clock connection example .....556
Figure 195.Control circuit in external clock mode 1 .....557
Figure 196.Capture/compare channel (example: channel 1 input stage) .....558
Figure 197.Capture/compare channel 1 main circuit .....558
Figure 198.Output stage of capture/compare channel (channel 1) .....559
Figure 199.Output stage of capture/compare channel (channel 2 for TIM15) .....559
Figure 200.PWM input mode timing .....561
Figure 201. Output compare mode, toggle on OC1563
Figure 202. Edge-aligned PWM waveforms (ARR=8)564
Figure 203. Combined PWM mode on channel 1 and 2565
Figure 204. Complementary output with dead-time insertion566
Figure 205. Dead-time waveforms with delay greater than the negative pulse566
Figure 206. Dead-time waveforms with delay greater than the positive pulse567
Figure 207. Break circuitry overview569
Figure 208. Output behavior in response to a break571
Figure 209. Output redirection573
Figure 210. 6-step generation, COM example (OSSR=1)574
Figure 211. Example of one pulse mode575
Figure 212. Retriggerable one pulse mode577
Figure 213. Measuring time interval between edges on 2 signals578
Figure 214. Control circuit in reset mode579
Figure 215. Control circuit in gated mode580
Figure 216. Control circuit in trigger mode581
Figure 217. IRTIM internal hardware connections with TIM16 and TIM17631
Figure 218. Independent watchdog block diagram632
Figure 219. Watchdog block diagram642
Figure 220. Window watchdog timing diagram643
Figure 221. RTC block diagram648
Figure 222. Block diagram680
Figure 223. I2C-bus protocol682
Figure 224. Setup and hold timings684
Figure 225. I2C initialization flow686
Figure 226. Data reception687
Figure 227. Data transmission688
Figure 228. Target initialization flow691
Figure 229. Transfer sequence flow for I2C target transmitter, NOSTRETCH = 0693
Figure 230. Transfer sequence flow for I2C target transmitter, NOSTRETCH = 1694
Figure 231. Transfer bus diagrams for I2C target transmitter (mandatory events only)695
Figure 232. Transfer sequence flow for I2C target receiver, NOSTRETCH = 0696
Figure 233. Transfer sequence flow for I2C target receiver, NOSTRETCH = 1697
Figure 234. Transfer bus diagrams for I2C target receiver
(mandatory events only)
697
Figure 235. Controller clock generation699
Figure 236. Controller initialization flow701
Figure 237. 10-bit address read access with HEAD10R = 0701
Figure 238. 10-bit address read access with HEAD10R = 1702
Figure 239. Transfer sequence flow for I2C controller transmitter, N ≤ 255 bytes703
Figure 240. Transfer sequence flow for I2C controller transmitter, N > 255 bytes704
Figure 241. Transfer bus diagrams for I2C controller transmitter
(mandatory events only)
705
Figure 242. Transfer sequence flow for I2C controller receiver, N ≤ 255 bytes707
Figure 243. Transfer sequence flow for I2C controller receiver, N > 255 bytes708
Figure 244. Transfer bus diagrams for I2C controller receiver
(mandatory events only)
709
Figure 245. Timeout intervals for tLOW:SEXT, tLOW:MEXT714
Figure 246. Transfer sequence flow for SMBus target transmitter N bytes + PEC717
Figure 247. Transfer bus diagram for SMBus target transmitter (SBC = 1)718
Figure 248. Transfer sequence flow for SMBus target receiver N bytes + PEC719
Figure 249. Bus transfer diagrams for SMBus target receiver (SBC = 1)720
Figure 250. Bus transfer diagrams for SMBus controller transmitter . . . . .721
Figure 251. Bus transfer diagrams for SMBus controller receiver . . . . .723
Figure 252. USART block diagram . . . . .747
Figure 253. Word length programming . . . . .750
Figure 254. Configurable stop bits . . . . .752
Figure 255. TC/TXE behavior when transmitting . . . . .755
Figure 256. Start bit detection when oversampling by 16 or 8 . . . . .756
Figure 257. usart_ker_ck clock divider block diagram . . . . .759
Figure 258. Data sampling when oversampling by 16 . . . . .760
Figure 259. Data sampling when oversampling by 8 . . . . .761
Figure 260. Mute mode using Idle line detection . . . . .768
Figure 261. Mute mode using address mark detection . . . . .769
Figure 262. Break detection in LIN mode (11-bit break length - LBDL bit is set) . . . . .772
Figure 263. Break detection in LIN mode vs. Framing error detection . . . . .773
Figure 264. USART example of synchronous master transmission . . . . .774
Figure 265. USART data clock timing diagram in synchronous master mode
(M bits = 00) . . . . .
774
Figure 266. USART data clock timing diagram in synchronous master mode
(M bits = 01) . . . . .
775
Figure 267. USART data clock timing diagram in synchronous slave mode
(M bits = 00) . . . . .
776
Figure 268. ISO 7816-3 asynchronous protocol . . . . .778
Figure 269. Parity error detection using the 1.5 stop bits . . . . .780
Figure 270. IrDA SIR ENDEC block diagram . . . . .784
Figure 271. IrDA data modulation (3/16) - normal mode . . . . .784
Figure 272. Transmission using DMA . . . . .786
Figure 273. Reception using DMA . . . . .787
Figure 274. Hardware flow control between 2 USARTs . . . . .787
Figure 275. RS232 RTS flow control . . . . .788
Figure 276. RS232 CTS flow control . . . . .789
Figure 277. Wake-up event verified (wake-up event = address match, FIFO disabled) . . . . .792
Figure 278. Wake-up event not verified (wake-up event = address match,
FIFO disabled) . . . . .
792
Figure 279. SPI block diagram . . . . .832
Figure 280. Full-duplex single master/ single slave application . . . . .833
Figure 281. Half-duplex single master/ single slave application . . . . .834
Figure 282. Simplex single master/single slave application (master in transmit-only/
slave in receive-only mode) . . . . .
835
Figure 283. Master and three independent slaves . . . . .836
Figure 284. Multimaster application . . . . .837
Figure 285. Hardware/software slave select management . . . . .838
Figure 286. Data clock timing diagram . . . . .839
Figure 287. Data alignment when data length is not equal to 8-bit or 16-bit . . . . .840
Figure 288. Packing data in FIFO for transmission and reception . . . . .844
Figure 289. Master full-duplex communication . . . . .847
Figure 290. Slave full-duplex communication . . . . .848
Figure 291. Master full-duplex communication with CRC . . . . .849
Figure 292. Master full-duplex communication in packed mode . . . . .850
Figure 293. NSSP pulse generation in Motorola SPI master mode . . . . .853
Figure 294. TI mode transfer . . . . .854
Figure 295. I2S block diagram . . . . .857
Figure 296. I2S Philips protocol waveforms (16/32-bit full accuracy) . . . . .859
Figure 297. I2S Philips standard waveforms (24-bit frame) . . . . .859
Figure 298. Transmitting 0x8EAA33 . . . . .860
Figure 299. Receiving 0x8EAA33 . . . . .860
Figure 300. I2S Philips standard (16-bit extended to 32-bit packet frame) . . . . .860
Figure 301. Example of 16-bit data frame extended to 32-bit channel frame . . . . .860
Figure 302. MSB Justified 16-bit or 32-bit full-accuracy length . . . . .861
Figure 303. MSB justified 24-bit frame length . . . . .861
Figure 304. MSB justified 16-bit extended to 32-bit packet frame . . . . .862
Figure 305. LSB justified 16-bit or 32-bit full-accuracy . . . . .862
Figure 306. LSB justified 24-bit frame length . . . . .862
Figure 307. Operations required to transmit 0x3478AE . . . . .863
Figure 308. Operations required to receive 0x3478AE . . . . .863
Figure 309. LSB justified 16-bit extended to 32-bit packet frame . . . . .863
Figure 310. Example of 16-bit data frame extended to 32-bit channel frame . . . . .864
Figure 311. PCM standard waveforms (16-bit) . . . . .864
Figure 312. PCM standard waveforms (16-bit extended to 32-bit packet frame) . . . . .865
Figure 313. Start sequence in master mode . . . . .866
Figure 314. Audio sampling frequency definition . . . . .867
Figure 315. I2S clock generator architecture . . . . .867
Figure 316. CAN subsystem . . . . .889
Figure 317. FDCAN block diagram . . . . .891
Figure 318. Bit timing . . . . .893
Figure 319. Transceiver delay measurement . . . . .898
Figure 320. Pin control in bus monitoring mode . . . . .899
Figure 321. Pin control in loop-back mode . . . . .902
Figure 322. CAN error state diagram . . . . .903
Figure 323. Message RAM configuration . . . . .904
Figure 324. Standard message ID filter path . . . . .907
Figure 325. Extended message ID filter path . . . . .908
Figure 326. USB peripheral block diagram . . . . .955
Figure 327. Packet buffer areas with examples of buffer description table locations . . . . .962
Figure 328. Block diagram of STM32C0 series MCU and Cortex®-M0+-level debug support . . . . .1001

Chapters