Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Reference manual
STM32F100xx
advanced ARM®-based 32-bit MCUs
Introduction
This reference manual targets application developers. It provides complete information on
how to use the STM32F100x4, STM32F100x6, STM32F100x8, STM32F100xB,
STM32F100xC, STM32F100xD and STM32F100xE microcontroller memory and
peripherals. The STM32F100x4, STM32F100x6, STM32F100x8, STM32F100xB,
STM32F100xC, STM32F100xD and STM32F100xE will be referred to as STM32F100xx
throughout the document, unless otherwise specified.
The STM32F100xx is a family of microcontrollers with different memory sizes, packages
and peripherals.
For ordering information, mechanical and electrical device characteristics, refer to the
STM32F100xx datasheet.
For information on programming, erasing and protection of the internal Flash memory refer
to the STM32F100xx Flash programming manual (PM0063).
For information on the ARM® Cortex®-M3 core, refer to the Cortex®-M3 Technical
Reference Manual.
Related documents
Available from www.arm.com:
• Cortex®-M3 Technical Reference Manual
Available from www.st.com:
• STM32F100xx datasheets
• STM32F100xx Flash programming manual
Contents
1 Documentation conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
1.1 List of abbreviations for registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
1.2 Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
1.3 Peripheral availability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
List of tables
List of figures
Figure 47. Counter timing diagram, update event when ARPE=0 (TIMx_ARR not preloaded) . . . . . 217
Figure 48. Counter timing diagram, update event when ARPE=1 (TIMx_ARR preloaded) . . . . . . . . 217
Figure 49. Counter timing diagram, internal clock divided by 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
Figure 50. Counter timing diagram, internal clock divided by 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
Figure 51. Counter timing diagram, internal clock divided by 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
Figure 52. Counter timing diagram, internal clock divided by N. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
Figure 53. Counter timing diagram, update event when repetition counter is not used . . . . . . . . . . . 221
Figure 54. Counter timing diagram, internal clock divided by 1, TIMx_ARR = 0x6 . . . . . . . . . . . . . . 222
Figure 55. Counter timing diagram, internal clock divided by 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
Figure 56. Counter timing diagram, internal clock divided by 4, TIMx_ARR=0x36 . . . . . . . . . . . . . . 223
Figure 57. Counter timing diagram, internal clock divided by N. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
Figure 58. Counter timing diagram, update event with ARPE=1 (counter underflow) . . . . . . . . . . . . 224
Figure 59. Counter timing diagram, Update event with ARPE=1 (counter overflow) . . . . . . . . . . . . . 224
Figure 60. Update rate examples depending on mode and TIMx_RCR register settings . . . . . . . . . 225
Figure 61. Control circuit in normal mode, internal clock divided by 1 . . . . . . . . . . . . . . . . . . . . . . . . 226
Figure 62. TI2 external clock connection example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
Figure 63. Control circuit in external clock mode 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
Figure 64. External trigger input block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
Figure 65. Control circuit in external clock mode 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
Figure 66. Capture/compare channel (example: channel 1 input stage) . . . . . . . . . . . . . . . . . . . . . . 230
Figure 67. Capture/compare channel 1 main circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
Figure 68. Output stage of capture/compare channel (channel 1 to 3) . . . . . . . . . . . . . . . . . . . . . . . 231
Figure 69. Output stage of capture/compare channel (channel 4). . . . . . . . . . . . . . . . . . . . . . . . . . . 231
Figure 70. PWM input mode timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
Figure 71. Output compare mode, toggle on OC1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
Figure 72. Edge-aligned PWM waveforms (ARR=8) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
Figure 73. Center-aligned PWM waveforms (ARR=8) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
Figure 74. Complementary output with dead-time insertion. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
Figure 75. Dead-time waveforms with delay greater than the negative pulse. . . . . . . . . . . . . . . . . . 239
Figure 76. Dead-time waveforms with delay greater than the positive pulse. . . . . . . . . . . . . . . . . . . 239
Figure 77. Output behavior in response to a break.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
Figure 78. Clearing TIMx OCxREF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
Figure 79. 6-step generation, COM example (OSSR=1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
Figure 80. Example of one pulse mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
Figure 81. Example of counter operation in encoder interface mode. . . . . . . . . . . . . . . . . . . . . . . . . 248
Figure 82. Example of encoder interface mode with TI1FP1 polarity inverted. . . . . . . . . . . . . . . . . . 248
Figure 83. Example of hall sensor interface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
Figure 84. Control circuit in reset mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
Figure 85. Control circuit in gated mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
Figure 86. Control circuit in trigger mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
Figure 87. Control circuit in external clock mode 2 + trigger mode . . . . . . . . . . . . . . . . . . . . . . . . . . 254
Figure 88. General-purpose timer block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
Figure 89. Counter timing diagram with prescaler division change from 1 to 2 . . . . . . . . . . . . . . . . . 285
Figure 90. Counter timing diagram with prescaler division change from 1 to 4 . . . . . . . . . . . . . . . . . 286
Figure 91. Counter timing diagram, internal clock divided by 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
Figure 92. Counter timing diagram, internal clock divided by 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
Figure 93. Counter timing diagram, internal clock divided by 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
Figure 94. Counter timing diagram, internal clock divided by N. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
Figure 95. Counter timing diagram, Update event when ARPE=0 (TIMx_ARR not preloaded). . . . . 288
Figure 96. Counter timing diagram, Update event when ARPE=1 (TIMx_ARR preloaded). . . . . . . . 289
Figure 97. Counter timing diagram, internal clock divided by 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
Figure 98. Counter timing diagram, internal clock divided by 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
1 Documentation conventions
1.2 Glossary
• Low-density value line devices are STM32F100xx microcontrollers where the Flash
memory density ranges between 16 and 32 Kbytes.
• Medium-density value line devices are STM32F100xx microcontrollers where the
Flash memory density ranges between 64 and 128 Kbytes.
• High-density value line devices are STM32F100xx microcontrollers where the Flash
memory density ranges between 256 and 512 Kbytes.
• Word: data of 32-bit length.
• Half-word: data of 16-bit length.
• Byte: data of 8-bit length.
32!-
"US MATRIX
$-! $-!
#H
!("