Home
ST
Computer Hardware
STM32F101 series
ST STM32F101 series Reference Manual
5
of 1
of 1 rating
1128 pages
Give review
Manual
Specs
To Next Page
To Next Page
To Previous Page
To Previous Page
Loading...
Memory and bus architect
ure
RM0008
63/1
128
DocID1
3902 Rev 15
The USART peripheral operates with the internal 8
MHz
oscillator (HSI). The CAN and
USB OTG FS, h
owever
, can only
function
if an external 8
MHz, 14.7456
MHz or
25
MHz clock (HSE) is present.
Note:
For fu
rther de
tails,
please refer to AN2
606.
62
64
Table of Contents
Default Chapter
2
Table of Contents
2
Overview of the Manual
40
Table 1. Sections Related to each Stm32F10Xxx Product
40
Table 2. Sections Related to each Peripheral
43
Documentation Conventions
47
List of Abbreviations for Registers
47
Glossary
47
Peripheral Availability
47
Memory and Bus Architecture
48
System Architecture
48
Figure 1. System Architecture (Low-, Medium-, XL-Density Devices)
48
Figure 2. System Architecture in Connectivity Line Devices
49
Memory Organization
50
Memory Map
51
Table 3. Register Boundary Addresses
51
Bit Banding
54
Embedded SRAM
54
Embedded Flash Memory
55
Table 4. Flash Module Organization (Low-Density Devices)
55
Table 5. Flash Module Organization (Medium-Density Devices)
56
Table 6. Flash Module Organization (High-Density Devices)
57
Table 7. Flash Module Organization (Connectivity Line Devices)
57
Table 8. XL-Density Flash Module Organization
58
Boot Configuration
61
Table 9. Boot Modes
61
CRC Calculation Unit
64
CRC Introduction
64
CRC Main Features
64
Figure 3. CRC Calculation Unit Block Diagram
64
CRC Functional Description
65
CRC Registers
65
Data Register (CRC_DR)
65
Independent Data Register (CRC_IDR)
65
Control Register (CRC_CR)
66
CRC Register Map
66
Table 10. CRC Calculation Unit Register Map and Reset Values
66
Power Control (PWR)
67
Power Supplies
67
Independent A/D and D/A Converter Supply and Reference Voltage
68
Figure 4. Power Supply Overview
68
Battery Backup Domain
69
Voltage Regulator
70
Power Supply Supervisor
70
Power on Reset (Por)/Power down Reset (PDR)
70
Programmable Voltage Detector (PVD)
70
Figure 5. Power on Reset/Power down Reset Waveform
70
Figure 6. PVD Thresholds
71
Low-Power Modes
72
Slowing down System Clocks
72
Table 11. Low-Power Mode Summary
72
Peripheral Clock Gating
73
Sleep Mode
73
Stop Mode
74
Table 12. Sleep-Now
74
Table 13. Sleep-On-Exit
74
Table 14. Stop Mode
75
Standby Mode
76
Table 15. Standby Mode
76
Auto-Wakeup (AWU) from Low-Power Mode
77
Power Control Registers
77
Power Control Register (PWR_CR)
77
Power Control/Status Register (PWR_CSR)
79
PWR Register Map
80
Table 16. PWR Register Map and Reset Values
80
Backup Registers (BKP)
81
BKP Introduction
81
BKP Main Features
81
BKP Functional Description
82
Tamper Detection
82
RTC Calibration
82
BKP Registers
83
Backup Data Register X (Bkp_Drx) (X = 1
83
RTC Clock Calibration Register (BKP_RTCCR)
83
Backup Control Register (BKP_CR)
84
Backup Control/Status Register (BKP_CSR)
84
BKP Register Map
85
Table 17. BKP Register Map and Reset Values
85
Low-, Medium-, High- and XL-Density Reset and Clock Control (RCC)
90
Reset
90
System Reset
90
Power Reset
91
Figure 7. Simplified Diagram of the Reset Circuit
91
Backup Domain Reset
92
Clocks
92
Figure 8. Clock Tree
93
Figure 9. HSE/ LSE Clock Sources
94
HSE Clock
94
HSI Clock
95
Pll
96
LSE Clock
96
LSI Clock
96
System Clock (SYSCLK) Selection
97
Clock Security System (CSS)
97
RTC Clock
98
Watchdog Clock
98
Clock-Out Capability
98
RCC Registers
99
Clock Control Register (RCC_CR)
99
Clock Configuration Register (RCC_CFGR)
101
Clock Interrupt Register (RCC_CIR)
104
APB2 Peripheral Reset Register (RCC_APB2RSTR)
106
APB1 Peripheral Reset Register (RCC_APB1RSTR)
109
AHB Peripheral Clock Enable Register (RCC_AHBENR)
111
APB2 Peripheral Clock Enable Register (RCC_APB2ENR)
112
APB1 Peripheral Clock Enable Register (RCC_APB1ENR)
115
Backup Domain Control Register (RCC_BDCR)
118
Control/Status Register (RCC_CSR)
119
RCC Register Map
121
Table 18. RCC Register Map and Reset Values
121
Connectivity Line Devices: Reset and Clock Control (RCC)
123
Reset
123
System Reset
123
Power Reset
124
Figure 10. Simplified Diagram of the Reset Circuit
124
Backup Domain Reset
125
Clocks
125
Figure 11. Clock Tree
126
HSE Clock
127
Figure 12. HSE/ LSE Clock Sources
128
HSI Clock
128
LSE Clock
129
Plls
129
LSI Clock
130
System Clock (SYSCLK) Selection
130
Clock Security System (CSS)
131
RTC Clock
131
Watchdog Clock
131
Clock-Out Capability
132
RCC Registers
132
Clock Control Register (RCC_CR)
132
Clock Configuration Register (RCC_CFGR)
134
Clock Interrupt Register (RCC_CIR)
137
APB2 Peripheral Reset Register (RCC_APB2RSTR)
141
APB1 Peripheral Reset Register (RCC_APB1RSTR)
142
AHB Peripheral Clock Enable Register (RCC_AHBENR)
145
APB2 Peripheral Clock Enable Register (RCC_APB2ENR)
146
APB1 Peripheral Clock Enable Register (RCC_APB1ENR)
148
Backup Domain Control Register (RCC_BDCR)
150
Control/Status Register (RCC_CSR)
152
AHB Peripheral Clock Reset Register (RCC_AHBRSTR)
153
Clock Configuration Register2 (RCC_CFGR2)
154
RCC Register Map
156
Table 19. RCC Register Map and Reset Values
156
General-Purpose and Alternate-Function I/Os (Gpios and Afios)
159
GPIO Functional Description
159
Figure 13. Basic Structure of a Standard I/O Port Bit
160
Figure 14. Basic Structure of a Five-Volt Tolerant I/O Port Bit
160
Atomic Bit Set or Reset
161
General-Purpose I/O (GPIO)
161
Table 20. Port Bit Configuration Table
161
Table 21. Output MODE Bits
161
Alternate Functions (AF)
162
External Interrupt/Wakeup Lines
162
GPIO Locking Mechanism
162
Software Remapping of I/O Alternate Functions
162
Figure 15. Input Floating/Pull Up/Pull down Configurations
163
Input Configuration
163
Figure 16. Output Configuration
164
Output Configuration
164
Alternate Function Configuration
165
Figure 17. Alternate Function Configuration
165
Analog Configuration
166
Figure 18. High Impedance-Analog Configuration
166
GPIO Configurations for Device Peripherals
166
Table 22. Advanced Timers TIM1/TIM8
166
Table 23. General-Purpose Timers TIM2/3/4/5
167
Table 24. Usarts
167
Table 25. SPI
167
Table 26. I2S
168
Table 27. I2C
168
Table 28. Bxcan
168
Table 29. USB
168
Table 30. OTG_FS Pin Configuration
168
Figure 19. ADC / DAC
169
Table 31. SDIO
169
Table 32. FSMC
169
Table 33. Other Ios
170
GPIO Registers
171
Port Configuration Register Low (Gpiox_Crl) (X=A..g
171
Port Configuration Register High (Gpiox_Crh) (X=A..g
172
Port Input Data Register (Gpiox_Idr) (X=A..g
172
Port Output Data Register (Gpiox_Odr) (X=A
173
Port Bit Set/Reset Register (Gpiox_Bsrr) (X=A
173
Port Bit Reset Register (Gpiox_Brr) (X=A
174
Port Configuration Lock Register (Gpiox_Lckr) (X=A
174
Alternate Function I/O and Debug Configuration (AFIO)
175
Using OSC32_IN/OSC32_OUT Pins as GPIO Ports PC14/PC15
175
Using OSC_IN/OSC_OUT Pins as GPIO Ports PD0/PD1
175
CAN1 Alternate Function Remapping
176
CAN2 Alternate Function Remapping
176
JTAG/SWD Alternate Function Remapping
176
Table 34. CAN1 Alternate Function Remapping
176
Table 35. CAN2 Alternate Function Remapping
176
Table 36. Debug Interface Signals
176
ADC Alternate Function Remapping
177
Table 37. Debug Port Mapping
177
Table 38. ADC1 External Trigger Injected Conversion Alternate Function Remapping
177
Table 39. ADC1 External Trigger Regular Conversion Alternate Function Remapping
177
Table 40. ADC2 External Trigger Injected Conversion Alternate Function Remapping
177
Timer Alternate Function Remapping
178
Table 41. ADC2 External Trigger Regular Conversion Alternate Function Remapping
178
Table 42. TIM5 Alternate Function Remapping
178
Table 43. TIM4 Alternate Function Remapping
178
Table 44. TIM3 Alternate Function Remapping
178
Table 45. TIM2 Alternate Function Remapping
179
Table 46. TIM1 Alternate Function Remapping
179
Table 47. TIM9 Remapping
179
Table 48. TIM10 Remapping
179
USART Alternate Function Remapping
180
Table 49. TIM11 Remapping
180
Table 50. TIM13 Remapping
180
Table 51. TIM14 Remapping
180
Table 52. USART3 Remapping
180
Table 53. USART2 Remapping
180
I2C1 Alternate Function Remapping
181
SPI1 Alternate Function Remapping
181
SPI3/I2S3 Alternate Function Remapping
181
Ethernet Alternate Function Remapping
181
Table 54. USART1 Remapping
181
Table 55. I2C1 Remapping
181
Table 56. SPI1 Remapping
181
Table 57. SPI3/I2S3 Remapping
181
Table 58. ETH Remapping
182
AFIO Registers
183
Event Control Register (AFIO_EVCR)
183
AF Remap and Debug I/O Configuration Register (AFIO_MAPR)
184
External Interrupt Configuration Register 1 (AFIO_EXTICR1)
191
External Interrupt Configuration Register 2 (AFIO_EXTICR2)
191
External Interrupt Configuration Register 3 (AFIO_EXTICR3)
192
External Interrupt Configuration Register 4 (AFIO_EXTICR4)
192
AF Remap and Debug I/O Configuration Register2 (AFIO_MAPR2)
193
GPIO and AFIO Register Maps
194
Table 59. GPIO Register Map and Reset Values
194
Table 60. AFIO Register Map and Reset Values
194
Interrupts and Events
196
Nested Vectored Interrupt Controller (NVIC)
196
Systick Calibration Value Register
196
Interrupt and Exception Vectors
197
Table 61. Vector Table for Connectivity Line Devices
197
Table 62. Vector Table for XL-Density Devices
200
Table 63. Vector Table for Other Stm32F10Xxx Devices
203
External Interrupt/Event Controller (EXTI)
205
Main Features
206
Block Diagram
206
Wakeup Event Management
206
Figure 20. External Interrupt/Event Controller Block Diagram
206
Functional Description
207
External Interrupt/Event Line Mapping
208
Figure 21. External Interrupt/Event GPIO Mapping
208
EXTI Registers
210
Interrupt Mask Register (EXTI_IMR)
210
Event Mask Register (EXTI_EMR)
210
Rising Trigger Selection Register (EXTI_RTSR)
211
Falling Trigger Selection Register (EXTI_FTSR)
211
Software Interrupt Event Register (EXTI_SWIER)
212
Pending Register (EXTI_PR)
212
EXTI Register Map
213
Table 64. External Interrupt/Event Controller Register Map and Reset Values
213
Analog-To-Digital Converter (ADC)
214
ADC Introduction
214
ADC Main Features
215
ADC Functional Description
215
Figure 22. Single ADC Block Diagram
216
Table 65. ADC Pins
217
ADC Clock
218
ADC On-Off Control
218
Channel Selection
218
Single Conversion Mode
218
Continuous Conversion Mode
219
Figure 23. Timing Diagram
219
Timing Diagram
219
Analog Watchdog
220
Figure 24. Analog Watchdog Guarded Area
220
Scan Mode
220
Table 66. Analog Watchdog Channel Selection
220
Figure 25. Injected Conversion Latency
221
Injected Channel Management
221
Discontinuous Mode
222
Calibration
222
Data Alignment
223
Figure 26. Calibration Timing Diagram
223
Figure 27. Right Alignment of Data
223
Figure 28. Left Alignment of Data
223
Channel-By-Channel Programmable Sample Time
224
Conversion on External Trigger
224
Table 67. External Trigger for Regular Channels for ADC1 and ADC2
224
Table 68. External Trigger for Injected Channels for ADC1 and ADC2
225
Table 69. External Trigger for Regular Channels for ADC3
225
Table 70. External Trigger for Injected Channels for ADC3
225
DMA Request
226
Dual ADC Mode
227
Figure 29. Dual ADC Block Diagram
228
Figure 30. Injected Simultaneous Mode on 4 Channels
229
Injected Simultaneous Mode
229
Regular Simultaneous Mode
229
Fast Interleaved Mode
230
Figure 31. Regular Simultaneous Mode on 16 Channels
230
Figure 32. Fast Interleaved Mode on 1 Channel in Continuous Conversion Mode
230
Slow Interleaved Mode
230
Alternate Trigger Mode
231
Figure 33. Slow Interleaved Mode on 1 Channel
231
Figure 34. Alternate Trigger: Injected Channel Group of each ADC
231
Combined Regular Simultaneous + Alternate Trigger Mode
232
Combined Regular/Injected Simultaneous Mode
232
Figure 35. Alternate Trigger: 4 Injected Channels (each ADC) in Discontinuous Model
232
Independent Mode
232
Combined Injected Simultaneous + Interleaved
233
Figure 36. Alternate + Regular Simultaneous
233
Figure 37. Case of Trigger Occurring During Injected Conversion
233
Figure 38. Interleaved Single Channel with Injected Sequence CH11, CH12
233
Temperature Sensor
234
Figure 39. Temperature Sensor and VREFINT Channel Block Diagram
234
ADC Interrupts
235
Table 71. ADC Interrupts
235
ADC Registers
236
ADC Status Register (ADC_SR)
236
ADC Control Register 1 (ADC_CR1)
237
ADC Control Register 2 (ADC_CR2)
239
ADC Sample Time Register 1 (ADC_SMPR1)
243
ADC Sample Time Register 2 (ADC_SMPR2)
244
ADC Injected Channel Data Offset Register X (Adc_Jofrx)(X=1
244
ADC Watchdog High Threshold Register (ADC_HTR)
245
ADC Watchdog Low Threshold Register (ADC_LTR)
245
ADC Regular Sequence Register 1 (ADC_SQR1)
246
ADC Regular Sequence Register 2 (ADC_SQR2)
247
ADC Regular Sequence Register 3 (ADC_SQR3)
248
ADC Injected Sequence Register (ADC_JSQR)
249
ADC Injected Data Register X (Adc_Jdrx) (X= 1
250
ADC Regular Data Register (ADC_DR)
250
11.12.15 ADC Register Map
251
Table 72. ADC Register Map and Reset Values
251
Digital-To-Analog Converter (DAC)
253
DAC Introduction
253
DAC Main Features
253
Table 73. DAC Pins
254
Figure 40. DAC Channel Block Diagram
254
DAC Functional Description
255
DAC Channel Enable
255
DAC Output Buffer Enable
255
DAC Data Format
255
DAC Conversion
256
Figure 41. Data Registers in Single DAC Channel Mode
256
Figure 42. Data Registers in Dual DAC Channel Mode
256
DAC Output Voltage
257
DAC Trigger Selection
257
Table 74. External Triggers
257
Figure 43. Timing Diagram for Conversion with Trigger Disabled TEN = 0
257
DMA Request
258
Noise Generation
258
Figure 44. DAC LFSR Register Calculation Algorithm
258
Triangle-Wave Generation
259
Figure 45. DAC Conversion (SW Trigger Enabled) with LFSR Wave Generation
259
Figure 46. DAC Triangle Wave Generation
259
Dual DAC Channel Conversion
260
Independent Trigger Without Wave Generation
260
Figure 47. DAC Conversion (SW Trigger Enabled) with Triangle Wave Generation
260
Independent Trigger with same LFSR Generation
261
Independent Trigger with Different LFSR Generation
261
Independent Trigger with same Triangle Generation
261
Independent Trigger with Different Triangle Generation
262
Simultaneous Software Start
262
Simultaneous Trigger Without Wave Generation
262
Simultaneous Trigger with same LFSR Generation
263
Simultaneous Trigger with Different LFSR Generation
263
Simultaneous Trigger with same Triangle Generation
263
Simultaneous Trigger with Different Triangle Generation
264
DAC Registers
264
DAC Control Register (DAC_CR)
264
DAC Software Trigger Register (DAC_SWTRIGR)
267
DAC Channel1 12-Bit Right-Aligned Data Holding Register
268
(Dac_Dhr12R1)
268
DAC Channel1 12-Bit Left Aligned Data Holding Register
268
(Dac_Dhr12L1)
268
DAC Channel1 8-Bit Right Aligned Data Holding Register
268
(Dac_Dhr8R1)
268
DAC Channel2 12-Bit Right Aligned Data Holding Register
269
(Dac_Dhr12R2)
269
DAC Channel2 12-Bit Left Aligned Data Holding Register
269
(Dac_Dhr12L2)
269
DAC Channel2 8-Bit Right-Aligned Data Holding Register
269
(Dac_Dhr8R2)
269
Dual DAC 12-Bit Right-Aligned Data Holding Register (DAC_DHR12RD)
270
DUAL DAC 12-Bit Left Aligned Data Holding Register
270
(Dac_Dhr12Ld)
270
DUAL DAC 8-Bit Right Aligned Data Holding Register
271
(Dac_Dhr8Rd)
271
DAC Channel1 Data Output Register (DAC_DOR1)
271
DAC Channel2 Data Output Register (DAC_DOR2)
271
DAC Register Map
272
Table 75. DAC Register Map
272
Direct Memory Access Controller (DMA)
273
DMA Introduction
273
DMA Main Features
273
Figure 48. DMA Block Diagram in Connectivity Line Devices
274
DMA Functional Description
275
DMA Transactions
275
Figure 49. DMA Block Diagram in Low-, Medium- High- and XL-Density Devices
275
Arbiter
276
DMA Channels
276
Programmable Data Width, Data Alignment and Endians
278
Table 76. Programmable Data Width & Endian Behavior (When Bits PINC = MINC = 1)
278
Error Management
279
Interrupts
280
DMA Request Mapping
280
Table 77. DMA Interrupt Requests
280
Figure 50. DMA1 Request Mapping
280
Table 78. Summary of DMA1 Requests for each Channel
282
Table 79. Summary of DMA2 Requests for each Channel
283
Figure 51. DMA2 Request Mapping
283
DMA Registers
284
DMA Interrupt Status Register (DMA_ISR)
284
DMA Interrupt Flag Clear Register (DMA
285
DMA Channel X Configuration Register (Dma_Ccrx) (X = 1
286
DMA Channel X Number of Data Register (Dma_Cndtrx) (X = 1
287
DMA Channel X Peripheral Address Register (Dma_Cparx) (X = 1
288
DMA Channel X Memory Address Register (Dma_Cmarx) (X = 1
288
DMA Register Map
289
Table 80. DMA Register Map and Reset Values
289
Advanced-Control Timers (TIM1&TIM8)
292
TIM1&TIM8 Introduction
292
TIM1&TIM8 Main Features
293
Figure 52. Advanced-Control Timer Block Diagram
294
TIM1&TIM8 Functional Description
295
Time-Base Unit
295
Counter Modes
296
Figure 53. Counter Timing Diagram with Prescaler Division Change from 1 to 2
296
Figure 54. Counter Timing Diagram with Prescaler Division Change from 1 to 4
296
Figure 55. Counter Timing Diagram, Internal Clock Divided by 1
297
Figure 56. Counter Timing Diagram, Internal Clock Divided by 2
297
Figure 57. Counter Timing Diagram, Internal Clock Divided by 4
298
Figure 58. Counter Timing Diagram, Internal Clock Divided by N
298
Figure 59. Counter Timing Diagram, Update Event When ARPE=0 (Timx_Arr Not Preloaded)
298
Figure 60. Counter Timing Diagram, Update Event When ARPE=1
299
Figure 61. Counter Timing Diagram, Internal Clock Divided by 1
300
Figure 62. Counter Timing Diagram, Internal Clock Divided by 2
300
Figure 63. Counter Timing Diagram, Internal Clock Divided by 4
300
Figure 64. Counter Timing Diagram, Internal Clock Divided by N
301
Figure 65. Counter Timing Diagram, Update Event When Repetition Counter
301
Figure 66. Counter Timing Diagram, Internal Clock Divided by 1, Timx_Arr = 0X6
302
Figure 67. Counter Timing Diagram, Internal Clock Divided by 2
303
Figure 68. Counter Timing Diagram, Internal Clock Divided by 4, Timx_Arr=0X36
303
Figure 69. Counter Timing Diagram, Internal Clock Divided by N
303
Repetition Counter
304
Figure 70. Counter Timing Diagram, Update Event with ARPE=1 (Counter Underflow)
304
Figure 71. Counter Timing Diagram, Update Event with ARPE=1 (Counter Overflow)
304
Figure 72. Update Rate Examples Depending on Mode and Timx_Rcr Register Settings
305
Clock Selection
306
Figure 73. Control Circuit in Normal Mode, Internal Clock Divided by 1
306
Figure 74. TI2 External Clock Connection Example
306
Figure 75. Control Circuit in External Clock Mode 1
307
Figure 76. External Trigger Input Block
307
Capture/Compare Channels
308
Figure 77. Control Circuit in External Clock Mode 2
308
Figure 78. Capture/Compare Channel (Example: Channel 1 Input Stage)
309
Figure 79. Capture/Compare Channel 1 Main Circuit
309
Input Capture Mode
310
Figure 80. Output Stage of Capture/Compare Channel (Channel 1 to 3)
310
Figure 81. Output Stage of Capture/Compare Channel (Channel 4)
310
PWM Input Mode
311
Forced Output Mode
312
Figure 82. PWM Input Mode Timing
312
Output Compare Mode
313
PWM Mode
314
Figure 83. Output Compare Mode, Toggle on OC1
314
Figure 84. Edge-Aligned PWM Waveforms (ARR=8)
315
Figure 85. Center-Aligned PWM Waveforms (ARR=8)
316
Complementary Outputs and Dead-Time Insertion
317
Figure 86. Complementary Output with Dead-Time Insertion
317
Figure 87. Dead-Time Waveforms with Delay Greater than the Negative Pulse
317
Using the Break Function
318
Figure 88. Dead-Time Waveforms with Delay Greater than the Positive Pulse
318
Figure 89. Output Behavior in Response to a Break
320
Clearing the Ocxref Signal on an External Event
321
Figure 90. Clearing Timx Ocxref
321
6-Step PWM Generation
322
Figure 91. 6-Step Generation, COM Example (OSSR=1)
322
One-Pulse Mode
323
Figure 92. Example of One Pulse Mode
323
Encoder Interface Mode
324
Table 81. Counting Direction Versus Encoder Signals
325
Timer Input XOR Function
326
Figure 93. Example of Counter Operation in Encoder Interface Mode
326
Figure 94. Example of Encoder Interface Mode with TI1FP1 Polarity Inverted
326
Interfacing with Hall Sensors
327
Figure 95. Example of Hall Sensor Interface
328
Timx and External Trigger Synchronization
329
Figure 96. Control Circuit in Reset Mode
329
Figure 97. Control Circuit in Gated Mode
330
Figure 98. Control Circuit in Trigger Mode
331
Timer Synchronization
332
Debug Mode
332
Figure 99. Control Circuit in External Clock Mode 2 + Trigger Mode
332
TIM1&TIM8 Registers
333
TIM1&TIM8 Control Register 1 (Timx_Cr1)
333
TIM1&TIM8 Control Register 2 (Timx_Cr2)
334
TIM1&TIM8 Slave Mode Control Register (Timx_Smcr)
337
TIM1&TIM8 Dma/Interrupt Enable Register (Timx_Dier)
339
Table 82. Timx Internal Trigger Connection
339
TIM1&TIM8 Status Register (Timx_Sr)
341
TIM1&TIM8 Event Generation Register (Timx_Egr)
342
TIM1&TIM8 Capture/Compare Mode Register 1 (Timx_Ccmr1)
344
TIM1&TIM8 Capture/Compare Mode Register 2 (Timx_Ccmr2)
347
TIM1&TIM8 Capture/Compare Enable Register (Timx_Ccer)
348
Table 83. Output Control Bits for Complementary Ocx and Ocxn Channels with
350
Break Feature
350
TIM1&TIM8 Counter (Timx_Cnt)
351
TIM1&TIM8 Prescaler (Timx_Psc)
351
TIM1&TIM8 Auto-Reload Register (Timx_Arr)
351
TIM1&TIM8 Repetition Counter Register (Timx_Rcr)
352
TIM1&TIM8 Capture/Compare Register 1 (Timx_Ccr1)
352
TIM1&TIM8 Capture/Compare Register 2 (Timx_Ccr2)
353
TIM1&TIM8 Capture/Compare Register 3 (Timx_Ccr3)
353
TIM1&TIM8 Capture/Compare Register 4 (Timx_Ccr4)
354
TIM1&TIM8 Break and Dead-Time Register (Timx_Bdtr)
354
TIM1&TIM8 DMA Control Register (Timx_Dcr)
356
TIM1&TIM8 DMA Address for Full Transfer (Timx_Dmar)
357
TIM1&TIM8 Register Map
358
Table 84. TIM1&TIM8 Register Map and Reset Values
358
General-Purpose Timers (TIM2 to TIM5)
360
TIM2 to TIM5 Introduction
360
Timx Main Features
361
Timx Functional Description
362
Time-Base Unit
362
Figure 100. General-Purpose Timer Block Diagram
362
Figure 101. Counter Timing Diagram with Prescaler Division Change from 1 to 2
363
Counter Modes
364
Figure 102. Counter Timing Diagram with Prescaler Division Change from 1 to 4
364
Figure 103. Counter Timing Diagram, Internal Clock Divided by 1
365
Figure 104. Counter Timing Diagram, Internal Clock Divided by 2
365
Figure 105. Counter Timing Diagram, Internal Clock Divided by 4
365
Figure 106. Counter Timing Diagram, Internal Clock Divided by N
366
Figure 107. Counter Timing Diagram, Update Event When ARPE=0 (Timx_Arr Not Preloaded)
366
Figure 108. Counter Timing Diagram, Update Event When ARPE=1 (Timx_Arr Preloaded)
367
Figure 109. Counter Timing Diagram, Internal Clock Divided by 1
368
Figure 110. Counter Timing Diagram, Internal Clock Divided by 2
368
Figure 111. Counter Timing Diagram, Internal Clock Divided by 4
368
Figure 112. Counter Timing Diagram, Internal Clock Divided by N
369
Figure 113. Counter Timing Diagram, Update Event
369
Figure 114. Counter Timing Diagram, Internal Clock Divided by 1, Timx_Arr=0X6
370
Figure 115. Counter Timing Diagram, Internal Clock Divided by 2
371
Figure 116. Counter Timing Diagram, Internal Clock Divided by 4, Timx_Arr=0X36
371
Figure 117. Counter Timing Diagram, Internal Clock Divided by N
371
Clock Selection
372
Figure 118. Counter Timing Diagram, Update Event with ARPE=1 (Counter Underflow)
372
Figure 119. Counter Timing Diagram, Update Event with ARPE=1 (Counter Overflow)
372
Figure 120. Control Circuit in Normal Mode, Internal Clock Divided by 1
373
Figure 121. TI2 External Clock Connection Example
373
Figure 122. Control Circuit in External Clock Mode 1
374
Figure 123. External Trigger Input Block
374
Capture/Compare Channels
375
Figure 124. Control Circuit in External Clock Mode 2
375
Figure 125. Capture/Compare Channel (Example: Channel 1 Input Stage)
375
Figure 126. Capture/Compare Channel 1 Main Circuit
376
Figure 127. Output Stage of Capture/Compare Channel (Channel 1)
376
Input Capture Mode
377
PWM Input Mode
378
Figure 128. PWM Input Mode Timing
378
Forced Output Mode
379
Output Compare Mode
379
PWM Mode
380
Figure 129. Output Compare Mode, Toggle on OC1
380
Figure 130. Edge-Aligned PWM Waveforms (ARR=8)
381
Figure 131. Center-Aligned PWM Waveforms (ARR=8)
382
One-Pulse Mode
383
Figure 132. Example of One-Pulse Mode
383
Clearing the Ocxref Signal on an External Event
384
Encoder Interface Mode
385
Figure 133. Clearing Timx Ocxref
385
Table 85. Counting Direction Versus Encoder Signals
386
Figure 134. Example of Counter Operation in Encoder Interface Mode
387
Figure 135. Example of Encoder Interface Mode with TI1FP1 Polarity Inverted
387
Timer Input XOR Function
388
Timers and External Trigger Synchronization
388
Figure 136. Control Circuit in Reset Mode
388
Figure 137. Control Circuit in Gated Mode
389
Figure 138. Control Circuit in Trigger Mode
390
Timer Synchronization
391
Figure 139. Control Circuit in External Clock Mode 2 + Trigger Mode
391
Figure 140. Master/Slave Timer Example
391
Figure 141. Gating Timer 2 with OC1REF of Timer 1
392
Figure 142. Gating Timer 2 with Enable of Timer 1
393
Figure 143. Triggering Timer 2 with Update of Timer 1
394
Figure 144. Triggering Timer 2 with Enable of Timer 1
394
Debug Mode
396
Figure 145. Triggering Timer 1 and 2 with Timer 1 TI1 Input
396
Timx2 to TIM5 Registers
397
Timx Control Register 1 (Timx_Cr1)
397
Timx Control Register 2 (Timx_Cr2)
399
Timx Slave Mode Control Register (Timx_Smcr)
400
Table 86. Timx Internal Trigger Connection
401
Timx Dma/Interrupt Enable Register (Timx_Dier)
402
Timx Status Register (Timx_Sr)
403
Timx Event Generation Register (Timx_Egr)
405
Timx Capture/Compare Mode Register 1 (Timx_Ccmr1)
406
Timx Capture/Compare Mode Register 2 (Timx_Ccmr2)
409
Timx Capture/Compare Enable Register (Timx_Ccer)
410
Timx Counter (Timx_Cnt)
411
Table 87. Output Control Bit for Standard Ocx Channels
411
Timx Prescaler (Timx_Psc)
412
Timx Auto-Reload Register (Timx_Arr)
412
Timx Capture/Compare Register 1 (Timx_Ccr1)
412
Timx Capture/Compare Register 2 (Timx_Ccr2)
413
Timx Capture/Compare Register 3 (Timx_Ccr3)
413
Timx Capture/Compare Register 4 (Timx_Ccr4)
413
Timx DMA Control Register (Timx_Dcr)
414
Timx DMA Address for Full Transfer (Timx_Dmar)
414
Timx Register Map
416
Table 88. Timx Register Map and Reset Values
416
General-Purpose Timers (TIM9 to TIM14)
418
TIM9 to TIM14 Introduction
418
TIM9 to TIM14 Main Features
419
TIM9/TIM12 Main Features
419
Figure 146. General-Purpose Timer Block Diagram (TIM9 and TIM12)
419
TIM10/TIM11 and TIM13/TIM14 Main Features
420
Figure 147. General-Purpose Timer Block Diagram (TIM10/11/13/14)
420
TIM9 to TIM14 Functional Description
421
Time-Base Unit
421
Counter Modes
422
Figure 148. Counter Timing Diagram with Prescaler Division Change from 1 to 2
422
Figure 149. Counter Timing Diagram with Prescaler Division Change from 1 to 4
422
Figure 150. Counter Timing Diagram, Internal Clock Divided by 1
423
Figure 151. Counter Timing Diagram, Internal Clock Divided by 2
423
Figure 152. Counter Timing Diagram, Internal Clock Divided by 4
424
Figure 153. Counter Timing Diagram, Internal Clock Divided by N
424
Clock Selection
425
Figure 156. Control Circuit in Normal Mode, Internal Clock Divided by 1
426
Figure 157. TI2 External Clock Connection Example
426
Capture/Compare Channels
427
Figure 158. Control Circuit in External Clock Mode 1
427
Figure 159. Capture/Compare Channel (Example: Channel 1 Input Stage)
427
Input Capture Mode
428
Figure 160. Capture/Compare Channel 1 Main Circuit
428
Figure 161. Output Stage of Capture/Compare Channel (Channel 1)
428
PWM Input Mode (Only for TIM9/12)
429
Forced Output Mode
430
Figure 162. PWM Input Mode Timing
430
Output Compare Mode
431
PWM Mode
432
Figure 163. Output Compare Mode, Toggle on OC1
432
One-Pulse Mode
433
Figure 164. Edge-Aligned PWM Waveforms (ARR=8)
433
Figure 165. Example of One Pulse Mode
433
TIM9/12 External Trigger Synchronization
434
Figure 166. Control Circuit in Reset Mode
435
Figure 167. Control Circuit in Gated Mode
436
Figure 168. Control Circuit in Trigger Mode
436
Timer Synchronization (TIM9/12)
437
Debug Mode
437
TIM9 and TIM12 Registers
437
TIM9/12 Control Register 1 (Timx_Cr1)
437
9/12TIM9/12 Slave Mode Control Register (Timx_Smcr)
439
Table 89. Timx Internal Trigger Connection
439
TIM9/12 Interrupt Enable Register (Timx_Dier)
440
TIM9/12 Status Register (Timx_Sr)
441
TIM9/12 Event Generation Register (Timx_Egr)
442
TIM9/12 Capture/Compare Mode Register 1 (Timx_Ccmr1)
444
TIM9/12 Capture/Compare Enable Register (Timx_Ccer)
447
TIM9/12 Counter (Timx_Cnt)
448
TIM9/12 Prescaler (Timx_Psc)
448
TIM9/12 Auto-Reload Register (Timx_Arr)
448
Table 90. Output Control Bit for Standard Ocx Channels
448
TIM9/12 Capture/Compare Register 1 (Timx_Ccr1)
449
TIM9/12 Capture/Compare Register 2 (Timx_Ccr2)
449
TIM9/12 Register Map
449
Table 91. TIM9/12 Register Map and Reset Values
450
TIM10/11/13/14 Registers
452
TIM10/11/13/14 Control Register 1 (Timx_Cr1)
452
TIM10/11/13/14 Status Register (Timx_Sr)
453
TIM10/11/13/14 Event Generation Register (Timx_Egr)
453
TIM10/11/13/14 Capture/Compare Mode Register 1
454
(Timx_Ccmr1)
454
TIM10/11/13/14 Capture/Compare Enable Register
457
(Timx_Ccer)
457
Table 92. Output Control Bit for Standard Ocx Channels
457
TIM10/11/13/14 Counter (Timx_Cnt)
458
TIM10/11/13/14 Prescaler (Timx_Psc)
458
TIM10/11/13/14 Auto-Reload Register (Timx_Arr)
458
TIM10/11/13/14 Capture/Compare Register 1 (Timx_Ccr1)
459
TIM10/11/13/14 Register Map
459
Table 93. TIM10/11/13/14 Register Map and Reset Values
459
Basic Timers (TIM6&TIM7)
461
TIM6&TIM7 Introduction
461
TIM6&TIM7 Main Features
461
TIM6&TIM7 Functional Description
462
Time-Base Unit
462
Figure 169. Basic Timer Block Diagram
462
Figure 170. Counter Timing Diagram with Prescaler Division Change from 1 to 2
463
Figure 171. Counter Timing Diagram with Prescaler Division Change from 1 to 4
463
Counting Mode
464
Figure 172. Counter Timing Diagram, Internal Clock Divided by 1
464
Figure 173. Counter Timing Diagram, Internal Clock Divided by 2
465
Figure 174. Counter Timing Diagram, Internal Clock Divided by 4
465
Figure 175. Counter Timing Diagram, Internal Clock Divided by N
465
Clock Source
466
Debug Mode
467
TIM6&TIM7 Registers
467
TIM6&TIM7 Control Register 1 (Timx_Cr1)
467
Figure 178. Control Circuit in Normal Mode, Internal Clock Divided by 1
467
TIM6&TIM7 Control Register 2 (Timx_Cr2)
469
TIM6&TIM7 Dma/Interrupt Enable Register (Timx_Dier)
469
TIM6&TIM7 Status Register (Timx_Sr)
470
TIM6&TIM7 Event Generation Register (Timx_Egr)
470
TIM6&TIM7 Counter (Timx_Cnt)
470
TIM6&TIM7 Prescaler (Timx_Psc)
471
TIM6&TIM7 Auto-Reload Register (Timx_Arr)
471
TIM6&TIM7 Register Map
472
Table 94. TIM6&TIM7 Register Map and Reset Values
472
Real-Time Clock (RTC)
473
RTC Introduction
473
RTC Main Features
474
RTC Functional Description
475
Overview
475
Figure 179. RTC Simplified Block Diagram
475
Resetting RTC Registers
476
Reading RTC Registers
476
Configuring RTC Registers
476
RTC Flag Assertion
477
Figure 180. RTC Second and Alarm Waveform Example with PR=0003, ALARM=00004
477
Figure 181. RTC Overflow Waveform Example with PR=0003
477
RTC Registers
478
RTC Control Register High (RTC_CRH)
478
RTC Control Register Low (RTC_CRL)
479
RTC Prescaler Load Register (RTC_PRLH / RTC_PRLL)
480
RTC Prescaler Divider Register (RTC_DIVH / RTC_DIVL)
481
RTC Counter Register (RTC_CNTH / RTC_CNTL)
482
RTC Alarm Register High (RTC_ALRH / RTC_ALRL)
483
RTC Register Map
484
Table 95. RTC Register Map and Reset Values
484
Independent Watchdog (IWDG)
485
IWDG Introduction
485
IWDG Main Features
485
IWDG Functional Description
485
Hardware Watchdog
486
Register Access Protection
486
Debug Mode
486
Table 96. Min/Max IWDG Timeout Period at 40 Khz (LSI)
486
Figure 182. Independent Watchdog Block Diagram
486
IWDG Registers
487
Key Register (IWDG_KR)
487
Prescaler Register (IWDG_PR)
488
Reload Register (IWDG_RLR)
488
Status Register (IWDG_SR)
488
IWDG Register Map
490
Table 97. IWDG Register Map and Reset Values
490
Window Watchdog (WWDG)
491
WWDG Introduction
491
WWDG Main Features
491
WWDG Functional Description
491
Figure 183. Watchdog Block Diagram
492
How to Program the Watchdog Timeout
493
Figure 184. Window Watchdog Timing Diagram
493
Debug Mode
494
Table 98. Min-Max Timeout Value @36 Mhz (F PCLK1 )
494
WWDG Registers
495
Control Register (WWDG_CR)
495
Configuration Register (WWDG_CFR)
496
Status Register (WWDG_SR)
496
WWDG Register Map
497
Table 99. WWDG Register Map and Reset Values
497
Flexible Static Memory Controller (FSMC)
498
FSMC Main Features
498
Block Diagram
499
AHB Interface
500
Figure 185. FSMC Block Diagram
500
Supported Memories and Transactions
501
External Device Address Mapping
502
NOR/PSRAM Address Mapping
502
Table 100. NOR/PSRAM Bank Selection
502
Figure 186. FSMC Memory Banks
502
NAND/PC Card Address Mapping
503
Table 101. External Memory Address
503
Table 102. Memory Mapping and Timing Registers
503
NOR Flash/Psram Controller
504
Table 103. NAND Bank Selections
504
External Memory Interface Signals
505
Table 104. Programmable NOR/PSRAM Access Parameters
505
Table 105. Nonmultiplexed I/O nor Flash
505
Supported Memories and Transactions
506
Table 106. Multiplexed I/O nor Flash
506
Table 107. Nonmultiplexed I/Os PSRAM/SRAM
506
And Transactions
507
General Timing Rules
508
NOR Flash/Psram Controller Asynchronous Transactions
508
Figure 187. Mode1 Read Accesses
509
Figure 188. Mode1 Write Accesses
509
Table 109. Fsmc_Bcrx Bit Fields
510
Table 110. Fsmc_Btrx Bit Fields
510
Figure 189. Modea Read Accesses
511
Figure 190. Modea Write Accesses
511
Table 111. Fsmc_Bcrx Bit Fields
512
Table 112. Fsmc_Btrx Bit Fields
512
Table 113. Fsmc_Bwtrx Bit Fields
513
Figure 191. Mode2 and Mode B Read Accesses
513
Figure 192. Mode2 Write Accesses
514
Figure 193. Mode B Write Accesses
514
Table 114. Fsmc_Bcrx Bit Fields
515
Table 115. Fsmc_Btrx Bit Fields
515
Table 116. Fsmc_Bwtrx Bit Fields
516
Figure 194. Mode C Read Accesses
516
Table 117. Fsmc_Bcrx Bit Fields
517
Figure 195. Mode C Write Accesses
517
Table 118. Fsmc_Btrx Bit Fields
518
Table 119. Fsmc_Bwtrx Bit Fields
518
Figure 196. Mode D Read Accesses
519
Table 120. Fsmc_Bcrx Bit Fields
520
Table 121. Fsmc_Btrx Bit Fields
520
Table 122. Fsmc_Bwtrx Bit Fields
521
Figure 197. Multiplexed Read Accesses
521
Table 123. Fsmc_Bcrx Bit Fields
522
Figure 198. Multiplexed Write Accesses
522
Table 124. Fsmc_Btrx Bit Fields
523
Figure 199. Asynchronous Wait During a Read Access
524
Figure 200. Asynchronous Wait During a Write Access
525
Synchronous Transactions
526
Figure 201. Wait Configurations
527
Table 125. Fsmc_Bcrx Bit Fields
528
Figure 202. Synchronous Multiplexed Read Mode - NOR, PSRAM (CRAM)
528
Table 126. Fsmc_Btrx Bit Fields
529
Table 127. Fsmc_Bcrx Bit Fields
530
Figure 203. Synchronous Multiplexed Write Mode - PSRAM (CRAM)
530
Table 128. Fsmc_Btrx Bit Fields
531
NOR/PSRAM Control Registers
532
Table 108. nor Flash/Psram Controller: Example of Supported Memories
507
NAND Flash/Pc Card Controller
538
External Memory Interface Signals
539
Table 129. Programmable NAND/PC Card Access Parameters
539
Table 130. 8-Bit NAND Flash
539
Table 131. 16-Bit NAND Flash
540
Table 132. 16-Bit PC Card
540
NAND Flash / PC Card Supported Memories and Transactions
541
Timing Diagrams for NAND and PC Card
541
Table 133. Supported Memories and Transactions
541
NAND Flash Operations
542
Figure 204. NAND/PC Card Controller Timing for Common Memory Access
542
NAND Flash Pre-Wait Functionality
543
Figure 205. Access to Non 'CE Don't Care' NAND-Flash
543
Computation of the Error Correction Code (ECC) in NAND Flash Memory
544
PC Card/Compactflash Operations
545
Table 134. 16-Bit PC-Card Signals and Access Type
546
NAND Flash/Pc Card Control Registers
547
Table 135. ECC Result Relevant Bits
553
FSMC Register Map
554
Table 136. FSMC Register Map
554
Secure Digital Input/Output Interface (SDIO)
556
SDIO Main Features
556
SDIO Bus Topology
557
Figure 206. SDIO "No Response" and "No Data" Operations
557
Figure 207. SDIO (Multiple) Block Read Operation
557
Figure 208. SDIO (Multiple) Block Write Operation
558
Figure 209. SDIO Sequential Read Operation
558
Figure 210. SDIO Sequential Write Operation
558
SDIO Functional Description
559
Figure 211. SDIO Block Diagram
559
Figure 212. SDIO Adapter
560
SDIO Adapter
560
Table 137. SDIO I/O Definitions
560
Figure 213. Control Unit
561
Figure 214. SDIO Adapter Command Path
562
Figure 215. Command Path State Machine (CPSM)
563
Figure 216. SDIO Command Transfer
564
Table 138. Command Format
564
Table 139. Short Response Format
565
Table 140. Long Response Format
565
Table 141. Command Path Status Flags
565
Figure 217. Data Path
566
Figure 218. Data Path State Machine (DPSM)
567
Table 142. Data Token Format
568
Table 143. Transmit FIFO Status Flags
569
SDIO AHB Interface
570
Table 144. Receive FIFO Status Flags
570
Card Functional Description
571
Card Identification Mode
571
Card Reset
571
Operating Voltage Range Validation
572
Card Identification Process
572
Block Write
573
Block Read
574
Stream Access, Stream Write and Stream Read (Multimediacard Only)
574
Erase: Group Erase and Sector Erase
576
Wide Bus Selection or Deselection
577
Protection Management
577
Card Status Register
580
Table 145. Card Status
581
SD Status Register
583
Table 146. SD Status
583
Table 147. Speed Class Code Field
585
Table 148. Performance Move Field
585
Table 149. AU_SIZE Field
586
Table 150. Maximum AU Size
586
Table 151. Erase Size Field
586
Table 152. Erase Timeout Field
586
SD I/O Mode
587
Table 153. Erase Offset Field
587
Commands and Responses
588
Table 154. Block-Oriented Write Commands
589
Table 155. Block-Oriented Write Protection Commands
590
Table 156. Erase Commands
590
Table 157. I/O Mode Commands
590
Response Formats
591
Table 158. Lock Card
591
Table 159. Application-Specific Commands
591
R1 (Normal Response Command)
592
R1B
592
R2 (CID, CSD Register)
592
R3 (OCR Register)
592
Table 160. R1 Response
592
Table 161. R2 Response
592
R4 (Fast I/O)
593
R4B
593
Table 162. R3 Response
593
Table 163. R4 Response
593
Table 164. R4B Response
593
R5 (Interrupt Request)
594
Table 165. R5 Response
594
Table 166. R6 Response
594
SDIO I/O Card-Specific Operations
595
SDIO I/O Read Wait Operation by SDIO_D2 Signalling
595
SDIO Read Wait Operation by Stopping SDIO_CK
595
SDIO Suspend/Resume Operation
596
SDIO Interrupts
596
CE-ATA Specific Operations
596
Command Completion Signal Disable
596
Command Completion Signal Enable
596
CE-ATA Interrupt
597
Aborting CMD61
597
HW Flow Control
597
SDIO Registers
597
SDIO Power Control Register (SDIO_POWER)
598
SDI Clock Control Register (SDIO_CLKCR)
598
SDIO Argument Register (SDIO_ARG)
599
SDIO Command Register (SDIO_CMD)
600
SDIO Command Response Register (SDIO_RESPCMD)
601
SDIO Response 1
601
Table 167. Response Type and Sdio_Respx Registers
601
SDIO Data Timer Register (SDIO_DTIMER)
602
SDIO Data Length Register (SDIO_DLEN)
602
SDIO Data Control Register (SDIO_DCTRL)
603
SDIO Data Counter Register (SDIO_DCOUNT)
604
SDIO Status Register (SDIO_STA)
605
SDIO Interrupt Clear Register (SDIO_ICR)
606
SDIO Mask Register (SDIO_MASK)
608
SDIO FIFO Counter Register (SDIO_FIFOCNT)
610
SDIO Data FIFO Register (SDIO_FIFO)
611
SDIO Register Map
611
Table 168. SDIO Register Map
611
Universal Serial Bus Full-Speed Device Interface (USB)
613
USB Introduction
613
USB Main Features
613
USB Functional Description
613
Figure 219. USB Peripheral Block Diagram
614
Description of USB Blocks
615
Programming Considerations
616
Generic USB Device Programming
616
System and Power-On Reset
617
Figure 220. Packet Buffer Areas with Examples of Buffer Description Table Locations
618
Double-Buffered Endpoints
621
Table 169. Double-Buffering Buffer Flag Definition
623
Table 170. Bulk Double-Buffering Memory Buffers Usage
624
Isochronous Transfers
625
Table 171. Isochronous Memory Buffers Usage
625
Suspend/Resume Events
626
Table 172. Resume Event Detection
627
USB Registers
628
Common Registers
628
Endpoint-Specific Registers
635
Table 173. Reception Status Encoding
638
Table 174. Endpoint Type Encoding
638
Table 175. Endpoint Kind Meaning
639
Table 176. Transmission Status Encoding
639
Buffer Descriptor Table
640
USB Register Map
643
Table 177. Definition of Allocated Buffer Memory
643
Table 178. USB Register Map and Reset Values
643
Controller Area Network (Bxcan)
645
Bxcan Introduction
645
Bxcan Main Features
645
Bxcan General Description
646
CAN 2.0B Active Core
647
Control, Status and Configuration Registers
647
Tx Mailboxes
647
Acceptance Filters
647
Figure 221. CAN Network Topology
647
Bxcan Operating Modes
648
Figure 222. Dual CAN Block Diagram (Connectivity Devices)
648
Initialization Mode
649
Normal Mode
649
Sleep Mode (Low Power)
649
Test Mode
650
Silent Mode
650
Figure 223. Bxcan Operating Modes
650
Loop Back Mode
651
Loop Back Combined with Silent Mode
651
Figure 224. Bxcan in Silent Mode
651
Figure 225. Bxcan in Loop Back Mode
651
Debug Mode
652
Bxcan Functional Description
652
Transmission Handling
652
Figure 226. Bxcan in Combined Mode
652
Figure 227. Transmit Mailbox States
653
Time Triggered Communication Mode
654
Reception Handling
654
Figure 228. Receive FIFO States
654
Identifier Filtering
655
Figure 229. Filter Bank Scale Configuration - Register Organization
657
Figure 230. Example of Filter Numbering
658
Message Storage
659
Figure 231. Filtering Mechanism - Example
659
Table 179. Transmit Mailbox Mapping
660
Table 180. Receive Mailbox Mapping
660
Figure 232. CAN Error State Diagram
660
Error Management
661
Bit Timing
661
Figure 233. Bit Timing
662
Bxcan Interrupts
663
Figure 234. CAN Frames
663
Figure 235. Event Flags and Interrupt Generation
664
CAN Registers
665
Register Access Protection
665
CAN Control and Status Registers
665
CAN Mailbox Registers
675
Figure 236. RX and TX Mailboxes
675
CAN Filter Registers
682
Bxcan Register Map
686
Table 181. Bxcan Register Map and Reset Values
686
Serial Peripheral Interface (SPI)
690
SPI Introduction
690
SPI and I 2 S Main Features
691
SPI Features
691
I 2 S Features
692
SPI Functional Description
693
General Description
693
Figure 237. SPI Block Diagram
693
Figure 238. Single Master/ Single Slave Application
694
Configuring the SPI in Slave Mode
696
Figure 239. Data Clock Timing Diagram
696
Configuring the SPI in Master Mode
698
Configuring the SPI for Half-Duplex Communication
699
Data Transmission and Reception Procedures
699
Figure 240. TXE/RXNE/BSY Behavior in Master / Full-Duplex Mode (BIDIMODE=0 and RXONLY=0) in the Case of Continuous Transfers
702
Figure 241. TXE/RXNE/BSY Behavior in Slave / Full-Duplex Mode (BIDIMODE=0, RXONLY=0) in the Case of Continuous Transfers
702
Figure 242. TXE/BSY Behavior in Master Transmit-Only Mode (BIDIMODE=0 and RXONLY=0) in
703
Case of Continuous Transfers
703
Figure 243. TXE/BSY in Slave Transmit-Only Mode (BIDIMODE=0 and RXONLY=0) in the Case of
704
Figure 244. RXNE Behavior in Receive-Only Mode (BIDIRMODE=0 and RXONLY=1) in the Case of
705
Continuous Transfers
705
CRC Calculation
706
Figure 245. TXE/BSY Behavior When Transmitting (BIDIRMODE=0 and RXONLY=0) in the Case of
706
Status Flags
708
Disabling the SPI
709
SPI Communication Using DMA (Direct Memory Addressing)
710
Figure 246. Transmission Using DMA
711
Figure 247. Reception Using DMA
711
Error Flags
712
SPI Interrupts
713
Table 182. SPI Interrupt Requests
713
I 2 S Functional Description
714
I 2 S General Description
714
Figure 248. I S Block Diagram
714
Supported Audio Protocols
715
Figure 249. I 2 S Philips Protocol Waveforms (16/32-Bit Full Accuracy, CPOL = 0)
716
Figure 250. I 2 S Philips Standard Waveforms (24-Bit Frame with CPOL = 0)
716
Figure 251. Transmitting 0X8Eaa33
717
Figure 252. Receiving 0X8Eaa33
717
Figure 253. I
717
Figure 254. Example
718
Figure 255. MSB Justified 16-Bit or 32-Bit Full-Accuracy Length with CPOL = 0
718
Figure 256. MSB Justified 24-Bit Frame Length with CPOL = 0
719
Figure 257. MSB Justified 16-Bit Extended to 32-Bit Packet Frame with CPOL = 0
719
Figure 258. LSB Justified 16-Bit or 32-Bit Full-Accuracy with CPOL = 0
719
Figure 259. LSB Justified 24-Bit Frame Length with CPOL = 0
720
Figure 260. Operations Required to Transmit 0X3478Ae
720
Figure 261. Operations Required to Receive 0X3478Ae
720
Figure 262. LSB Justified 16-Bit Extended to 32-Bit Packet Frame with CPOL = 0
721
Figure 263. Example of LSB Justified 16-Bit Extended to 32-Bit Packet Frame
721
Clock Generator
722
Figure 264. PCM Standard Waveforms (16-Bit)
722
Figure 265. PCM Standard Waveforms (16-Bit Extended to 32-Bit Packet Frame)
722
Figure 266. Audio Sampling Frequency Definition
723
Figure 267. I
723
Table 183. Audio-Frequency Precision Using Standard 8 Mhz HSE
724
Table 184. Audio-Frequency Precision Using Standard 25 Mhz and PLL3
725
Table 185. Audio-Frequency Precision Using Standard 14.7456 Mhz and PLL3
726
I 2 S Master Mode
727
I 2 S Slave Mode
728
Status Flags
730
Error Flags
731
I 2 S Interrupts
732
DMA Features
732
Table 186. I 2 S Interrupt Requests
732
SPI and I 2 S Registers
733
SPI Control Register 1 (SPI_CR1)
733
Mode)
733
SPI Control Register 2 (SPI_CR2)
735
SPI Status Register (SPI_SR)
736
SPI Data Register (SPI_DR)
737
SPI CRC Polynomial Register (SPI_CRCPR) (Not Used in I
738
Mode)
738
SPI RX CRC Register (SPI_RXCRCR)
738
SPI TX CRC Register (SPI_TXCRCR)
738
SPI_I S Configuration Register (SPI_I2SCFGR)
739
SPI_I 2 S Prescaler Register (SPI_I2SPR)
740
SPI Register Map
742
Table 187. SPI Register Map and Reset Values
742
Inter-Integrated Circuit (I 2 C) Interface
743
I 2 C Introduction
743
I 2 C Main Features
744
C Functional Description
745
Mode Selection
745
Figure 268. I2C Bus Protocol
745
I2C Slave Mode
746
Figure 269. I2C Block Diagram
746
Figure 270. Transfer Sequence Diagram for Slave Transmitter
748
I2C Master Mode
749
Figure 271. Transfer Sequence Diagram for Slave Receiver
749
Figure 272. Transfer Sequence Diagram for Master Transmitter
752
Figure 273. Method 1: Transfer Sequence Diagram for Master Receiver
754
Figure 274. Method 2: Transfer Sequence Diagram for Master Receiver When N>2
755
Figure 275. Method 2: Transfer Sequence Diagram for Master Receiver When N=2
756
Error Conditions
757
Figure 276. Method 2: Transfer Sequence Diagram for Master Receiver When N=1
757
SDA/SCL Line Control
758
Smbus
759
Table 188. Smbus Vs. I2C
759
DMA Requests
761
Packet Error Checking
763
I 2 C Interrupts
763
Table 189. I2C Interrupt Requests
763
Figure 277. I2C Interrupt Mapping Diagram
764
I 2 C Debug Mode
765
I 2 C Registers
765
C Control Register 1 (I2C_CR1)
765
I 2 C Control Register 2 (I2C_CR2)
767
I 2 C Own Address Register 1 (I2C_OAR1)
769
I 2 C Own Address Register 2 (I2C_OAR2)
769
C Data Register (I2C_DR)
770
C Status Register 1 (I2C_SR1)
770
I 2 C Status Register 2 (I2C_SR2)
774
I 2 C Clock Control Register (I2C_CCR)
775
C TRISE Register (I2C_TRISE)
776
I2C Register Map
777
Table 190. I2C Register Map and Reset Values
777
Universal Synchronous Asynchronous Receiver Transmitter (USART)
778
USART Introduction
778
USART Main Features
779
USART Functional Description
780
Figure 278. USART Block Diagram
782
Figure 279. Word Length Programming
783
USART Character Description
783
Transmitter
784
Figure 280. Configurable Stop Bits
785
Figure 281. TC/TXE Behavior When Transmitting
786
Figure 282. Start Bit Detection
787
Receiver
787
Figure 283. Data Sampling for Noise Detection
789
Table 191. Noise Detection from Sampled Data
790
Fractional Baud Rate Generation
791
Table 192. Error Calculation for Programmed Baud Rates
792
Multiprocessor Communication
793
Table 193. USART Receiver's Tolerance When Div_Fraction Is 0
793
Table 195. USART Receiver's Tolerance When Div_Fraction Is Different from 0
793
USART Receiver's Tolerance to Clock Deviation
793
Figure 284. Mute Mode Using Idle Line Detection
794
Figure 285. Mute Mode Using Address Mark Detection
795
Parity Control
795
Table 197. Frame Formats
795
LIN (Local Interconnection Network) Mode
796
Figure 286. Break Detection in LIN Mode (11-Bit Break Length - LBDL Bit Is Set)
797
Figure 287. Break Detection in LIN Mode Vs. Framing Error Detection
798
USART Synchronous Mode
798
Figure 288. USART Example of Synchronous Transmission
799
Figure 289. USART Data Clock Timing Diagram (M=0)
799
Figure 290. USART Data Clock Timing Diagram (M=1)
800
Figure 291. RX Data Setup/Hold Time
800
Single-Wire Half-Duplex Communication
800
Figure 292. ISO 7816-3 Asynchronous Protocol
801
Smartcard
801
Figure 293. Parity Error Detection Using the 1.5 Stop Bits
803
Irda SIR ENDEC Block
803
Continuous Communication Using DMA
805
Figure 294. Irda SIR ENDEC- Block Diagram
805
Figure 295. Irda Data Modulation (3/16) -Normal Mode
805
Figure 296. Transmission Using DMA
806
Figure 297. Reception Using DMA
807
Figure 298. Hardware Flow Control between Two Usarts
808
Figure 299. RTS Flow Control
808
Hardware Flow Control
808
USART Interrupts
809
Table 198. USART Interrupt Requests
809
Figure 300. CTS Flow Control
809
USART Mode Configuration
810
USART Registers
810
Figure 301. USART Interrupt Mapping Diagram
810
Table 199. USART Mode Configuration
810
Status Register (USART_SR)
811
Baud Rate Register (USART_BRR)
813
Data Register (USART_DR)
813
Control Register 1 (USART_CR1)
814
Control Register 2 (USART_CR2)
816
Control Register 3 (USART_CR3)
817
Guard Time and Prescaler Register (USART_GTPR)
819
Table 200. USART Register Map and Reset Values
820
USART Register Map
820
USB On-The-Go Full-Speed (OTG_FS)
821
OTG_FS Introduction
821
OTG_FS Main Features
822
General Features
822
Host-Mode Features
823
Peripheral-Mode Features
823
OTG_FS Functional Description
824
OTG Full-Speed Core
824
Full-Speed OTG PHY
824
Figure 302. OTG Full-Speed Block Diagram
824
OTG Dual Role Device (DRD)
825
Figure 303. OTG A-B Device Connection
825
HNP Dual Role Device
826
ID Line Detection
826
SRP Dual Role Device
826
USB Peripheral
827
SRP-Capable Peripheral
827
Figure 304. USB Peripheral-Only Connection
827
Peripheral States
828
Peripheral Endpoints
829
USB Host
831
SRP-Capable Host
832
USB Host States
832
Figure 305. USB Host-Only Connection
832
Host Channels
834
Host Scheduler
835
SOF Trigger
836
Host Sofs
836
Peripheral Sofs
836
Figure 306. SOF Connectivity
836
Power Options
837
Dynamic Update of the OTG_FS_HFIR Register
838
USB Data Fifos
838
Figure 307. Updating OTG_FS_HFIR Dynamically
838
Peripheral FIFO Architecture
839
Peripheral Rx FIFO
839
Figure 308. Device-Mode FIFO Address Mapping and AHB FIFO Access Mapping
839
Peripheral Tx Fifos
840
Host FIFO Architecture
840
Host Rx FIFO
840
Figure 309. Host-Mode FIFO Address Mapping and AHB FIFO Access Mapping
840
Host Tx Fifos
841
FIFO RAM Allocation
841
Device Mode
841
Host Mode
842
USB System Performance
842
OTG_FS Interrupts
843
OTG_FS Control and Status Registers
844
Figure 310. Interrupt Hierarchy
844
CSR Memory Map
845
Figure 311. CSR Memory Map
846
Table 201. Core Global Control and Status Registers (Csrs)
846
Table 202. Host-Mode Control and Status Registers (Csrs)
847
Table 203. Device-Mode Control and Status Registers
848
OTG_FS Global Registers
850
Table 204. Data FIFO (DFIFO) Access Register Map
850
Table 205. Power and Clock Gating Control and Status Registers
850
Host-Mode Registers
871
Device-Mode Registers
882
Table 206. Minimum Duration for Soft Disconnect
884
OTG_FS Power and Clock Gating Control Register
904
(Otg_Fs_Pcgcctl)
904
OTG_FS Register Map
905
Table 207. OTG_FS Register Map and Reset Values
905
OTG_FS Programming Model
912
Core Initialization
912
Host Initialization
913
Device Initialization
913
Host Programming Model
914
Figure 312. Transmit FIFO Write Task
915
Figure 313. Receive FIFO Read Task
916
Figure 314. Normal Bulk/Control OUT/SETUP and Bulk/Control in Transactions
918
Figure 315. Bulk/Control in Transactions
921
Figure 316. Normal Interrupt OUT/IN Transactions
923
Figure 317. Normal Isochronous OUT/IN Transactions
928
Device Programming Model
931
Operational Model
933
Figure 318. Receive FIFO Packet Read
934
Figure 319. Processing a SETUP Packet
936
Figure 320. Bulk out Transaction
942
Worst Case Response Time
950
OTG Programming Model
951
Figure 321. TRDT Max Timing Case
951
Figure 322. A-Device SRP
952
Figure 323. B-Device SRP
953
Figure 324. A-Device HNP
954
Figure 325. B-Device HNP
956
Ethernet (ETH): Media Access Control (MAC) with DMA Controller
958
Ethernet Introduction
958
Ethernet Main Features
958
MAC Core Features
959
DMA Features
960
PTP Features
960
Ethernet Pins
961
Table 208. Ethernet Pin Configuration
961
Ethernet Functional Description: SMI, MII and RMII
962
Station Management Interface: SMI
962
Figure 326. ETH Block Diagram
962
Table 209. Management Frame Format
963
Figure 327. SMI Interface Signals
963
Figure 328. MDIO Timing and Frame Structure - Write Cycle
964
Table 210. Clock Range
965
Figure 329. MDIO Timing and Frame Structure - Read Cycle
965
Media-Independent Interface: MII
966
Figure 330. Media Independent Interface Signals
966
Table 211. TX Interface Signal Encoding
967
Table 212. RX Interface Signal Encoding
967
Reduced Media-Independent Interface: RMII
968
Figure 331. MII Clock Sources
968
Figure 332. Reduced Media-Independent Interface Signals
968
MII/RMII Selection
969
Figure 333. RMII Clock Sources
969
Figure 334. Clock Scheme
969
Ethernet Functional Description: MAC 802.3
970
MAC 802.3 Frame Format
970
Figure 335. Address Field Format
971
Figure 336. MAC Frame Format
973
Figure 337. Tagged MAC Frame Format
973
MAC Frame Transmission
974
Figure 338. Transmission Bit Order
980
Figure 339. Transmission with no Collision
980
MAC Frame Reception
981
Figure 340. Transmission with Collision
981
Figure 341. Frame Transmission in MMI and RMII Modes
981
Table 213. Frame Statuses
983
Figure 342. Receive Bit Order
985
Figure 343. Reception with no Error
986
Figure 344. Reception with Errors
986
Figure 345. Reception with False Carrier Indication
986
MAC Interrupts
987
MAC Filtering
987
Figure 346. MAC Core Interrupt Masking Scheme
987
Table 214. Destination Address Filtering
989
MAC Loopback Mode
990
MAC Management Counters: MMC
990
Table 215. Source Address Filtering
990
Power Management: PMT
991
Figure 347. Wakeup Frame Filter Register
992
Precision Time Protocol (IEEE1588 PTP)
994
Figure 348. Networked Time Synchronization
995
Figure 349. System Time Update Using the Fine Correction Method
997
Figure 350. PTP Trigger Output to TIM2 ITR1 Connection
999
Ethernet Functional Description: DMA Controller Operation
1000
Figure 351. PPS Output
1000
Figure 352. Descriptor Ring and Chain Structure
1001
Host Bus Burst Access
1001
Initialization of a Transfer Using DMA
1001
Buffer Size Calculations
1002
Host Data Buffer Alignment
1002
DMA Arbiter
1003
Error Response to DMA
1003
Tx DMA Configuration
1003
Figure 353. Txdma Operation in Default Mode
1005
Figure 354. Txdma Operation in OSF Mode
1007
Figure 355. Ransmit Descriptor
1008
Rx DMA Configuration
1012
Figure 356. Receive DMA Operation
1014
Figure 357. Rx DMA Descriptor Structure
1016
Table 216. Receive Descriptor 0
1018
DMA Interrupts
1020
Ethernet Interrupts
1021
Figure 358. Interrupt Scheme
1021
Ethernet Register Descriptions
1022
MAC Register Description
1022
Figure 359. Ethernet MAC Remote Wakeup Frame Filter Register (ETH_MACRWUFFR)
1031
MMC Register Description
1039
IEEE 1588 Time Stamp Registers
1044
DMA Register Description
1048
Ethernet Register Maps
1061
Table 217. Ethernet Register Map and Reset Values
1062
Device Electronic Signature
1065
Memory Size Registers
1065
Flash Size Register
1065
Unique Device ID Register (96 Bits)
1066
Debug Support (DBG)
1068
Overview
1068
Reference ARM® Documentation
1070
SWJ Debug Port (Serial Wire and JTAG)
1070
Figure 361. SWJ Debug Port
1070
Mechanism to Select the JTAG-DP or the SW-DP
1071
Pinout and Debug Port Pins
1071
SWJ Debug Port Pins
1072
Flexible SWJ-DP Pin Assignment
1072
Table 218. SWJ Debug Port Pins
1072
Internal Pull-Up and Pull-Down on JTAG Pins
1073
Table 219. Flexible SWJ-DP Pin Assignment
1073
Using Serial Wire and Releasing the Unused Debug Pins as Gpios
1074
Stm32F10Xxx JTAG TAP Connection
1074
Figure 362. JTAG TAP Connections
1075
ID Codes and Locking Mechanism
1076
MCU Device ID Code
1076
Boundary Scan TAP
1077
M3 Tap
1078
Cortex ® -M3 JEDEC-106 ID Code
1078
JTAG Debug Port
1078
Table 220. JTAG Debug Port Data Registers
1078
SW Debug Port
1080
SW Protocol Introduction
1080
SW Protocol Sequence
1080
Table 221. 32-Bit Debug Port Registers Addressed through the Shifted Value A[3:2]
1080
SW-DP State Machine (Reset, Idle States, ID Code)
1081
Table 222. Packet Request (8-Bits)
1081
Table 223. ACK Response (3 Bits)
1081
Table 224. DATA Transfer (33 Bits)
1081
DP and AP Read/Write Accesses
1082
SW-DP Registers
1082
Table 225. SW-DP Registers
1082
SW-AP Registers
1083
AHB-AP (AHB Access Port) - Valid for both JTAG-DP and SW-DP
1084
Table 226. Cortex
1084
Core Debug
1085
Table 227. Core Debug Registers
1085
Capability of the Debugger Host to Connect under System Reset
1086
FPB (Flash Patch Breakpoint)
1086
DWT (Data Watchpoint Trigger)
1087
ITM (Instrumentation Trace Macrocell)
1087
General Description
1087
Time Stamp Packets, Synchronization and Overflow Packets
1087
Table 228. Main ITM Registers
1088
ETM (Embedded Trace Macrocell)
1089
General Description
1089
Signal Protocol, Packet Types
1089
Main ETM Registers
1089
Configuration Example
1090
MCU Debug Component (DBGMCU)
1090
Debug Support for Low-Power Modes
1090
Table 229. Main ETM Registers
1090
Debug Support for Timers, Watchdog, Bxcan and I C
1091
Debug MCU Configuration Register
1091
TPIU (Trace Port Interface Unit)
1094
Introduction
1094
Figure 363. TPIU Block Diagram
1094
TRACE Pin Assignment
1095
Table 230. Asynchronous TRACE Pin Assignment
1095
Table 231. Synchronous TRACE Pin Assignment
1095
TPUI Formatter
1096
Table 232. Flexible TRACE Pin Assignment
1096
TPUI Frame Synchronization Packets
1097
Transmission of the Synchronization Frame Packet
1097
Synchronous Mode
1097
Asynchronous Mode
1098
TRACECLKIN Connection Inside the Stm32F10Xxx
1098
TPIU Registers
1098
Table 233. Important TPIU Registers
1098
31.17.10 Example of Configuration
1099
DBG Register Map
1100
Table 234. DBG Register Map and Reset Values
1100
Revision History
1101
Table 235. Document Revision History
1101
Figure 360. Block Diagram of STM32 MCU and Cortex ® -M3-Level
1110
Other manuals for ST STM32F101 series
User Manual
14 pages
5
Based on 1 rating
Ask a question
Give review
Questions and Answers:
Need help?
Do you have a question about the ST STM32F101 series and is the answer not in the manual?
Ask a question
ST STM32F101 series Specifications
General
Brand
ST
Model
STM32F101 series
Category
Computer Hardware
Language
English
Related product manuals
ST STM32F4 Series
262 pages
ST STM32F3 Series
262 pages
ST STM32F3DISCOVERY
41 pages
ST STM32G0
26 pages
ST STM32U5
49 pages
ST STM32 ODE
27 pages
ST STM32 Nucleo
32 pages
ST STM32H573I-DK
53 pages
ST STM32C0 Series
18 pages
ST STM32H7 Series
262 pages
ST STM32U5G9J-DK2
37 pages
ST STM32MP157D-DK1
47 pages