Sign In
Upload
Manuals
Brands
ST Manuals
Microcontrollers
STM32F413VG
ST STM32F413VG Cortex-M4 Microcontroller Manuals
Manuals and User Guides for ST STM32F413VG Cortex-M4 Microcontroller. We have
1
ST STM32F413VG Cortex-M4 Microcontroller manual available for free PDF download: Reference Manual
ST STM32F413VG Reference Manual (1324 pages)
advanced Arm-based 32-bit MCUs
Brand:
ST
| Category:
Microcontrollers
| Size: 15 MB
Table of Contents
Table of Contents
2
SYSCFG External Interrupt Configuration Register
2
SYSCFG External Interrupt Configuration Register
4
Documentation Conventions
52
General Information
52
List of Abbreviations for Registers
52
Glossary
53
Availability of Peripherals
53
System and Memory Overview
54
System Architecture
54
I-Bus
55
D-Bus
55
S-Bus
55
DMA Memory Bus
55
Figure 1. System Architecture
55
DMA Peripheral Bus
56
Busmatrix
56
AHB/APB Bridges (APB)
56
Memory Organization
57
Introduction
57
Memory Map and Register Boundary Addresses
58
Figure 2. Memory Map
58
Table 1. Register Boundary Addresses
59
Embedded SRAM
62
Flash Memory Overview
62
Bit Banding
62
Boot Configuration
63
Table 2. Boot Modes
63
Table 3. Embedded Bootloader Interfaces
64
Table 4. Memory Mapping Vs. Boot Mode/Physical Remap in STM32F413/423
65
Embedded Flash Memory Interface
66
Introduction
66
Main Features
66
Figure 3. Flash Memory Interface Connection Inside System Architecture
66
Embedded Flash Memory
67
Table 5. Flash Module Organization
67
Read Interface
68
Relation between CPU Clock Frequency and Flash Memory Read Time
68
Table 6. Number of Wait States According to CPU Clock (HCLK) Frequency
68
Adaptive Real-Time Memory Accelerator (ART Accelerator™)
69
Figure 4. Sequential 32-Bit Instruction Execution
70
Erase and Program Operations
71
Unlocking the Flash Control Register
71
Program/Erase Parallelism
72
Erase
72
Table 7. Program/Erase Parallelism
72
Programming
73
Interrupts
74
Option Bytes
74
Description of User Option Bytes
74
Table 8. Flash Interrupt Request
74
Table 9. Option Byte Organization
74
Table 10. Description of the Option Bytes
75
Programming User Option Bytes
76
Read Protection (RDP)
76
Write Protections
78
Table 11. Access Versus Read Protection Level
78
Figure 5. RDP Levels
78
Proprietary Code Readout Protection (PCROP)
79
Figure 6. PCROP Levels
80
One-Time Programmable Bytes
81
Table 12. OTP Area Organization
81
Flash Interface Registers
82
Flash Access Control Register (FLASH_ACR)
82
Flash Key Register (FLASH_KEYR)
83
Flash Option Key Register (FLASH_OPTKEYR)
83
Flash Status Register (FLASH_SR)
84
Flash Control Register (FLASH_CR)
85
Flash Option Control Register (FLASH_OPTCR)
86
Flash Interface Register Map
89
Table 13. Flash Register Map and Reset Values
89
CRC Calculation Unit
90
CRC Introduction
90
CRC Main Features
90
CRC Functional Description
90
Figure 7. CRC Calculation Unit Block Diagram
90
CRC Registers
91
Data Register (CRC_DR)
91
Independent Data Register (CRC_IDR)
92
Control Register (CRC_CR)
92
CRC Register Map
93
Table 14. CRC Calculation Unit Register Map and Reset Values
93
Power Controller (PWR)
94
Power Supplies
94
Independent A/D Converter Supply and Reference Voltage
95
Battery Backup Domain
95
Figure 8. Power Supply Overview
95
Voltage Regulator
97
Power Supply Supervisor
98
Power-On Reset (Por)/Power-Down Reset (PDR)
98
Brownout Reset (BOR)
98
Figure 9. Power-On Reset/Power-Down Reset Waveform
98
Programmable Voltage Detector (PVD)
99
Figure 10. BOR Thresholds
99
Low-Power Modes
100
Figure 11. PVD Thresholds
100
Slowing down System Clocks
102
Peripheral Clock Gating
102
Table 15. Low-Power Mode Summary
102
Sleep Mode
103
Table 16. Sleep-Now Entry and Exit
103
Table 17. Sleep-On-Exit Entry and Exit
103
Batch Acquisition Mode
104
Table 18. BAM-Now Entry and Exit
104
Stop Mode
105
Table 19. BAM-On-Exit Entry and Exit
105
Table 20. Stop Operating Modes
106
Table 21. Stop Mode Entry and Exit
107
Standby Mode
108
Programming the RTC Alternate Functions to Wake up the Device from the Stop and Standby Modes
109
Table 22. Standby Mode Entry and Exit
109
Power Control Registers
112
PWR Power Control Register (PWR_CR)
112
PWR Power Control/Status Register (PWR_CSR)
114
PWR Register Map
116
Table 23. PWR - Register Map and Reset Values
116
Reset and Clock Control (RCC) for STM32F413/423
117
Reset
117
System Reset
117
Power Reset
118
Figure 12. Simplified Diagram of the Reset Circuit
118
Backup Domain Reset
119
Clocks
119
Figure 13. Clock Tree
120
HSE Clock
121
HSI Clock
122
Figure 14. HSE/ LSE Clock Sources
122
PLL Configuration
123
LSE Clock
123
LSI Clock
124
System Clock (SYSCLK) Selection
124
Clock Security System (CSS)
124
RTC/AWU Clock
125
Watchdog Clock
125
Clock-Out Capability
126
Internal/External Clock Measurement Using TIM5/TIM11
126
Figure 15. Frequency Measurement with TIM5 in Input Capture Mode
127
Figure 16. Frequency Measurement with TIM11 in Input Capture Mode
128
RCC Registers
129
RCC Clock Control Register (RCC_CR)
129
RCC PLL Configuration Register (RCC_PLLCFGR)
131
RCC Clock Configuration Register (RCC_CFGR)
133
RCC Clock Interrupt Register (RCC_CIR)
136
RCC AHB1 Peripheral Reset Register (RCC_AHB1RSTR)
138
RCC AHB2 Peripheral Reset Register (RCC_AHB2RSTR)
140
For Stm32F413Xx
140
RCC AHB2 Peripheral Reset Register (RCC_AHB2RSTR)
141
For Stm32F423Xx
141
RCC AHB3 Peripheral Reset Register (RCC_AHB3RSTR)
142
RCC APB1 Peripheral Reset Register for (RCC_APB1RSTR)
142
RCC APB2 Peripheral Reset Register (RCC_APB2RSTR)
146
RCC AHB1 Peripheral Clock Enable Register (RCC_AHB1ENR)
149
RCC AHB2 Peripheral Clock Enable Register (RCC_AHB2ENR)
151
For Stm32F413Xx
151
RCC AHB2 Peripheral Clock Enable Register (RCC_AHB2ENR)
152
For Stm32F423Xx
152
RCC AHB3 Peripheral Clock Enable Register (RCC_AHB3ENR)
153
RCC APB1 Peripheral Clock Enable Register (RCC_APB1ENR)
153
RCC APB2 Peripheral Clock Enable Register (RCC_APB2ENR)
157
RCC AHB1 Peripheral Clock Enable in Low Power Mode Register (RCC_AHB1LPENR)
160
RCC AHB2 Peripheral Clock Enable in Low Power Mode Register (RCC_AHB2LPENR) for Stm32F413Xx
162
RCC AHB2 Peripheral Clock Enable in Low Power Mode Register (RCC_AHB2LPENR) for Stm32F423Xx
163
RCC AHB3 Peripheral Clock Enable in Low Power Mode Register (RCC_AHB3LPENR)
163
RCC APB1 Peripheral Clock Enable in Low Power Mode Register (RCC_APB1LPENR)
165
RCC APB2 Peripheral Clock Enabled in Low Power Mode Register (RCC_APB2LPENR)
168
RCC Backup Domain Control Register (RCC_BDCR)
171
RCC Clock Control & Status Register (RCC_CSR)
172
RCC Spread Spectrum Clock Generation Register (RCC_SSCGR)
174
RCC PLLI2S Configuration Register (RCC_PLLI2SCFGR)
175
RCC Dedicated Clocks Configuration Register (RCC_DCKCFGR)
177
RCC Clocks Gated Enable Register (CKGATENR)
179
RCC Dedicated Clocks Configuration Register (RCC_DCKCFGR2)
180
RCC Register Map
181
Table 24. RCC Register Map and Reset Values for STM32F413/423
181
General-Purpose I/Os (GPIO)
184
GPIO Introduction
184
GPIO Main Features
184
GPIO Functional Description
184
Table 25. Port Bit Configuration Table
185
Figure 17. Basic Structure of a Five-Volt Tolerant I/O Port Bit
185
General-Purpose I/O (GPIO)
186
I/O Pin Multiplexer and Mapping
187
Table 26. Flexible SWJ-DP Pin Assignment
188
Figure 18. Selecting an Alternate Function on STM32F413/423
189
I/O Port Control Registers
190
I/O Port Data Registers
190
I/O Data Bitwise Handling
190
GPIO Locking Mechanism
190
I/O Alternate Function Input/Output
191
External Interrupt/Wakeup Lines
191
Input Configuration
191
Output Configuration
192
Figure 19. Input Floating/Pull Up/Pull down Configurations
192
Alternate Function Configuration
193
Figure 20. Output Configuration
193
Figure 21. Alternate Function Configuration
193
Analog Configuration
194
Using the OSC32_IN/OSC32_OUT Pins as GPIO PC14/PC15
194
Port Pins
194
Using the OSC_IN/OSC_OUT Pins as GPIO PH0/PH1 Port Pins
194
Figure 22. High Impedance-Analog Configuration
194
Selection of RTC Additional Functions
195
Table 27. RTC Additional Functions
195
GPIO Registers
196
GPIO Port Mode Register (Gpiox_Moder) (X = a
196
GPIO Port Output Type Register (Gpiox_Otyper)
196
(X = a
196
GPIO Port Output Speed Register (Gpiox_Ospeedr)
197
(X = a
197
GPIO Port Pull-Up/Pull-Down Register (Gpiox_Pupdr)
197
GPIO Port Input Data Register (Gpiox_Idr) (X = a
198
GPIO Port Output Data Register (Gpiox_Odr) (X = a
198
GPIO Port Bit Set/Reset Register (Gpiox_Bsrr) (X = a
198
GPIO Port Configuration Lock Register (Gpiox_Lckr)
199
(X = a
199
GPIO Alternate Function Low Register (Gpiox_Afrl) (X = a
200
(X = a
201
GPIO Register Map
201
Table 28. GPIO Register Map and Reset Values
201
System Configuration Controller (SYSCFG)
204
I/O Compensation Cell
204
SYSCFG Registers
204
SYSCFG Memory Remap Register (SYSCFG_MEMRMP)
204
SYSCFG Peripheral Mode Configuration Register (SYSCFG_PMC)
205
SYSCFG External Interrupt Configuration Register 1
206
(Syscfg_Exticr1)
206
(Syscfg_Exticr2)
206
SYSCFG External Interrupt Configuration Register 3
207
(Syscfg_Exticr3)
207
(Syscfg_Exticr4)
208
SYSCFG Configuration Register 2 (SYSCFG_CFGR2)
208
Compensation Cell Control Register (SYSCFG_CMPCR)
209
SYSCFG Configuration Register (SYSCFG_CFGR)
210
DFSDM Multi-Channel Delay Control Register (SYSCFG_MCHDLYCR)
210
SYSCFG Register Map
213
Table 29. SYSCFG Register Map and Reset Values
213
Direct Memory Access Controller (DMA)
214
DMA Introduction
214
DMA Main Features
214
DMA Functional Description
216
DMA Block Diagram
216
DMA Overview
216
Figure 23. DMA Block Diagram
216
DMA Transactions
217
Channel Selection
217
Figure 24. Channel Selection
217
Table 30. DMA1 Request Mapping
218
Table 31. DMA2 Request Mapping
218
Arbiter
219
DMA Streams
219
Source, Destination and Transfer Modes
219
Table 32. Source and Destination Address
219
Figure 25. Peripheral-To-Memory Mode
220
Figure 26. Memory-To-Peripheral Mode
221
Pointer Incrementation
222
Figure 27. Memory-To-Memory Mode
222
Circular Mode
223
Double-Buffer Mode
223
Programmable Data Width, Packing/Unpacking, Endianness
224
Table 33. Source and Destination Address Registers in Double-Buffer Mode (DBM = 1)
224
Table 34. Packing/Unpacking and Endian Behavior (Bit PINC = MINC = 1)
225
Table 35. Restriction on NDT Versus PSIZE and MSIZE
225
Single and Burst Transfers
226
Fifo
226
Figure 28. FIFO Structure
226
Table 36. FIFO Threshold Configurations
227
DMA Transfer Completion
229
DMA Transfer Suspension
230
Flow Controller
230
Summary of the Possible DMA Configurations
231
Table 37. Possible DMA Configurations
231
Stream Configuration Procedure
232
Error Management
233
DMA Interrupts
234
Table 38. DMA Interrupt Requests
234
DMA Registers
235
DMA Low Interrupt Status Register (DMA_LISR)
235
DMA High Interrupt Status Register (DMA_HISR)
236
DMA Low Interrupt Flag Clear Register (DMA_LIFCR)
237
DMA High Interrupt Flag Clear Register (DMA_HIFCR)
237
DMA Stream X Configuration Register (Dma_Sxcr)
238
DMA Stream X Number of Data Register (Dma_Sxndtr)
241
DMA Stream X Peripheral Address Register (Dma_Sxpar)
242
DMA Stream X Memory 0 Address Register (Dma_Sxm0Ar)
242
DMA Stream X Memory 1 Address Register (Dma_Sxm1Ar)
242
DMA Stream X FIFO Control Register (Dma_Sxfcr)
243
DMA Register Map
245
Table 39. DMA Register Map and Reset Values
245
Interrupts and Events
249
Nested Vectored Interrupt Controller (NVIC)
249
NVIC Features
249
Systick Calibration Value Register
249
Interrupt and Exception Vectors
249
External Interrupt/Event Controller (EXTI)
249
Table 40. Vector Table for STM32F413/423
250
EXTI Main Features
254
EXTI Block Diagram
254
Wakeup Event Management
254
Figure 29. External Interrupt/Event Controller Block Diagram
254
Functional Description
256
External Interrupt/Event Line Mapping
257
Figure 30. External Interrupt/Event GPIO Mapping
257
EXTI Registers
258
Interrupt Mask Register (EXTI_IMR)
258
Event Mask Register (EXTI_EMR)
258
Rising Trigger Selection Register (EXTI_RTSR)
259
Falling Trigger Selection Register (EXTI_FTSR)
260
Software Interrupt Event Register (EXTI_SWIER)
261
Pending Register (EXTI_PR)
262
EXTI Register Map
263
Table 41. External Interrupt/Event Controller Register Map and Reset Values
263
Flexible Static Memory Controller (FSMC)
264
FSMC Main Features
264
FMC Block Diagram
265
Figure 31. FSMC Block Diagram
265
AHB Interface
266
Supported Memories and Transactions
266
External Device Address Mapping
267
NOR/PSRAM Address Mapping
267
Table 42. NOR/PSRAM Bank Selection
267
Figure 32. FSMC Memory Banks
267
NOR Flash/Psram Controller
268
Table 43. NOR/PSRAM External Memory Address
268
External Memory Interface Signals
269
Table 44. Programmable NOR/PSRAM Access Parameters
269
Table 45. Non-Multiplexed I/O nor Flash Memory
270
Table 46. 16-Bit Multiplexed I/O nor Flash Memory
270
Table 47. Non-Multiplexed I/Os PSRAM/SRAM
270
Supported Memories and Transactions
271
Table 48. 16-Bit Multiplexed I/O PSRAM
271
Table 49. nor Flash/Psram: Example of Supported Memories and Transactions
272
General Timing Rules
273
NOR Flash/Psram Controller Asynchronous Transactions
273
Figure 33. Mode1 Read Access Waveforms
274
Figure 34. Mode1 Write Access Waveforms
274
Table 50. Fsmc_Bcrx Bit Fields
275
Table 51. Fsmc_Btrx Bit Fields
275
Figure 35. Modea Read Access Waveforms
276
Figure 36. Modea Write Access Waveforms
276
Table 52. Fsmc_Bcrx Bit Fields
277
Table 53. Fsmc_Btrx Bit Fields
277
Table 54. Fsmc_Bwtrx Bit Fields
278
Figure 37. Mode2 and Mode B Read Access Waveforms
278
Figure 38. Mode2 Write Access Waveforms
279
Figure 39. Modeb Write Access Waveforms
279
Table 55. Fsmc_Bcrx Bit Fields
280
Table 56. Fsmc_Btrx Bit Fields
280
Table 57. Fsmc_Bwtrx Bit Fields
281
Figure 40. Modec Read Access Waveforms
281
Table 58. Fsmc_Bcrx Bit Fields
282
Figure 41. Modec Write Access Waveforms
282
Table 59. Fsmc_Btrx Bit Fields
283
Table 60. Fsmc_Bwtrx Bit Fields
283
Figure 42. Moded Read Access Waveforms
284
Figure 43. Moded Write Access Waveforms
284
Table 61. Fsmc_Bcrx Bit Fields
285
Table 62. Fsmc_Btrx Bit Fields
285
Table 63. Fsmc_Bwtrx Bit Fields
286
Figure 44. Muxed Read Access Waveforms
286
Table 64. Fsmc_Bcrx Bit Fields
287
Figure 45. Muxed Write Access Waveforms
287
Table 65. Fsmc_Btrx Bit Fields
288
Figure 46. Asynchronous Wait During a Read Access Waveforms
289
Synchronous Transactions
290
Figure 47. Asynchronous Wait During a Write Access Waveforms
290
Figure 48. Wait Configuration Waveforms
292
Table 66. Fsmc_Bcrx Bit Fields
293
Figure 49. Synchronous Multiplexed Read Mode Waveforms - NOR, PSRAM (CRAM)
293
Table 67. Fsmc_Btrx Bit Fields
294
Table 68. Fsmc_Bcrx Bit Fields
295
Figure 50. Synchronous Multiplexed Write Mode Waveforms - PSRAM (CRAM)
295
Table 69. Fsmc_Btrx Bit Fields
296
NOR/PSRAM Controller Registers
297
FSMC Register Map
305
Table 70. FSMC Register Map
305
Quad-SPI Interface (QUADSPI)
307
Introduction
307
QUADSPI Main Features
307
QUADSPI Functional Description
307
QUADSPI Block Diagram
307
Figure 51. QUADSPI Block Diagram When Dual-Flash Mode Is Disabled
307
QUADSPI Pins
308
Table 71. QUADSPI Pins
308
Figure 52. QUADSPI Block Diagram When Dual-Flash Mode Is Enabled
308
QUADSPI Command Sequence
309
Figure 53. an Example of a Read Command in Quad Mode
309
QUADSPI Signal Interface Protocol Modes
311
Figure 54. an Example of a DDR Command in Quad Mode
312
QUADSPI Indirect Mode
313
QUADSPI Status Flag Polling Mode
315
QUADSPI Memory-Mapped Mode
315
QUADSPI Flash Memory Configuration
316
QUADSPI Delayed Data Sampling
316
QUADSPI Configuration
316
QUADSPI Usage
317
Sending the Instruction Only Once
319
QUADSPI Error Management
319
QUADSPI Busy Bit and Abort Functionality
320
Ncs Behavior
320
Figure 55. Ncs When CKMODE = 0 (T = CLK Period)
320
Figure 56. Ncs When CKMODE = 1 in SDR Mode (T = CLK Period)
320
Figure 57. Ncs When CKMODE = 1 in DDR Mode (T = CLK Period)
321
Figure 58. Ncs When CKMODE = 1 with an Abort (T = CLK Period)
321
QUADSPI Interrupts
322
Table 72. QUADSPI Interrupt Requests
322
QUADSPI Registers
323
QUADSPI Control Register (QUADSPI_CR)
323
QUADSPI Device Configuration Register (QUADSPI_DCR)
326
QUADSPI Status Register (QUADSPI_SR)
327
QUADSPI Flag Clear Register (QUADSPI_FCR)
328
QUADSPI Data Length Register (QUADSPI_DLR)
328
QUADSPI Communication Configuration Register (QUADSPI_CCR)
329
QUADSPI Address Register (QUADSPI_AR)
331
QUADSPI Alternate Bytes Registers (QUADSPI_ABR)
332
QUADSPI Data Register (QUADSPI_DR)
332
QUADSPI Polling Status Mask Register (QUADSPI
333
QUADSPI Polling Status Match Register (QUADSPI
333
QUADSPI Polling Interval Register (QUADSPI
334
QUADSPI Low-Power Timeout Register (QUADSPI_LPTR)
334
QUADSPI Register Map
335
Table 73. QUADSPI Register Map and Reset Values
335
Analog-To-Digital Converter (ADC)
336
ADC Introduction
336
ADC Main Features
336
ADC Functional Description
336
Figure 59. Single ADC Block Diagram
337
ADC On-Off Control
338
ADC Clock
338
Channel Selection
338
Table 74. ADC Pins
338
Single Conversion Mode
339
Continuous Conversion Mode
339
Timing Diagram
340
Analog Watchdog
340
Figure 60. Timing Diagram
340
Figure 61. Analog Watchdog's Guarded Area
340
Scan Mode
341
Injected Channel Management
341
Table 75. Analog Watchdog Channel Selection
341
Discontinuous Mode
342
Figure 62. Injected Conversion Latency
342
Data Alignment
343
Channel-Wise Programmable Sampling Time
344
Figure 63. Right Alignment of 12-Bit Data
344
Figure 64. Left Alignment of 12-Bit Data
344
Figure 65. Left Alignment of 6-Bit Data
344
Conversion on External Trigger and Trigger Polarity
345
Table 76. Configuring the Trigger Polarity
345
Table 77. External Trigger for Regular Channels
345
Fast Conversion Mode
346
Table 78. External Trigger for Injected Channels
346
Data Management
347
Using the DMA
347
Managing a Sequence of Conversions Without Using the DMA
347
Conversions Without DMA and Without Overrun Detection
348
Temperature Sensor
348
Figure 66. Temperature Sensor and VREFINT Channel Block Diagram
348
Battery Charge Monitoring
349
ADC Interrupts
350
Table 79. ADC Interrupts
350
ADC Registers
351
ADC Status Register (ADC_SR)
351
ADC Control Register 1 (ADC_CR1)
352
ADC Control Register 2 (ADC_CR2)
354
ADC Sample Time Register 1 (ADC_SMPR1)
356
ADC Sample Time Register 2 (ADC_SMPR2)
357
ADC Injected Channel Data Offset Register X (Adc_Jofrx) (X=1
357
ADC Watchdog Higher Threshold Register (ADC_HTR)
357
ADC Watchdog Lower Threshold Register (ADC_LTR)
358
ADC Regular Sequence Register 1 (ADC_SQR1)
358
ADC Regular Sequence Register 2 (ADC_SQR2)
359
ADC Regular Sequence Register 3 (ADC_SQR3)
360
ADC Injected Sequence Register (ADC_JSQR)
361
ADC Injected Data Register X (Adc_Jdrx) (X= 1
361
ADC Regular Data Register (ADC_DR)
362
ADC Common Status Register (ADC_CSR)
362
ADC Common Control Register (ADC_CCR)
363
13.12.17 ADC Register Map
364
Table 80. ADC Global Register Map
364
Table 81. ADC Register Map and Reset Values
364
Table 82. ADC Register Map and Reset Values (Common ADC Registers)
365
Digital-To-Analog Converter (DAC)
366
DAC Introduction
366
DAC Main Features
366
Table 83. DAC Pins
367
Figure 67. DAC Channel Block Diagram
367
DAC Functional Description
368
DAC Channel Enable
368
DAC Output Buffer Enable
368
DAC Data Format
368
DAC Conversion
369
Figure 68. Data Registers in Single DAC Channel Mode
369
Figure 69. Data Registers in Dual DAC Channel Mode
369
DAC Output Voltage
370
DAC Trigger Selection
370
Table 84. External Triggers
370
Figure 70. Timing Diagram for Conversion with Trigger Disabled TEN = 0
370
DMA Request
371
Noise Generation
371
Triangle-Wave Generation
372
Figure 71. DAC LFSR Register Calculation Algorithm
372
Figure 72. DAC Conversion (SW Trigger Enabled) with LFSR Wave Generation
372
Dual DAC Channel Conversion
373
Figure 73. DAC Triangle Wave Generation
373
Figure 74. DAC Conversion (SW Trigger Enabled) with Triangle Wave Generation
373
Independent Trigger Without Wave Generation
374
Independent Trigger with Single LFSR Generation
374
Independent Trigger with Different LFSR Generation
374
Independent Trigger with Single Triangle Generation
375
Independent Trigger with Different Triangle Generation
375
Simultaneous Software Start
375
Load the Dual DAC Channel Data into the Desired DHR Register
375
DAC_DHR12LD or DAC_DHR8RD)
375
Simultaneous Trigger Without Wave Generation
376
Simultaneous Trigger with Single LFSR Generation
376
Simultaneous Trigger with Different LFSR Generation
376
Simultaneous Trigger with Single Triangle Generation
377
Simultaneous Trigger with Different Triangle Generation
377
To Configure the DAC in this Conversion Mode, the Following Sequence Is Required: Set the Two DAC Channel Trigger Enable Bits TEN1 and TEN2
377
Load the Dual DAC Channel Data into the Desired DHR Register
377
DAC_DHR12LD or DAC_DHR8RD)
377
MAMP2[3:0], Is Added to the DHR2 Register and the Sum Is Transferred into DAC_DOR2
377
DAC Registers
378
DAC Control Register (DAC_CR)
378
DAC Software Trigger Register (DAC_SWTRIGR)
381
DAC Channel1 12-Bit Right-Aligned Data Holding Register (DAC_DHR12R1)
381
DAC Channel1 12-Bit Left Aligned Data Holding Register
382
(Dac_Dhr12L1)
382
DAC Channel1 8-Bit Right Aligned Data Holding Register
382
DAC Channel2 12-Bit Right Aligned Data Holding Register
383
DAC Channel2 12-Bit Left Aligned Data Holding Register
383
(Dac_Dhr12L2)
383
DAC Channel2 8-Bit Right-Aligned Data Holding Register
383
Dual DAC 12-Bit Right-Aligned Data Holding Register (DAC_DHR12RD)
384
DUAL DAC 12-Bit Left Aligned Data Holding Register
384
(Dac_Dhr12Ld)
384
DUAL DAC 8-Bit Right Aligned Data Holding Register
385
(Dac_Dhr8Rd)
385
DAC Channel1 Data Output Register (DAC_DOR1)
385
DAC Channel2 Data Output Register (DAC_DOR2)
385
DAC Status Register (DAC_SR)
386
DAC Register Map
386
Table 85. DAC Register Map
386
Digital Filter for Sigma Delta Modulators (DFSDM)
388
Introduction
388
DFSDM Main Features
389
DFSDM Implementation
390
Table 86. Dfsdmx Implementation
390
DFSDM Functional Description
391
DFSDM Block Diagram
391
Figure 75. Single DFSDM Block Diagram
391
DFSDM Pins and Internal Signals
392
Table 87. DFSDM External Pins
392
Table 88. DFSDM Internal Signals
392
Table 89. DFSDM1 Triggers Connection
392
DFSDM Reset and Clocks
393
Table 90. DFSDM2 Triggers Connection
393
Table 91. DFSDM Break Connection
393
Serial Channel Transceivers
394
Figure 76. Input Channel Pins Redirection
395
Figure 77. Channel Transceiver Timing Diagrams
397
Figure 78. Clock Absence Timing Diagram for SPI
398
Figure 79. Clock Absence Timing Diagram for Manchester Coding
399
Figure 80. First Conversion for Manchester Coding (Manchester Synchronization)
401
Figure 81. Multi-Channel Delay Block for Pulse Skipping
404
Figure 82. Pulses Skipper Operation
405
Table 92. Demultiplexers (DM[6:1]) Operation
406
Table 93. Use-Cases Examples for Beamforming Applications
406
Configuring the Input Serial Interface
407
Parallel Data Inputs
407
Channel Selection
409
Figure 83. Dfsdm_Chydatinr Registers Operation Modes and Assignment
409
Digital Filter Configuration
410
Figure 84. Example: Sinc3 Filter Response
410
Integrator Unit
411
Analog Watchdog
411
Table 94. Filter Maximum Output Resolution (Peak Data Values from Filter Output)
411
Table 95. Integrator Maximum Output Resolution
411
Short-Circuit Detector
414
Extreme Detector
414
Data Unit Block
415
Signed Data Format
416
Launching Conversions
416
Continuous and Fast Continuous Modes
417
Request Precedence
417
Power Optimization in Run Mode
418
DFSDM Interrupts
418
Table 96. DFSDM Interrupt Requests
419
DFSDM DMA Transfer
420
DFSDM Channel y Registers (Y=0
420
DFSDM Channel y Configuration Register (Dfsdm_Chycfgr1)
420
DFSDM Channel y Configuration Register (Dfsdm_Chycfgr2)
423
DFSDM Channel y Analog Watchdog and Short-Circuit Detector Register (Dfsdm_Chyawscdr)
423
DFSDM Channel y Watchdog Filter Data Register (Dfsdm_Chywdatr)
424
DFSDM Channel y Data Input Register (Dfsdm_Chydatinr)
425
DFSDM Filter X Module Registers (X=0
426
DFSDM Filter X Control Register 1 (Dfsdm_Fltxcr1)
426
DFSDM Filter X Control Register 2 (Dfsdm_Fltxcr2)
429
DFSDM Filter X Interrupt and Status Register (Dfsdm_Fltxisr)
430
DFSDM Filter X Interrupt Flag Clear Register (Dfsdm_Fltxicr)
432
DFSDM Filter X Injected Channel Group Selection Register (Dfsdm_Fltxjchgr)
433
DFSDM Filter X Control Register (Dfsdm_Fltxfcr)
433
DFSDM Filter X Data Register for Injected Group (Dfsdm_Fltxjdatar)
434
DFSDM Filter X Data Register for the Regular Channel (Dfsdm_Fltxrdatar)
435
DFSDM Filter X Analog Watchdog High Threshold Register (Dfsdm_Fltxawhtr)
436
DFSDM Filter X Analog Watchdog Low Threshold Register
436
(Dfsdm_Fltxawltr)
436
DFSDM Filter X Analog Watchdog Status Register
437
(Dfsdm_Fltxawsr)
437
DFSDM Filter X Analog Watchdog Clear Flag Register
438
(Dfsdm_Fltxawcfr)
438
DFSDM Filter X Extremes Detector Maximum Register
438
(Dfsdm_Fltxexmax)
438
DFSDM Filter X Extremes Detector Minimum Register
439
(Dfsdm_Fltxexmin)
439
DFSDM Filter X Conversion Timer Register (Dfsdm_Fltxcnvtimr)
439
DFSDM Register Map
440
Table 97. DFSDM Register Map and Reset Values
440
True Random Number Generator (RNG)
450
Introduction
450
RNG Main Features
450
RNG Functional Description
451
RNG Block Diagram
451
RNG Internal Signals
451
Table 98. RNG Internal Input/Output Signals
451
Figure 85. RNG Block Diagram
451
Random Number Generation
452
Figure 86. Entropy Source Model
452
RNG Initialization
454
RNG Operation
454
RNG Clocking
455
Error Management
455
RNG Low-Power Usage
456
RNG Interrupts
456
RNG Processing Time
456
Table 99. RNG Interrupt Requests
456
Entropy Source Validation
457
Introduction
457
Validation Conditions
457
Data Collection
457
RNG Registers
458
RNG Control Register (RNG_CR)
458
RNG Status Register (RNG_SR)
459
RNG Data Register (RNG_DR)
460
RNG Register Map
461
Table 100. RNG Register Map and Reset Map
461
Advanced-Control Timers (TIM1&TIM8)
462
TIM1&TIM8 Introduction
462
TIM1&TIM8 Main Features
462
Figure 87. Advanced-Control Timer Block Diagram
463
TIM1&TIM8 Functional Description
464
Time-Base Unit
464
Figure 88. Counter Timing Diagram with Prescaler Division Change from 1 to 2
465
Figure 89. Counter Timing Diagram with Prescaler Division Change from 1 to 4
465
Counter Modes
466
Figure 90. Counter Timing Diagram, Internal Clock Divided by 1
466
Figure 91. Counter Timing Diagram, Internal Clock Divided by 2
467
Figure 92. Counter Timing Diagram, Internal Clock Divided by 4
467
Figure 93. Counter Timing Diagram, Internal Clock Divided by N
467
Figure 94. Counter Timing Diagram, Update Event When ARPE=0
468
Figure 95. Counter Timing Diagram, Update Event When ARPE=1
468
Figure 96. Counter Timing Diagram, Internal Clock Divided by 1
470
Figure 97. Counter Timing Diagram, Internal Clock Divided by 2
470
Figure 98. Counter Timing Diagram, Internal Clock Divided by 4
471
Figure 99. Counter Timing Diagram, Internal Clock Divided by N
471
Figure 100. Counter Timing Diagram, Update Event When Repetition Counter Is Not Used
472
Figure 101. Counter Timing Diagram, Internal Clock Divided by 1, Timx_Arr = 0X6
473
Figure 102. Counter Timing Diagram, Internal Clock Divided by 2
473
Figure 103. Counter Timing Diagram, Internal Clock Divided by 4, Timx_Arr=0X36
474
Figure 104. Counter Timing Diagram, Internal Clock Divided by N
474
Repetition Counter
475
Figure 105. Counter Timing Diagram, Update Event with ARPE=1 (Counter Underflow)
475
Figure 106. Counter Timing Diagram, Update Event with ARPE=1 (Counter Overflow)
475
Figure 107. Update Rate Examples Depending on Mode and Timx_Rcr Register Settings
477
Clock Selection
478
Figure 108. Control Circuit in Normal Mode, Internal Clock Divided by 1
478
Figure 109. TI2 External Clock Connection Example
479
Figure 110. Control Circuit in External Clock Mode 1
480
Figure 111. External Trigger Input Block
480
Capture/Compare Channels
481
Figure 112. Control Circuit in External Clock Mode 2
481
Figure 113. Capture/Compare Channel (Example: Channel 1 Input Stage)
482
Figure 114. Capture/Compare Channel 1 Main Circuit
482
Figure 115. Output Stage of Capture/Compare Channel (Channels 1 to 3)
483
Figure 116. Output Stage of Capture/Compare Channel (Channel 4)
483
Input Capture Mode
484
PWM Input Mode
485
Forced Output Mode
485
Figure 117. PWM Input Mode Timing
485
Output Compare Mode
486
PWM Mode
487
Figure 118. Output Compare Mode, Toggle on OC1
487
Figure 119. Edge-Aligned PWM Waveforms (ARR=8)
488
Figure 120. Center-Aligned PWM Waveforms (ARR=8)
489
Complementary Outputs and Dead-Time Insertion
490
Figure 121. Complementary Output with Dead-Time Insertion
491
Figure 122. Dead-Time Waveforms with Delay Greater than the Negative Pulse
491
Figure 123. Dead-Time Waveforms with Delay Greater than the Positive Pulse
491
Using the Break Function
492
Figure 124. Output Behavior in Response to a Break
494
Clearing the Ocxref Signal on an External Event
495
Figure 125. Clearing Timx Ocxref
495
6-Step PWM Generation
496
Figure 126. 6-Step Generation, COM Example (OSSR=1)
496
One-Pulse Mode
497
Figure 127. Example of One Pulse Mode
497
Encoder Interface Mode
498
Table 101. Counting Direction Versus Encoder Signals
499
Figure 128. Example of Counter Operation in Encoder Interface Mode
500
Figure 129. Example of Encoder Interface Mode with TI1FP1 Polarity Inverted
500
Timer Input XOR Function
501
Interfacing with Hall Sensors
501
Figure 130. Example of Hall Sensor Interface
502
Timx and External Trigger Synchronization
503
Figure 131. Control Circuit in Reset Mode
503
Figure 132. Control Circuit in Gated Mode
504
Figure 133. Control Circuit in Trigger Mode
505
Timer Synchronization
506
Debug Mode
506
Figure 134. Control Circuit in External Clock Mode 2 + Trigger Mode
506
TIM1&TIM8 Registers
507
TIM1&TIM8 Control Register 1 (Timx_Cr1)
507
TIM1&TIM8 Control Register 2 (Timx_Cr2)
508
TIM1&TIM8 Slave Mode Control Register (Timx_Smcr)
510
TIM1&TIM8 Dma/Interrupt Enable Register (Timx_Dier)
512
Table 102. Timx Internal Trigger Connection
512
TIM1&TIM8 Status Register (Timx_Sr)
514
TIM1&TIM8 Event Generation Register (Timx_Egr)
515
TIM1&TIM8 Capture/Compare Mode Register 1 (Timx_Ccmr1)
517
TIM1&TIM8 Capture/Compare Mode Register 2 (Timx_Ccmr2)
520
TIM1&TIM8 Capture/Compare Enable Register (Timx_Ccer)
521
Table 103. Output Control Bits for Complementary Ocx and Ocxn Channels
524
TIM1&TIM8 Counter (Timx_Cnt)
525
TIM1&TIM8 Prescaler (Timx_Psc)
525
TIM1 Auto-Reload Register (Timx_Arr)
525
TIM1&TIM8 Repetition Counter Register (Timx_Rcr)
526
TIM1&TIM8 Capture/Compare Register 1 (Timx_Ccr1)
526
TIM1 Capture/Compare Register 2 (Timx_Ccr2)
527
TIM1&TIM8 Capture/Compare Register 3 (Timx_Ccr3)
527
TIM1&TIM8 Capture/Compare Register 4 (Timx_Ccr4)
528
TIM1&TIM8 Break and Dead-Time Register (Timx_Bdtr)
528
TIM1&TIM8 DMA Control Register (Timx_Dcr)
530
TIM1&TIM8 DMA Address for Full Transfer (Timx_Dmar)
531
TIM1&TIM8 Register Map
532
Table 104. TIM1&TIM8 Register Map and Reset Values
532
General-Purpose Timers (TIM2 to TIM5)
534
TIM2 to TIM5 Introduction
534
TIM2 to TIM5 Main Features
534
TIM2 to TIM5 Functional Description
535
Time-Base Unit
535
Figure 135. General-Purpose Timer Block Diagram
535
Figure 136. Counter Timing Diagram with Prescaler Division Change from 1 to 2
536
Counter Modes
537
Figure 137. Counter Timing Diagram with Prescaler Division Change from 1 to 4
537
Figure 138. Counter Timing Diagram, Internal Clock Divided by 1
538
Figure 139. Counter Timing Diagram, Internal Clock Divided by 2
538
Figure 140. Counter Timing Diagram, Internal Clock Divided by 4
538
Figure 141. Counter Timing Diagram, Internal Clock Divided by N
539
Figure 142. Counter Timing Diagram, Update Event When ARPE=0 (Timx_Arr Not Preloaded)
539
Figure 143. Counter Timing Diagram, Update Event When ARPE=1 (Timx_Arr Preloaded)
540
Figure 144. Counter Timing Diagram, Internal Clock Divided by 1
541
Figure 145. Counter Timing Diagram, Internal Clock Divided by 2
541
Figure 146. Counter Timing Diagram, Internal Clock Divided by 4
541
Figure 147. Counter Timing Diagram, Internal Clock Divided by N
542
Figure 148. Counter Timing Diagram, Update Event
542
Figure 149. Counter Timing Diagram, Internal Clock Divided by 1, Timx_Arr=0X6
543
Figure 150. Counter Timing Diagram, Internal Clock Divided by 2
544
Figure 151. Counter Timing Diagram, Internal Clock Divided by 4, Timx_Arr=0X36
544
Figure 152. Counter Timing Diagram, Internal Clock Divided by N
544
Figure 153. Counter Timing Diagram, Update Event with ARPE=1 (Counter Underflow)
545
Figure 154. Counter Timing Diagram, Update Event with ARPE=1 (Counter Overflow)
545
Clock Selection
546
Figure 155. Control Circuit in Normal Mode, Internal Clock Divided by 1
546
Figure 156. TI2 External Clock Connection Example
547
Figure 157. Control Circuit in External Clock Mode 1
548
Figure 158. External Trigger Input Block
548
Capture/Compare Channels
549
Figure 159. Control Circuit in External Clock Mode 2
549
Figure 160. Capture/Compare Channel (Example: Channel 1 Input Stage)
550
Figure 161. Capture/Compare Channel 1 Main Circuit
550
Input Capture Mode
551
Figure 162. Output Stage of Capture/Compare Channel (Channel 1)
551
PWM Input Mode
552
Forced Output Mode
553
Figure 163. PWM Input Mode Timing
553
Output Compare Mode
554
PWM Mode
555
Figure 164. Output Compare Mode, Toggle on OC1
555
Figure 165. Edge-Aligned PWM Waveforms (ARR=8)
556
Figure 166. Center-Aligned PWM Waveforms (ARR=8)
557
One-Pulse Mode
558
Figure 167. Example of One-Pulse Mode
558
Clearing the Ocxref Signal on an External Event
559
Encoder Interface Mode
560
Figure 168. Clearing Timx Ocxref
560
Table 105. Counting Direction Versus Encoder Signals
561
Figure 169. Example of Counter Operation in Encoder Interface Mode
562
Figure 170. Example of Encoder Interface Mode with TI1FP1 Polarity Inverted
562
Timer Input XOR Function
563
Timers and External Trigger Synchronization
563
Figure 171. Control Circuit in Reset Mode
563
Figure 172. Control Circuit in Gated Mode
564
Figure 173. Control Circuit in Trigger Mode
565
Timer Synchronization
566
Figure 174. Control Circuit in External Clock Mode 2 + Trigger Mode
566
Figure 175. Master/Slave Timer Example
566
Figure 176. Gating Timer 2 with OC1REF of Timer 1
567
Figure 177. Gating Timer 2 with Enable of Timer 1
568
Figure 178. Triggering Timer 2 with Update of Timer 1
569
Figure 179. Triggering Timer 2 with Enable of Timer 1
570
Debug Mode
571
Figure 180. Triggering Timer 1 and 2 with Timer 1 TI1 Input
571
TIM2 to TIM5 Registers
572
Timx Control Register 1 (Timx_Cr1)
572
Timx Control Register 2 (Timx_Cr2)
574
Timx Slave Mode Control Register (Timx_Smcr)
575
Table 106. Timx Internal Trigger Connections
576
Timx Dma/Interrupt Enable Register (Timx_Dier)
577
Timx Status Register (Timx_Sr)
578
Timx Event Generation Register (Timx_Egr)
580
Timx Capture/Compare Mode Register 1 (Timx_Ccmr1)
581
Timx Capture/Compare Mode Register 2 (Timx_Ccmr2)
584
Timx Capture/Compare Enable Register (Timx_Ccer)
585
Table 107. Output Control Bit for Standard Ocx Channels
586
Timx Counter (Timx_Cnt)
587
Timx Prescaler (Timx_Psc)
587
Timx Auto-Reload Register (Timx_Arr)
587
Timx Capture/Compare Register 1 (Timx_Ccr1)
588
Timx Capture/Compare Register 2 (Timx_Ccr2)
588
Timx Capture/Compare Register 3 (Timx_Ccr3)
589
Timx Capture/Compare Register 4 (Timx_Ccr4)
589
Timx DMA Control Register (Timx_Dcr)
590
Timx DMA Address for Full Transfer (Timx_Dmar)
590
TIM2 Option Register (TIM2_OR)
591
TIM5 Option Register (TIM5_OR)
592
Timx Register Map
593
Table 108. TIM2 to TIM5 Register Map and Reset Values
593
General-Purpose Timers (TIM9 to TIM14)
595
TIM9 to TIM14 Introduction
595
TIM9 to TIM14 Main Features
595
TIM9/TIM12 Main Features
595
TIM10/TIM11 and TIM13/TIM14 Main Features
596
Figure 181. General-Purpose Timer Block Diagram (TIM9 and TIM12)
596
Figure 182. General-Purpose Timer Block Diagram (TIM10/11/13/14)
597
TIM9 to TIM14 Functional Description
598
Time-Base Unit
598
Figure 183. Counter Timing Diagram with Prescaler Division Change from 1 to 2
599
Figure 184. Counter Timing Diagram with Prescaler Division Change from 1 to 4
599
Counter Modes
600
Figure 185. Counter Timing Diagram, Internal Clock Divided by 1
600
Figure 186. Counter Timing Diagram, Internal Clock Divided by 2
601
Figure 187. Counter Timing Diagram, Internal Clock Divided by 4
601
Figure 188. Counter Timing Diagram, Internal Clock Divided by N
601
Figure 189. Counter Timing Diagram, Update Event When ARPE=0
602
Figure 190. Counter Timing Diagram, Update Event When ARPE=1
602
Clock Selection
603
Figure 191. Control Circuit in Normal Mode, Internal Clock Divided by 1
603
Figure 192. TI2 External Clock Connection Example
604
Figure 193. Control Circuit in External Clock Mode 1
604
Capture/Compare Channels
605
Figure 194. Capture/Compare Channel (Example: Channel 1 Input Stage)
605
Input Capture Mode
606
Figure 195. Capture/Compare Channel 1 Main Circuit
606
Figure 196. Output Stage of Capture/Compare Channel (Channel 1)
606
PWM Input Mode (Only for TIM9/12)
607
Forced Output Mode
608
Figure 197. PWM Input Mode Timing
608
Output Compare Mode
609
PWM Mode
610
Figure 198. Output Compare Mode, Toggle on OC1
610
One-Pulse Mode
611
Figure 199. Edge-Aligned PWM Waveforms (ARR=8)
611
Figure 200. Example of One Pulse Mode
612
TIM9/12 External Trigger Synchronization
613
Figure 201. Control Circuit in Reset Mode
614
Figure 202. Control Circuit in Gated Mode
615
Figure 203. Control Circuit in Trigger Mode
615
Timer Synchronization (TIM9/12)
616
Debug Mode
616
TIM9 and TIM12 Registers
616
TIM9/12 Control Register 1 (Timx_Cr1)
616
TIM9/12 Slave Mode Control Register (Timx_Smcr)
618
TIM9/12 Interrupt Enable Register (Timx_Dier)
619
Table 109. Timx Internal Trigger Connections
619
TIM9/12 Status Register (Timx_Sr)
620
TIM9/12 Event Generation Register (Timx_Egr)
622
TIM9/12 Capture/Compare Mode Register 1 (Timx_Ccmr1)
622
TIM9/12 Capture/Compare Enable Register (Timx_Ccer)
626
TIM9/12 Counter (Timx_Cnt)
627
TIM9/12 Prescaler (Timx_Psc)
627
TIM9/12 Auto-Reload Register (Timx_Arr)
627
Table 110. Output Control Bit for Standard Ocx Channels
627
TIM9/12 Capture/Compare Register 1 (Timx_Ccr1)
628
TIM9/12 Capture/Compare Register 2 (Timx_Ccr2)
628
TIM9/12 Register Map
629
Table 111. TIM9/12 Register Map and Reset Values
629
TIM10/11/13/14 Registers
631
TIM10/11/13/14 Control Register 1 (Timx_Cr1)
631
TIM10/11/13/14 Interrupt Enable Register (Timx_Dier)
632
TIM10/11/13/14 Status Register (Timx_Sr)
632
TIM10/11/13/14 Event Generation Register (Timx_Egr)
633
TIM10/11/13/14 Capture/Compare Mode Register 1
634
(Timx_Ccmr1)
634
TIM10/11/13/14 Capture/Compare Enable Register
637
(Timx_Ccer)
637
Table 112. Output Control Bit for Standard Ocx Channels
637
TIM10/11/13/14 Counter (Timx_Cnt)
638
TIM10/11/13/14 Prescaler (Timx_Psc)
638
TIM10/11/13/14 Auto-Reload Register (Timx_Arr)
638
TIM10/11/13/14 Capture/Compare Register 1 (Timx_Ccr1)
639
TIM11 Option Register 1 (TIM11_OR)
639
TIM10/11/13/14 Register Map
640
Table 113. TIM10/11/13/14 Register Map and Reset Values
640
Basic Timers (TIM6/7)
642
Introduction
642
TIM6/7 Main Features
642
Figure 204. Basic Timer Block Diagram
642
TIM6/7 Functional Description
643
Time-Base Unit
643
Figure 205. Counter Timing Diagram with Prescaler Division Change from 1 to 2
644
Figure 206. Counter Timing Diagram with Prescaler Division Change from 1 to 4
644
Counting Mode
645
Figure 207. Counter Timing Diagram, Internal Clock Divided by 1
645
Figure 208. Counter Timing Diagram, Internal Clock Divided by 2
646
Figure 209. Counter Timing Diagram, Internal Clock Divided by 4
646
Figure 210. Counter Timing Diagram, Internal Clock Divided by N
647
Clock Source
648
Debug Mode
649
Figure 213. Control Circuit in Normal Mode, Internal Clock Divided by 1
649
TIM6/7 Registers
650
TIM6/7 Control Register 1 (Timx_Cr1)
650
TIM6/7 Control Register 2 (Timx_Cr2)
651
TIM6/7 Dma/Interrupt Enable Register (Timx_Dier)
651
TIM6/7 Status Register (Timx_Sr)
652
TIM6/7 Event Generation Register (Timx_Egr)
652
TIM6/7 Counter (Timx_Cnt)
652
TIM6/7 Prescaler (Timx_Psc)
653
TIM6/7 Auto-Reload Register (Timx_Arr)
653
TIM6/7 Register Map
654
Table 114. TIM6 Register Map and Reset Values
654
Low-Power Timer (LPTIM)
655
Introduction
655
LPTIM Main Features
655
LPTIM Implementation
655
Table 115. STM32F413/423 LPTIM Features
655
LPTIM Functional Description
656
LPTIM Block Diagram
656
LPTIM Trigger Mapping
656
Table 116. LPTIM1 External Trigger Connection
656
Figure 214. Low-Power Timer Block Diagram
656
LPTIM Input1 Multiplexing
657
LPTIM Reset and Clocks
657
Glitch Filter
657
Prescaler
658
Table 117. Prescaler Division Ratios
658
Figure 215. Glitch Filter Timing Diagram
658
Trigger Multiplexer
659
Operating Mode
659
Figure 216. LPTIM Output Waveform, Single Counting Mode Configuration
660
Figure 217. LPTIM Output Waveform, Single Counting Mode Configuration
660
Timeout Function
661
Waveform Generation
661
Figure 218. LPTIM Output Waveform, Continuous Counting Mode Configuration
661
Register Update
662
Figure 219. Waveform Generation
662
Counter Mode
663
Timer Enable
663
Encoder Mode
664
Table 118. Encoder Counting Scenarios
664
Debug Mode
665
LPTIM Interrupts
665
Figure 220. Encoder Mode Counting Sequence
665
LPTIM Registers
666
LPTIM Interrupt and Status Register (LPTIM_ISR)
666
Table 119. Interrupt Events
666
LPTIM Interrupt Clear Register (LPTIM_ICR)
667
LPTIM Interrupt Enable Register (LPTIM_IER)
668
LPTIM Configuration Register (LPTIM_CFGR)
670
LPTIM Control Register (LPTIM_CR)
672
LPTIM Compare Register (LPTIM_CMP)
673
LPTIM Autoreload Register (LPTIM_ARR)
674
LPTIM Counter Register (LPTIM_CNT)
674
LPTIM1 Option Register (LPTIM1_OPTR)
675
LPTIM Register Map
676
Table 120. LPTIM Register Map and Reset Values
676
Independent Watchdog (IWDG)
678
IWDG Introduction
678
IWDG Main Features
678
IWDG Functional Description
678
Hardware Watchdog
678
Register Access Protection
678
Debug Mode
679
Table 121. Min/Max IWDG Timeout Period at 32 Khz (LSI)
679
Figure 221. Independent Watchdog Block Diagram
679
IWDG Registers
680
Key Register (IWDG_KR)
680
Prescaler Register (IWDG_PR)
681
Reload Register (IWDG_RLR)
682
Status Register (IWDG_SR)
682
IWDG Register Map
683
Table 122. IWDG Register Map and Reset Values
683
Window Watchdog (WWDG)
684
WWDG Introduction
684
WWDG Main Features
684
WWDG Functional Description
684
Figure 222. Watchdog Block Diagram
685
How to Program the Watchdog Timeout
686
Figure 223. Window Watchdog Timing Diagram
686
Debug Mode
687
WWDG Registers
688
Control Register (WWDG_CR)
688
Configuration Register (WWDG_CFR)
689
Status Register (WWDG_SR)
689
WWDG Register Map
690
Table 123. WWDG Register Map and Reset Values
690
AES Hardware Accelerator (AES)
691
Introduction
691
AES Main Features
691
AES Implementation
692
AES Functional Description
692
AES Block Diagram
692
AES Internal Signals
692
Table 124. AES Internal Input/Output Signals
692
Figure 224. AES Block Diagram
692
AES Cryptographic Core
693
Figure 225. ECB Encryption and Decryption Principle
694
Figure 226. CBC Encryption and Decryption Principle
695
Figure 227. CTR Encryption and Decryption Principle
696
Figure 228. GCM Encryption and Authentication Principle
697
Figure 229. GMAC Authentication Principle
697
AES Procedure to Perform a Cipher Operation
698
Figure 230. CCM Encryption and Authentication Principle
698
Figure 231. STM32 Cryptolib AES Flowchart Examples
699
Figure 232. STM32 Cryptolib AES Flowchart Examples (Continued)
700
AES Decryption Key Preparation
702
AES Ciphertext Stealing and Data Padding
703
Figure 233. Encryption Key Derivation for ECB/CBC Decryption (Mode 2)
703
AES Task Suspend and Resume
704
Figure 234. Example of Suspend Mode Management
704
AES Basic Chaining Modes (ECB, CBC)
705
Figure 235. ECB Encryption
705
Figure 236. ECB Decryption
705
Figure 237. CBC Encryption
706
Figure 238. CBC Decryption
706
Figure 239. ECB/CBC Encryption (Mode 1)
707
Figure 240. ECB/CBC Decryption (Mode 3)
708
AES Counter (CTR) Mode
710
Figure 241. Message Construction in CTR Mode
710
Table 125. CTR Mode Initialization Vector Definition
711
Figure 242. CTR Encryption
711
Figure 243. CTR Decryption
711
AES Galois/Counter Mode (GCM)
712
Table 126. GCM Last Block Definition
713
Figure 244. Message Construction in GCM
713
Table 127. GCM Mode IVI Bitfield Initialization
714
Figure 245. GCM Authenticated Encryption
714
AES Galois Message Authentication Code (GMAC)
717
Figure 246. Message Construction in GMAC Mode
718
Figure 247. GMAC Authentication Mode
718
AES Counter with CBC-MAC (CCM)
719
Figure 248. Message Construction in CCM Mode
719
Table 128. Initialization of Aes_Ivrx Registers in CCM Mode
721
Figure 249. CCM Mode Authenticated Decryption
721
AES Data Registers and Data Swapping
724
Figure 250. 128-Bit Block Construction with Respect to Data Swap
725
AES Key Registers
726
AES Initialization Vector Registers
726
AES DMA Interface
726
Table 129. Key Endianness in Aes_Keyrx Registers (128- or 256-Bit Key Length)
726
Table 130. DMA Channel Configuration for Memory-To-AES Data Transfer
727
Figure 251. DMA Transfer of a 128-Bit Data Block During Input Phase
727
Table 131. DMA Channel Configuration for AES-To-Memory Data Transfer
728
Figure 252. DMA Transfer of a 128-Bit Data Block During Output Phase
728
AES Error Management
729
AES Interrupts
729
Figure 253. AES Interrupt Signal Generation
729
AES Processing Latency
730
Table 132. AES Interrupt Requests
730
Table 133. Processing Latency (in Clock Cycle) for ECB, CBC and CTR
730
Table 134. Processing Latency for GCM and CCM (in Clock Cycle)
730
AES Registers
731
AES Control Register (AES_CR)
731
AES Status Register (AES_SR)
734
AES Data Input Register (AES_DINR)
735
AES Data Output Register (AES_DOUTR)
736
AES Key Register 0 (AES_KEYR0)
736
AES Key Register 1 (AES_KEYR1)
737
AES Key Register 2 (AES_KEYR2)
737
AES Key Register 3 (AES_KEYR3)
738
AES Initialization Vector Register 0 (AES_IVR0)
738
AES Initialization Vector Register 1 (AES_IVR1)
738
AES Initialization Vector Register 2 (AES_IVR2)
739
AES Initialization Vector Register 3 (AES_IVR3)
739
AES Key Register 4 (AES_KEYR4)
740
AES Key Register 5 (AES_KEYR5)
740
AES Key Register 6 (AES_KEYR6)
740
AES Key Register 7 (AES_KEYR7)
741
AES Suspend Registers (Aes_Suspxr)
741
AES Register Map
742
Table 135. AES Register Map and Reset Values
742
Real-Time Clock (RTC)
744
Introduction
744
RTC Main Features
744
RTC Functional Description
746
Clock and Prescalers
746
Real-Time Clock and Calendar
746
Figure 254. RTC Block Diagram
746
Programmable Alarms
747
Periodic Auto-Wakeup
747
RTC Initialization and Configuration
748
Reading the Calendar
750
Resetting the RTC
751
RTC Synchronization
751
RTC Reference Clock Detection
752
RTC Coarse Digital Calibration
752
RTC Smooth Digital Calibration
753
Timestamp Function
755
Tamper Detection
756
Calibration Clock Output
757
Alarm Output
758
RTC and Low Power Modes
758
Table 136. Effect of Low Power Modes on RTC
758
RTC Interrupts
759
Table 137. Interrupt Control Bits
759
RTC Registers
760
RTC Time Register (RTC_TR)
760
RTC Date Register (RTC_DR)
761
RTC Control Register (RTC_CR)
762
RTC Initialization and Status Register (RTC_ISR)
764
RTC Prescaler Register (RTC_PRER)
766
RTC Wakeup Timer Register (RTC_WUTR)
767
RTC Calibration Register (RTC_CALIBR)
767
RTC Alarm a Register (RTC_ALRMAR)
769
RTC Alarm B Register (RTC_ALRMBR)
770
RTC Write Protection Register (RTC_WPR)
771
RTC Sub Second Register (RTC_SSR)
771
RTC Shift Control Register (RTC_SHIFTR)
772
RTC Time Stamp Time Register (RTC_TSTR)
773
RTC Time Stamp Date Register (RTC_TSDR)
773
RTC Timestamp Sub Second Register (RTC_TSSSR)
774
RTC Calibration Register (RTC_CALR)
774
RTC Tamper and Alternate Function Configuration Register
775
(Rtc_Tafcr)
775
RTC Alarm a Sub Second Register (RTC_ALRMASSR)
777
RTC Alarm B Sub Second Register (RTC_ALRMBSSR)
778
RTC Backup Registers (Rtc_Bkpxr)
779
RTC Register Map
779
Table 138. RTC Register Map and Reset Values
779
Fast-Mode Plus Inter-Integrated Circuit (FMPI2C) Interface
782
Introduction
782
FMPI2C Main Features
782
FMPI2C Implementation
783
FMPI2C Functional Description
783
Table 139. STM32F413/423 FMPI2C Implementation
783
FMPI2C Block Diagram
784
Figure 255. FMPI2C Block Diagram
784
FMPI2C Clock Requirements
785
Mode Selection
785
FMPI2C Initialization
786
Figure 256. I2C Bus Protocol
786
Figure 257. Setup and Hold Timings
787
Table 140. I2C-SMBUS Specification Data Setup and Hold Times
788
Software Reset
790
Figure 258. FMPI2C Initialization Flowchart
790
Data Transfer
791
Figure 259. Data Reception
791
Figure 260. Data Transmission
792
FMPI2C Slave Mode
793
Table 141. FMPI2C Configuration
793
Figure 261. Slave Initialization Flowchart
795
Figure 262. Transfer Sequence Flowchart for FMPI2C Slave Transmitter, NOSTRETCH=0
797
Figure 263. Transfer Sequence Flowchart for FMPI2C Slave Transmitter, NOSTRETCH=1
798
Figure 264. Transfer Bus Diagrams for FMPI2C Slave Transmitter
799
Figure 265. Transfer Sequence Flowchart for Slave Receiver with NOSTRETCH=0
800
Figure 266. Transfer Sequence Flowchart for Slave Receiver with NOSTRETCH=1
801
Figure 267. Transfer Bus Diagrams for FMPI2C Slave Receiver
801
FMPI2C Master Mode
802
Figure 268. Master Clock Generation
803
Table 142. I2C-SMBUS Specification Clock Timings
804
Figure 269. Master Initialization Flowchart
805
Figure 270. 10-Bit Address Read Access with HEAD10R=0
805
Figure 271. 10-Bit Address Read Access with HEAD10R=1
806
Figure 272. Transfer Sequence Flowchart for FMPI2C Master Transmitter for N≤255 Bytes
807
Figure 273. Transfer Sequence Flowchart for FMPI2C Master Transmitter for N>255 Bytes
808
Figure 274. Transfer Bus Diagrams for FMPI2C Master Transmitter
809
Figure 275. Transfer Sequence Flowchart for FMPI2C Master Receiver for N≤255 Bytes
811
Figure 276. Transfer Sequence Flowchart for FMPI2C Master Receiver for N >255 Bytes
812
Figure 277. Transfer Bus Diagrams for FMPI2C Master Receiver
813
FMPI2C_TIMINGR Register Configuration Examples
814
Table 143. Examples of Timing Settings for Fi2Cclk = 8 Mhz
814
Table 144. Examples of Timings Settings for Fi2Cclk = 16 Mhz
814
Smbus Specific Features
815
Table 145. Smbus Timeout Specifications
817
Figure 278. Timeout Intervals for T
817
Smbus Initialization
818
Table 146. SMBUS with PEC Configuration
819
Table 147. Examples of TIMEOUTA Settings for Various FMPI2CCLK Frequencies
819
Smbus: FMPI2C_TIMEOUTR Register Configuration Examples
820
Smbus Slave Mode
820
Table 148. Examples of TIMEOUTB Settings for Various FMPI2CCLK Frequencies
820
Table 149. Examples of TIMEOUTA Settings for Various FMPI2CCLK Frequencies
820
Figure 279. Transfer Sequence Flowchart for Smbus Slave Transmitter N Bytes + PEC
821
Figure 280. Transfer Bus Diagrams for Smbus Slave Transmitter (SBC=1)
822
Figure 281. Transfer Sequence Flowchart for Smbus Slave Receiver N Bytes + PEC
823
Figure 282. Bus Transfer Diagrams for Smbus Slave Receiver (SBC=1)
824
Figure 283. Bus Transfer Diagrams for Smbus Master Transmitter
825
Error Conditions
827
Figure 284. Bus Transfer Diagrams for Smbus Master Receiver
827
DMA Requests
829
Debug Mode
830
FMPI2C Low-Power Modes
830
Table 150. Low-Power Modes
830
FMPI2C Interrupts
831
FMPI2C Registers
831
Control Register 1 (FMPI2C_CR1)
831
Table 151. FMPI2C Interrupt Requests
831
Control Register 2 (FMPI2C_CR2)
834
Own Address 1 Register (FMPI2C_OAR1)
837
Own Address 2 Register (FMPI2C_OAR2)
838
Timing Register (FMPI2C_TIMINGR)
839
Timeout Register (FMPI2C_TIMEOUTR)
840
Interrupt and Status Register (FMPI2C_ISR)
841
Interrupt Clear Register (FMPI2C_ICR)
843
PEC Register (FMPI2C_PECR)
844
Receive Data Register (FMPI2C_RXDR)
845
Transmit Data Register (FMPI2C_TXDR)
845
FMPI2C Register Map
846
Table 152. FMPI2C Register Map and Reset Values
846
Inter-Integrated Circuit (I 2 C) Interface
848
I 2 C Introduction
848
I 2 C Main Features
849
C Functional Description
850
Mode Selection
850
Figure 285. I2C Bus Protocol
850
I2C Slave Mode
851
Figure 286. I2C Block Diagram
851
Figure 287. Transfer Sequence Diagram for Slave Transmitter
853
I2C Master Mode
854
Figure 288. Transfer Sequence Diagram for Slave Receiver
854
Figure 289. Transfer Sequence Diagram for Master Transmitter
857
Figure 290. Transfer Sequence Diagram for Master Receiver
859
Error Conditions
860
Programmable Noise Filter
861
Table 153. Maximum DNF[3:0] Value to be Compliant with Thd:dat(Max)
861
SDA/SCL Line Control
862
Smbus
862
Table 154. Smbus Vs. I2C
863
DMA Requests
865
Packet Error Checking
866
I 2 C Interrupts
867
Table 155. I2C Interrupt Requests
867
Figure 291. I2C Interrupt Mapping Diagram
868
I 2 C Debug Mode
869
I 2 C Registers
869
I 2 C Control Register 1 (I2C_CR1)
869
I 2 C Control Register 2 (I2C_CR2)
871
I 2 C Own Address Register 1 (I2C_OAR1)
873
I 2 C Own Address Register 2 (I2C_OAR2)
873
C Data Register (I2C_DR)
874
C Status Register 1 (I2C_SR1)
874
I 2 C Status Register 2 (I2C_SR2)
878
I 2 C Clock Control Register (I2C_CCR)
879
C TRISE Register (I2C_TRISE)
880
I 2 C FLTR Register (I2C_FLTR)
881
I2C Register Map
882
Table 156. I2C Register Map and Reset Values
882
Universal Synchronous Receiver Transmitter (USART) /Universal Asynchronous Receiver Transmitter (UART)
883
USART Introduction
883
USART Main Features
884
USART Implementation
885
USART Functional Description
885
Table 157. USART Features
885
Figure 292. USART Block Diagram
887
USART Character Description
888
Figure 293. Word Length Programming
888
Transmitter
889
Figure 294. Configurable Stop Bits
890
Figure 295. TC/TXE Behavior When Transmitting
891
Receiver
892
Figure 296. Start Bit Detection When Oversampling by 16 or 8
892
Table 158. Noise Detection from Sampled Data
895
Figure 297. Data Sampling When Oversampling by 16
895
Figure 298. Data Sampling When Oversampling by 8
895
Fractional Baud Rate Generation
897
Table 159. Error Calculation for Programmed Baud Rates at F
899
Table 160. Error Calculation for Programmed Baud Rates at F
899
USART Receiver Tolerance to Clock Deviation
906
Table 169. USART Receiver Tolerance When DIV Fraction Is 0
906
Multiprocessor Communication
907
Table 170. USART Receiver Tolerance When Div_Fraction Is Different from 0
907
Figure 299. Mute Mode Using Idle Line Detection
908
Figure 300. Mute Mode Using Address Mark Detection
908
Parity Control
909
Table 171. Frame Formats
909
LIN (Local Interconnection Network) Mode
910
Figure 301. Break Detection in LIN Mode (11-Bit Break Length - LBDL Bit Is Set)
911
USART Synchronous Mode
912
Figure 302. Break Detection in LIN Mode Vs. Framing Error Detection
912
Figure 303. USART Example of Synchronous Transmission
913
Figure 304. USART Data Clock Timing Diagram (M=0)
913
Single-Wire Half-Duplex Communication
914
Figure 305. USART Data Clock Timing Diagram (M=1)
914
Figure 306. RX Data Setup/Hold Time
914
Smartcard
915
Figure 307. ISO 7816-3 Asynchronous Protocol
915
Figure 308. Parity Error Detection Using the 1.5 Stop Bits
916
Irda SIR ENDEC Block
917
Figure 309. Irda SIR ENDEC- Block Diagram
918
Figure 310. Irda Data Modulation (3/16) -Normal Mode
918
Continuous Communication Using DMA
919
Figure 311. Transmission Using DMA
920
Hardware Flow Control
921
Figure 312. Reception Using DMA
921
Figure 313. Hardware Flow Control between 2 Usarts
921
Figure 314. RTS Flow Control
922
Figure 315. CTS Flow Control
922
USART Interrupts
923
Table 172. USART Interrupt Requests
923
USART Registers
924
Status Register (USART_SR)
924
Figure 316. USART Interrupt Mapping Diagram
924
Data Register (USART_DR)
927
Baud Rate Register (USART_BRR)
927
Control Register 1 (USART_CR1)
928
Control Register 2 (USART_CR2)
930
Control Register 3 (USART_CR3)
931
Guard Time and Prescaler Register (USART_GTPR)
933
USART Register Map
934
Table 173. USART Register Map and Reset Values
934
Serial Peripheral Interface/ Inter-IC Sound (SPI/I2S)
935
Introduction
935
SPI Main Features
936
SPI Extended Features
937
I2S Features
937
SPI/I2S Implementation
937
Table 174. STM32F413/423 SPI Implementation
937
SPI Functional Description
938
General Description
938
Figure 317. SPI Block Diagram
938
Communications between One Master and One Slave
939
Figure 318. Full-Duplex Single Master/ Single Slave Application
939
Figure 319. Half-Duplex Single Master/ Single Slave Application
940
Figure 320. Simplex Single Master/Single Slave Application
941
Standard Multi-Slave Communication
942
Figure 321. Master and Three Independent Slaves
942
Multi-Master Communication
943
Slave Select (NSS) Pin Management
943
Figure 322. Multi-Master Application
943
Figure 323. Hardware/Software Slave Select Management
944
Communication Formats
945
Figure 324. Data Clock Timing Diagram
946
SPI Configuration
947
Procedure for Enabling SPI
947
Data Transmission and Reception Procedures
948
Figure 325. TXE/RXNE/BSY Behavior in Master / Full-Duplex Mode (BIDIMODE=0, RXONLY=0) in the Case of Continuous Transfers
949
Procedure for Disabling the SPI
950
Figure 326. TXE/RXNE/BSY Behavior in Slave / Full-Duplex Mode (BIDIMODE=0, RXONLY=0) in the Case of Continuous Transfers
950
Communication Using DMA (Direct Memory Addressing)
951
Figure 327. Transmission Using DMA
952
SPI Status Flags
953
Figure 328. Reception Using DMA
953
SPI Error Flags
954
SPI Special Features
955
TI Mode
955
CRC Calculation
956
Figure 329. TI Mode Transfer
956
SPI Interrupts
958
Table 175. SPI Interrupt Requests
958
I 2 S Functional Description
959
I 2 S General Description
959
Figure 330. I
959
I2S Full-Duplex
960
Figure 331. I2S Full-Duplex Block Diagram
960
Supported Audio Protocols
961
Figure 332. I 2 S Philips Protocol Waveforms (16/32-Bit Full Accuracy, CPOL = 0)
962
Figure 333. I 2 S Philips Standard Waveforms (24-Bit Frame with CPOL = 0)
962
Figure 334. Transmitting 0X8Eaa33
962
Figure 335. Receiving 0X8Eaa33
963
Figure 336. I
963
Figure 337. Example of 16-Bit Data Frame Extended to 32-Bit Channel Frame
963
Figure 338. MSB Justified 16-Bit or 32-Bit Full-Accuracy Length with CPOL = 0
964
Figure 339. MSB Justified 24-Bit Frame Length with CPOL = 0
964
Figure 340. MSB Justified 16-Bit Extended to 32-Bit Packet Frame with CPOL = 0
964
Figure 341. LSB Justified 16-Bit or 32-Bit Full-Accuracy with CPOL = 0
965
Figure 342. LSB Justified 24-Bit Frame Length with CPOL = 0
965
Figure 343. Operations Required to Transmit 0X3478Ae
965
Figure 344. Operations Required to Receive 0X3478Ae
966
Figure 345. LSB Justified 16-Bit Extended to 32-Bit Packet Frame with CPOL = 0
966
Figure 346. Example of 16-Bit Data Frame Extended to 32-Bit Channel Frame
966
Clock Generator
967
Figure 347. PCM Standard Waveforms (16-Bit)
967
Figure 348. PCM Standard Waveforms (16-Bit Extended to 32-Bit Packet Frame)
967
Figure 349. Audio Sampling Frequency Definition
968
Figure 350. I 2 S Clock Generator Architecture
968
Table 176. Audio-Frequency Precision Using Standard 8 Mhz HSE
969
I 2 S Master Mode
970
I 2 S Slave Mode
972
I 2 S Status Flags
973
I 2 S Error Flags
974
I 2 S Interrupts
975
DMA Features
975
Table 177. I
975
SPI and I 2 S Registers
976
SPI Control Register 1 (SPI_CR1) (Not Used in I 2 S Mode)
976
SPI Control Register 2 (SPI_CR2)
978
SPI Status Register (SPI_SR)
979
SPI Data Register (SPI_DR)
981
SPI CRC Polynomial Register (SPI_CRCPR) (Not Used in I
981
Mode
981
SPI RX CRC Register (SPI_RXCRCR) (Not Used in I 2 S Mode)
982
SPI TX CRC Register (SPI_TXCRCR) (Not Used in I 2 S Mode)
982
SPI_I 2 S Configuration Register (SPI_I2SCFGR)
983
SPI_I 2 S Prescaler Register (SPI_I2SPR)
984
SPI Register Map
986
Table 178. SPI Register Map and Reset Values
986
Serial Audio Interface (SAI)
987
Introduction
987
Main Features
988
Functional Block Diagram
988
Figure 351. Functional Block Diagram
989
Main SAI Modes
990
SAI Synchronization Mode
991
Audio Data Size
991
Frame Synchronization
991
Figure 352. Audio Frame
991
Frame Length
992
Frame Synchronization Polarity
992
Frame Synchronization Active Level Length
993
Frame Synchronization Offset
993
FS Signal Role
993
Figure 353. FS Role Is Start of Frame + Channel Side Identification (FSDEF = TRIS = 1)
993
Slot Configuration
994
Figure 354. FS Role Is Start of Frame (FSDEF = 0)
994
Figure 355. Slot Size Configuration with FBOFF = 0 in Sai_Xslotr
995
Figure 356. First Bit Offset
995
SAI Clock Generator
996
Figure 357. Audio Block Clock Generator Overview
996
Internal Fifos
997
Table 179. Example of Possible Audio Frequency Sampling Range
997
AC'97 Link Controller
1000
Specific Features
1000
Figure 358. AC'97 Audio Frame
1000
Mute Mode
1001
MONO/STEREO Function
1001
Companding Mode
1002
Figure 359. Data Companding Hardware in an Audio Block in the SAI
1002
Output Data Line Management on an Inactive Slot
1003
Figure 360. Tristate Strategy on SD Output Line on an Inactive Slot
1004
Error Flags
1005
FIFO Overrun/Underrun (OVRUDR)
1005
Figure 361. Tristate on Output Data Line in a Protocol Like I2S
1005
Figure 362. Overrun Detection Error
1006
Anticipated Frame Synchronisation Detection (AFSDET)
1007
Late Frame Synchronization Detection
1007
Figure 363. FIFO Underrun Event
1007
Codec Not Ready (CNRDY AC'97)
1008
Wrong Clock Configuration in Master Mode (with NODIV = 0)
1008
Interrupt Sources
1008
Disabling the SAI
1009
Table 180. Interrupt Sources
1009
SAI DMA Interface
1010
SAI Registers
1011
SAI Xconfiguration Register 1 (Sai_Xcr1) Where X Is a or B
1011
SAI Xconfiguration Register 2 (Sai_Xcr2) Where X Is a or B
1014
SAI Xframe Configuration Register (SAI_XFRCR) Where X Is a or B
1016
SAI Xslot Register (Sai_Xslotr) Where X Is a or B
1018
SAI Xinterrupt Mask Register2(Sai_Xim) Where X Is a or B
1019
SAI Xstatus Register (Sai_Xsr) Where X Is a or B
1021
SAI Xclear Flag Register (Sai_Xclrfr) Where X Is a or B
1023
SAI Xdata Register (Sai_Xdr) Where X Is a or B
1024
SAI Register Map
1024
Table 181. SAI Register Map and Reset Values
1024
Secure Digital Input/Output Interface (SDIO)
1026
SDIO Main Features
1026
SDIO Bus Topology
1026
Figure 364. "No Response" and "No Data" Operations
1027
Figure 365. (Multiple) Block Read Operation
1027
Figure 366. (Multiple) Block Write Operation
1027
SDIO Functional Description
1028
Figure 367. Sequential Read Operation
1028
Figure 368. Sequential Write Operation
1028
Figure 369. SDIO Block Diagram
1028
Table 182. SDIO I/O Definitions
1029
SDIO Adapter
1030
Figure 370. SDIO Adapter
1030
Figure 371. Control Unit
1031
Figure 372. SDIO_CK Clock Dephasing (BYPASS = 0)
1031
Figure 373. SDIO Adapter Command Path
1032
Figure 374. Command Path State Machine (SDIO)
1033
Table 183. Command Format
1034
Figure 375. SDIO Command Transfer
1034
Table 184. Short Response Format
1035
Table 185. Long Response Format
1035
Table 186. Command Path Status Flags
1035
Figure 376. Data Path
1036
Figure 377. Data Path State Machine (DPSM)
1037
Table 187. Data Token Format
1038
Table 188. DPSM Flags
1039
Table 189. Transmit FIFO Status Flags
1040
Table 190. Receive FIFO Status Flags
1040
SDIO APB2 Interface
1041
Card Functional Description
1042
Card Identification Mode
1042
Card Reset
1043
Operating Voltage Range Validation
1043
Card Identification Process
1043
Block Write
1044
Block Read
1045
Stream Access, Stream Write and Stream Read (Multimediacard Only)
1045
Erase: Group Erase and Sector Erase
1047
Wide Bus Selection or Deselection
1047
Protection Management
1047
Card Status Register
1051
Table 191. Card Status
1051
SD Status Register
1054
Table 192. SD Status
1054
Table 193. Speed Class Code Field
1055
Table 194. Performance Move Field
1056
Table 195. AU_SIZE Field
1056
Table 196. Maximum AU Size
1056
Table 197. Erase Size Field
1057
Table 198. Erase Timeout Field
1057
Table 199. Erase Offset Field
1057
SD I/O Mode
1058
Commands and Responses
1059
Table 200. Block-Oriented Write Commands
1060
Table 201. Block-Oriented Write Protection Commands
1061
Table 202. Erase Commands
1061
Table 203. I/O Mode Commands
1061
Response Formats
1062
Table 204. Lock Card
1062
Table 205. Application-Specific Commands
1062
R1 (Normal Response Command)
1063
R1B
1063
R2 (CID, CSD Register)
1063
Table 206. R1 Response
1063
Table 207. R2 Response
1063
R3 (OCR Register)
1064
R4 (Fast I/O)
1064
R4B
1064
Table 208. R3 Response
1064
Table 209. R4 Response
1064
Table 210. R4B Response
1064
R5 (Interrupt Request)
1065
Table 211. R5 Response
1065
SDIO I/O Card-Specific Operations
1066
SDIO I/O Read Wait Operation by SDIO_D2 Signalling
1066
Table 212. R6 Response
1066
SDIO Read Wait Operation by Stopping SDIO_CK
1067
SDIO Suspend/Resume Operation
1067
SDIO Interrupts
1067
HW Flow Control
1067
SDIO Registers
1068
SDIO Power Control Register (SDIO_POWER)
1068
SDIO Clock Control Register (SDIO_CLKCR)
1068
SDIO Argument Register (SDIO_ARG)
1070
SDIO Command Register (SDIO_CMD)
1070
SDIO Command Response Register (SDIO_RESPCMD)
1071
SDIO Response 1
1071
SDIO Data Timer Register (SDIO_DTIMER)
1072
Table 213. Response Type and Sdio_Respx Registers
1072
SDIO Data Length Register (SDIO_DLEN)
1073
SDIO Data Control Register (SDIO_DCTRL)
1073
SDIO Data Counter Register (SDIO_DCOUNT)
1076
SDIO Status Register (SDIO_STA)
1076
SDIO Interrupt Clear Register (SDIO_ICR)
1077
SDIO Mask Register (SDIO_MASK)
1079
SDIO FIFO Counter Register (SDIO_FIFOCNT)
1081
SDIO Data FIFO Register (SDIO_FIFO)
1082
SDIO Register Map
1083
Table 214. SDIO Register Map
1083
Controller Area Network (Bxcan)
1085
Introduction
1085
Bxcan Main Features
1085
Bxcan General Description
1086
CAN 2.0B Active Core
1086
Table 215. CAN Implementation
1086
Figure 378. CAN Network Topology
1086
Control, Status and Configuration Registers
1087
Tx Mailboxes
1087
Acceptance Filters
1087
Figure 379. Dual-CAN Block Diagram
1088
Bxcan Operating Modes
1089
Initialization Mode
1089
Figure 380. Single-CAN Block Diagram
1089
Normal Mode
1090
Sleep Mode (Low-Power)
1090
Test Mode
1091
Silent Mode
1091
Figure 381. Bxcan Operating Modes
1091
Loop Back Mode
1092
Loop Back Combined with Silent Mode
1092
Figure 382. Bxcan in Silent Mode
1092
Figure 383. Bxcan in Loop Back Mode
1092
Behavior in Debug Mode
1093
Bxcan Functional Description
1093
Transmission Handling
1093
Figure 384. Bxcan in Combined Mode
1093
Figure 385. Transmit Mailbox States
1094
Time Triggered Communication Mode
1095
Reception Handling
1095
Figure 386. Receive FIFO States
1095
Identifier Filtering
1096
Figure 387. Filter Bank Scale Configuration - Register Organization
1098
Figure 388. Example of Filter Numbering
1099
Message Storage
1100
Figure 389. Filtering Mechanism - Example
1100
Table 216. Transmit Mailbox Mapping
1101
Table 217. Receive Mailbox Mapping
1101
Figure 390. CAN Error State Diagram
1101
Error Management
1102
Bit Timing
1102
Figure 391. Bit Timing
1103
Figure 392. CAN Frames
1104
Bxcan Interrupts
1105
Figure 393. Event Flags and Interrupt Generation
1105
CAN Registers
1106
Register Access Protection
1106
CAN Control and Status Registers
1106
CAN Mailbox Registers
1116
Figure 394. CAN Mailbox Registers
1117
CAN Filter Registers
1123
Bxcan Register Map
1127
Table 218. Bxcan Register Map and Reset Values
1127
USB On-The-Go Full-Speed (OTG_FS)
1131
Introduction
1131
Table 219. OTG_FS Speeds Supported
1131
OTG Main Features
1132
General Features
1132
Host-Mode Features
1133
Peripheral-Mode Features
1133
Split Rail for USB
1133
OTG Implementation
1134
Table 220. OTG Implementation
1134
OTG Functional Description
1135
OTG Block Diagram
1135
USB OTG Pin and Internal Signals
1135
Table 221. OTG_FS Input/Output Pins
1135
Figure 395. OTG Full-Speed Block Diagram
1135
OTG Core
1136
Full-Speed OTG PHY
1136
Table 222. OTG_FS Input/Output Signals
1136
OTG Dual Role Device (DRD)
1137
ID Line Detection
1137
Figure 396. OTG_FS A-B Device Connection
1137
HNP Dual Role Device
1138
SRP Dual Role Device
1138
USB Peripheral
1138
SRP-Capable Peripheral
1139
Peripheral States
1139
Figure 397. USB_FS Peripheral-Only Connection
1139
Peripheral Endpoints
1140
USB Host
1142
SRP-Capable Host
1143
USB Host States
1143
Figure 398. USB_FS Host-Only Connection
1143
Host Channels
1145
Host Scheduler
1146
SOF Trigger
1147
Host Sofs
1147
Peripheral Sofs
1147
Figure 399. SOF Connectivity (SOF Trigger Output to TIM and ITR1 Connection)
1147
OTG Low-Power Modes
1148
Table 223. Compatibility of STM32 Low Power Modes with the OTG
1148
Dynamic Update of the OTG_HFIR Register
1149
USB Data Fifos
1149
Figure 400. Updating OTG_HFIR Dynamically (RLDCTRL = 0)
1149
Peripheral FIFO Architecture
1150
Figure 401. Device-Mode FIFO Address Mapping and AHB FIFO Access Mapping
1150
Host FIFO Architecture
1151
Figure 402. Host-Mode FIFO Address Mapping and AHB FIFO Access Mapping
1151
FIFO RAM Allocation
1152
OTG_FS System Performance
1154
OTG_FS Interrupts
1154
Figure 403. Interrupt Hierarchy
1155
OTG_FS Control and Status Registers
1156
CSR Memory Map
1156
Table 224. Core Global Control and Status Registers (Csrs)
1156
Table 225. Host-Mode Control and Status Registers (Csrs)
1157
Table 226. Device-Mode Control and Status Registers
1158
OTG_FS Registers
1160
Table 227. Data FIFO (DFIFO) Access Register Map
1160
Table 228. Power and Clock Gating Control and Status Registers
1160
OTG Control and Status Register (OTG_GOTGCTL)
1161
OTG Interrupt Register (OTG_GOTGINT)
1164
OTG AHB Configuration Register (OTG_GAHBCFG)
1165
OTG USB Configuration Register (OTG_GUSBCFG)
1166
OTG Reset Register (OTG_GRSTCTL)
1168
Table 229. TRDT Values (FS)
1168
OTG Core Interrupt Register (OTG_GINTSTS)
1171
OTG Interrupt Mask Register (OTG_GINTMSK)
1175
OTG Receive Status Debug Read/Otg Status Read and Pop Registers (OTG_GRXSTSR/OTG_GRXSTSP)
1178
OTG Receive FIFO Size Register (OTG_GRXFSIZ)
1180
OTG Host Non-Periodic Transmit FIFO Size Register (Otg_Hnptxfsiz)/Endpoint 0 Transmit FIFO Size
1180
(Otg_Dieptxf0)
1180
33.15.11 OTG Non-Periodic Transmit Fifo/Queue Status Register
1181
(Otg_Hnptxsts)
1181
OTG General Core Configuration Register (OTG_GCCFG)
1182
OTG Core ID Register (OTG_CID)
1184
OTG Core LPM Configuration Register (OTG_GLPMCFG)
1184
33.15.15 OTG Host Periodic Transmit FIFO Size Register
1188
(Otg_Hptxfsiz)
1188
OTG Device in Endpoint Transmit FIFO Size Register (Otg_Dieptxfx)
1188
FIFO Number)
1188
33.15.17 Host-Mode Registers
1189
OTG Host Configuration Register (OTG_HCFG)
1189
OTG Host Frame Interval Register (OTG_HFIR)
1190
33.15.20 OTG Host Frame Number/Frame Time Remaining Register
1191
(Otg_Hfnum)
1191
33.15.21 Otg_Host Periodic Transmit Fifo/Queue Status Register
1191
(Otg_Hptxsts)
1191
OTG Host All Channels Interrupt Register (OTG_HAINT)
1192
(Otg_Haintmsk)
1193
OTG Host Port Control and Status Register (OTG_HPRT)
1194
OTG Host Channel X Characteristics Register (Otg_Hccharx)
1196
(X = 0
1196
OTG Host Channel X Interrupt Register (Otg_Hcintx)
1197
(X = 0
1197
OTG Host Channel X Interrupt Mask Register (Otg_Hcintmskx)
1198
(X = 0
1198
OTG Host Channel X Transfer Size Register (Otg_Hctsizx)
1199
(X = 0
1199
33.15.29 Device-Mode Registers
1200
OTG Device Configuration Register (OTG_DCFG)
1200
OTG Device Control Register (OTG_DCTL)
1201
Table 230. Minimum Duration for Soft Disconnect
1203
OTG Device Status Register (OTG_DSTS)
1204
33.15.33 OTG Device in Endpoint Common Interrupt Mask Register
1205
(Otg_Diepmsk)
1205
33.15.34 OTG Device out Endpoint Common Interrupt Mask Register
1206
(Otg_Doepmsk)
1206
OTG Device All Endpoints Interrupt Register (OTG_DAINT)
1207
33.15.36 OTG All Endpoints Interrupt Mask Register
1208
(Otg_Daintmsk)
1208
OTG Device
1208
(Otg_Dvbusdis)
1208
BUS Discharge Time Register
1209
OTG Device
1209
(Otg_Dvbuspulse)
1209
BUS Pulsing Time Register
1209
33.15.39 OTG Device in Endpoint FIFO Empty Interrupt Mask Register
1209
(Otg_Diepempmsk)
1209
33.15.40 OTG Device Control in Endpoint 0 Control Register
1210
(Otg_Diepctl0)
1210
OTG Device in Endpoint X Control Register (Otg_Diepctlx)
1211
(X = 1
1211
OTG Device in Endpoint X Interrupt Register (Otg_Diepintx)
1214
(X = 0
1214
33.15.43 OTG Device in Endpoint 0 Transfer Size Register
1215
(Otg_Dieptsiz0)
1215
OTG Device in Endpoint Transmit FIFO Status Register (Otg_Dtxfstsx)
1216
Endpoint Number)
1216
OTG Device in Endpoint X Transfer Size Register (Otg_Dieptsizx)
1217
(X = 1
1217
33.15.46 OTG Device Control out Endpoint 0 Control Register
1218
(Otg_Doepctl0)
1218
OTG Device out Endpoint X Interrupt Register (Otg_Doepintx)
1219
(X = 0
1219
33.15.48 OTG Device out Endpoint 0 Transfer Size Register
1221
(Otg_Doeptsiz0)
1221
OTG Device out Endpoint X Control Register (Otg_Doepctlx)
1222
(X = 1
1222
OTG Device out Endpoint X Transfer Size Register (Otg_Doeptsizx) (X = 1
1224
OTG Power and Clock Gating Control Register (OTG_PCGCCTL)
1225
33.15.52 OTG_FS Register Map
1226
Table 231. OTG_FS Register Map and Reset Values
1226
OTG_FS Programming Model
1234
Core Initialization
1234
Host Initialization
1234
Device Initialization
1235
Host Programming Model
1236
Figure 404. Transmit FIFO Write Task
1237
Figure 405. Receive FIFO Read Task
1238
Figure 406. Normal Bulk/Control OUT/SETUP
1239
Figure 407. Bulk/Control in Transactions
1243
Figure 408. Normal Interrupt out
1246
Figure 409. Normal Interrupt in
1251
Figure 410. Isochronous out Transactions
1253
Figure 411. Isochronous in Transactions
1256
Device Programming Model
1257
Figure 412. Receive FIFO Packet Read
1260
Figure 413. Processing a SETUP Packet
1262
Figure 414. Bulk out Transaction
1269
Worst Case Response Time
1276
Figure 415. TRDT Max Timing Case
1277
OTG Programming Model
1278
Figure 416. A-Device SRP
1278
Figure 417. B-Device SRP
1279
Figure 418. A-Device HNP
1280
Figure 419. B-Device HNP
1282
Debug Support (DBG)
1284
Overview
1284
Figure 420. Block Diagram of STM32 MCU and Cortex ® -M4 with FPU-Level
1284
Reference Arm® Documentation
1285
SWJ Debug Port (Serial Wire and JTAG)
1285
Mechanism to Select the JTAG-DP or the SW-DP
1286
Pinout and Debug Port Pins
1286
Figure 421. SWJ Debug Port
1286
SWJ Debug Port Pins
1287
Flexible SWJ-DP Pin Assignment
1287
Table 232. SWJ Debug Port Pins
1287
Table 233. Flexible SWJ-DP Pin Assignment
1287
Internal Pull-Up and Pull-Down on JTAG Pins
1288
Using Serial Wire and Releasing the Unused Debug Pins as Gpios
1289
JTAG TAP Connection
1289
Figure 422. JTAG TAP Connections
1290
ID Codes and Locking Mechanism
1291
MCU Device ID Code
1291
Boundary Scan TAP
1291
Cortex ® -M4 with FPU TAP
1291
Cortex ® -M4 with FPU JEDEC-106 ID Code
1292
JTAG Debug Port
1292
Table 234. JTAG Debug Port Data Registers
1292
Table 235. 32-Bit Debug Port Registers Addressed through the Shifted Value A[3:2]
1293
SW Debug Port
1294
SW Protocol Introduction
1294
SW Protocol Sequence
1294
Table 236. Packet Request (8-Bits)
1294
SW-DP State Machine (Reset, Idle States, ID Code)
1295
DP and AP Read/Write Accesses
1295
Table 237. ACK Response (3 Bits)
1295
Table 238. DATA Transfer (33 Bits)
1295
SW-DP Registers
1296
Table 239. SW-DP Registers
1296
SW-AP Registers
1297
AHB-AP (AHB Access Port) - Valid for both JTAG-DP and SW-DP
1297
Table 240. Cortex ® -M4 with FPU AHB-AP Registers
1297
Core Debug
1298
Table 241. Core Debug Registers
1298
Capability of the Debugger Host to Connect under System Reset
1299
FPB (Flash Patch Breakpoint)
1299
DWT (Data Watchpoint Trigger)
1300
ITM (Instrumentation Trace Macrocell)
1300
General Description
1300
Time Stamp Packets, Synchronization and Overflow Packets
1300
Table 242. Main ITM Registers
1301
ETM (Embedded Trace Macrocell)
1302
General Description
1302
Signal Protocol, Packet Types
1302
Main ETM Registers
1302
Configuration Example
1303
MCU Debug Component (DBGMCU)
1303
Debug Support for Low-Power Modes
1303
Table 243. Main ETM Registers
1303
Debug Support for Timers, Watchdog, Bxcan and I C
1304
Debug MCU Configuration Register
1304
Debug MCU APB1 Freeze Register (DBGMCU_APB1_FZ)
1305
Debug MCU APB2 Freeze Register (DBGMCU_APB2_FZ)
1307
TPIU (Trace Port Interface Unit)
1307
Introduction
1307
Figure 423. TPIU Block Diagram
1308
TRACE Pin Assignment
1309
Table 244. Asynchronous TRACE Pin Assignment
1309
Table 245. Synchronous TRACE Pin Assignment
1309
TPUI Formatter
1310
Table 246. Flexible TRACE Pin Assignment
1310
TPUI Frame Synchronization Packets
1311
Transmission of the Synchronization Frame Packet
1311
Synchronous Mode
1311
Asynchronous Mode
1312
TRACECLKIN Connection
1312
TPIU Registers
1312
Table 247. Important TPIU Registers
1312
34.17.10 Example of Configuration
1313
DBG Register Map
1314
Table 248. DBG Register Map and Reset Values
1314
Device Electronic Signature
1315
Unique Device ID Register (96 Bits)
1315
Flash Size
1316
Package Data Register
1316
Revision History
1318
Table 249. Document Revision History
1318
Advertisement
Advertisement
Related Products
ST STM32F413 Series
ST STM32F413ZH
ST STM32F413RG
ST STM32F413CG
ST STM32F413MH
ST STM32F413ZGT6
ST STM32F413RH
ST STM32F413VH
ST STM32F413MG
ST STM32F412RET6
ST Categories
Motherboard
Computer Hardware
Microcontrollers
Control Unit
Controller
More ST Manuals
Login
Sign In
OR
Sign in with Facebook
Sign in with Google
Upload manual
Upload from disk
Upload from URL