RM0008 Reference Manual - SourceForge

Transcription

RM0008Reference manualSTM32F101xx, STM32F102xx, STM32F103xx, STM32F105xxand STM32F107xx advanced ARM-based 32-bit MCUsIntroductionThis reference manual targets application developers. It provides complete information onhow to use the STM32F101xx, STM32F102xx, STM32F103xx andSTM32F105xx/STM32F107xx microcontroller memory and peripherals. The STM32F101xx,STM32F102xx, STM32F103xx and STM32F105xx/STM32F107xx will be referred to asSTM32F10xxx throughout the document, unless otherwise specified.The STM32F10xxx is a family of microcontrollers with different memory sizes, packages andperipherals.For ordering information, mechanical and electrical device characteristics please refer to thelow-, medium-, high- and XL-density STM32F101xx and STM32F103xx datasheets, to thelow- and medium-density STM32F102xx datasheets and to theSTM32F105xx/STM32F107xx connectivity line datasheet.For information on programming, erasing and protection of the internal Flash memoryplease refer to: PM0075, the Flash programming manual for low-, medium- high-density andconnectivity line STM32F10xxx devices PM0068, the Flash programming manual for XL-density STM32F10xxx devices.For information on the ARM Cortex -M3 core, please refer to the STM32F10xxx Cortex M3 programming manual (PM0056).Related documentsAvailable from www.st.com: STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx/STM32F107xx anddatasheets STM32F10xxx Cortex -M3 programming manual (PM0056) STM32F10xxx Flash programming manual (PM0075) STM32F10xxx XL-density Flash programming manual (PM0068)October 2011Doc ID 13902 Rev 141/1096www.st.com

ContentsRM0008Contents1Overview of the manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402Documentation conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4632.1List of abbreviations for registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462.2Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462.3Peripheral availability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46Memory and bus architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473.1System architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473.2Memory organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493.3Memory map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503.4453.3.1Embedded SRAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533.3.2Bit banding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533.3.3Embedded Flash memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54Boot configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60CRC calculation unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624.1CRC introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624.2CRC main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624.3CRC functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 634.4CRC registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 634.4.1Data register (CRC DR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 634.4.2Independent data register (CRC IDR) . . . . . . . . . . . . . . . . . . . . . . . . . 634.4.3Control register (CRC CR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 644.4.4CRC register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64Power control (PWR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 655.15.2Power supplies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 655.1.1Independent A/D and D/A converter supply and reference voltage . . . . 665.1.2Battery backup domain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 675.1.3Voltage regulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68Power supply supervisor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 685.2.12/1096Power on reset (POR)/power down reset (PDR) . . . . . . . . . . . . . . . . . . 68Doc ID 13902 Rev 14

RM0008Contents5.2.25.35.46Low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 705.3.1Slowing down system clocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 705.3.2Peripheral clock gating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 715.3.3Sleep mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 715.3.4Stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 725.3.5Standby mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 735.3.6Auto-wakeup (AWU) from low-power mode . . . . . . . . . . . . . . . . . . . . . . 75Power control registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 755.4.1Power control register (PWR CR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 755.4.2Power control/status register (PWR CSR) . . . . . . . . . . . . . . . . . . . . . . 775.4.3PWR register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78Backup registers (BKP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 796.1BKP introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 796.2BKP main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 796.3BKP functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 806.47Programmable voltage detector (PVD) . . . . . . . . . . . . . . . . . . . . . . . . . 686.3.1Tamper detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 806.3.2RTC calibration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80BKP registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 816.4.1Backup data register x (BKP DRx) (x 1 .42) . . . . . . . . . . . . . . . . . . . 816.4.2RTC clock calibration register (BKP RTCCR) . . . . . . . . . . . . . . . . . . . . 816.4.3Backup control register (BKP CR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 826.4.4Backup control/status register (BKP CSR) . . . . . . . . . . . . . . . . . . . . . . 826.4.5BKP register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83Low-, medium-, high- and XL-density reset and clockcontrol (RCC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 877.17.2Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 877.1.1System reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 877.1.2Power reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 887.1.3Backup domain reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88Clocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 897.2.1HSE clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 917.2.2HSI clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 927.2.3PLL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93Doc ID 13902 Rev 143/1096

ContentsRM00087.38LSE clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 937.2.5LSI clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 937.2.6System clock (SYSCLK) selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 947.2.7Clock security system (CSS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 947.2.8RTC clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 957.2.9Watchdog clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 957.2.10Clock-out capability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95RCC registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 967.3.1Clock control register (RCC CR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 967.3.2Clock configuration register (RCC CFGR) . . . . . . . . . . . . . . . . . . . . . . 987.3.3Clock interrupt register (RCC CIR) . . . . . . . . . . . . . . . . . . . . . . . . . . . 1017.3.4APB2 peripheral reset register (RCC APB2RSTR) . . . . . . . . . . . . . . 1037.3.5APB1 peripheral reset register (RCC APB1RSTR) . . . . . . . . . . . . . . 1067.3.6AHB peripheral clock enable register (RCC AHBENR) . . . . . . . . . . . 1087.3.7APB2 peripheral clock enable register (RCC APB2ENR) . . . . . . . . . . 1097.3.8APB1 peripheral clock enable register (RCC APB1ENR) . . . . . . . . . . 1117.3.9Backup domain control register (RCC BDCR) . . . . . . . . . . . . . . . . . . 1157.3.10Control/status register (RCC CSR) . . . . . . . . . . . . . . . . . . . . . . . . . . . 1177.3.11RCC register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119Connectivity line devices: reset and clock control (RCC) . . . . . . . . . 1208.18.28.34/10967.2.4Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1208.1.1System reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1208.1.2Power reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1218.1.3Backup domain reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122Clocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1228.2.1HSE clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1248.2.2HSI clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1258.2.3PLLs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1268.2.4LSE clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1268.2.5LSI clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1278.2.6System clock (SYSCLK) selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1278.2.7Clock security system (CSS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1288.2.8RTC clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1288.2.9Watchdog clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1288.2.10Clock-out capability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129RCC registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129Doc ID 13902 Rev 14

RM00089Contents8.3.1Clock control register (RCC CR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1298.3.2Clock configuration register (RCC CFGR) . . . . . . . . . . . . . . . . . . . . . 1318.3.3Clock interrupt register (RCC CIR) . . . . . . . . . . . . . . . . . . . . . . . . . . . 1348.3.4APB2 peripheral reset register (RCC APB2RSTR) . . . . . . . . . . . . . . 1378.3.5APB1 peripheral reset register (RCC APB1RSTR) . . . . . . . . . . . . . . 1388.3.6AHB Peripheral Clock enable register (RCC AHBENR) . . . . . . . . . . . 1418.3.7APB2 peripheral clock enable register (RCC APB2ENR) . . . . . . . . . . 1428.3.8APB1 peripheral clock enable register (RCC APB1ENR) . . . . . . . . . . 1448.3.9Backup domain control register (RCC BDCR) . . . . . . . . . . . . . . . . . . 1468.3.10Control/status register (RCC CSR) . . . . . . . . . . . . . . . . . . . . . . . . . . . 1488.3.11AHB peripheral clock reset register (RCC AHBRSTR) . . . . . . . . . . . . 1498.3.12Clock configuration register2 (RCC CFGR2) . . . . . . . . . . . . . . . . . . . 1508.3.13RCC register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152General-purpose and alternate-function I/Os (GPIOs and AFIOs) . . 1549.19.29.3GPIO functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1549.1.1General-purpose I/O (GPIO) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1569.1.2Atomic bit set or reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1569.1.3External interrupt/wakeup lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1579.1.4Alternate functions (AF) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1579.1.5Software remapping of I/O alternate functions . . . . . . . . . . . . . . . . . . 1579.1.6GPIO locking mechanism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1579.1.7Input configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1589.1.8Output configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1589.1.9Alternate function configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1599.1.10Analog configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1609.1.11GPIO configurations for device peripherals . . . . . . . . . . . . . . . . . . . . . 161GPIO registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1669.2.1Port configuration register low (GPIOx CRL) (x A.G) . . . . . . . . . . . . 1669.2.2Port configuration register high (GPIOx CRH) (x A.G) . . . . . . . . . . . 1679.2.3Port input data register (GPIOx IDR) (x A.G) . . . . . . . . . . . . . . . . . . 1679.2.4Port output data register (GPIOx ODR) (x A.G) . . . . . . . . . . . . . . . . 1689.2.5Port bit set/reset register (GPIOx BSRR) (x A.G) . . . . . . . . . . . . . . . 1689.2.6Port bit reset register (GPIOx BRR) (x A.G) . . . . . . . . . . . . . . . . . . . 1699.2.7Port configuration lock register (GPIOx LCKR) (x A.G) . . . . . . . . . . 169Alternate function I/O and debug configuration (AFIO) . . . . . . . . . . . . . 1709.3.1Using OSC32 IN/OSC32 OUT pins as GPIO ports PC14/PC15 . . . . 170Doc ID 13902 Rev 145/1096

ContentsRM00089.49.510Using OSC IN/OSC OUT pins as GPIO ports PD0/PD1 . . . . . . . . . . 1709.3.3CAN1 alternate function remapping . . . . . . . . . . . . . . . . . . . . . . . . . . . 1719.3.4CAN2 alternate function remapping . . . . . . . . . . . . . . . . . . . . . . . . . . . 1719.3.5JTAG/SWD alternate function remapping . . . . . . . . . . . . . . . . . . . . . . 1719.3.6ADC alternate function remapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1729.3.7Timer alternate function remapping . . . . . . . . . . . . . . . . . . . . . . . . . . . 1739.3.8USART alternate function remapping . . . . . . . . . . . . . . . . . . . . . . . . . 1759.3.9I2C1 alternate function remapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1769.3.10SPI1 alternate function remapping . . . . . . . . . . . . . . . . . . . . . . . . . . . 1769.3.11SPI3/I2S3 alternate function remapping . . . . . . . . . . . . . . . . . . . . . . . 1769.3.12Ethernet alternate function remapping . . . . . . . . . . . . . . . . . . . . . . . . 176AFIO registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1779.4.1Event control register (AFIO EVCR) . . . . . . . . . . . . . . . . . . . . . . . . . . 1789.4.2AF remap and debug I/O configuration register (AFIO MAPR) . . . . . . 1799.4.3External interrupt configuration register 1 (AFIO EXTICR1) . . . . . . . . 1859.4.4External interrupt configuration register 2 (AFIO EXTICR2) . . . . . . . . 1859.4.5External interrupt configuration register 3 (AFIO EXTICR3) . . . . . . . . 1869.4.6External interrupt configuration register 4 (AFIO EXTICR4) . . . . . . . . 1869.4.7AF remap and debug I/O configuration register2 (AFIO MAPR2) . . . . 187GPIO and AFIO register maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188Interrupts and events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19010.110.210.36/10969.3.2Nested vectored interrupt controller (NVIC) . . . . . . . . . . . . . . . . . . . . . . 19010.1.1SysTick calibration value register . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19010.1.2Interrupt and exception vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190External interrupt/event controller (EXTI) . . . . . . . . . . . . . . . . . . . . . . . . 19810.2.1Main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19810.2.2Block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19810.2.3Wakeup event management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19910.2.4Functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19910.2.5External interrupt/event line mapping . . . . . . . . . . . . . . . . . . . . . . . . . 200EXTI registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20210.3.1Interrupt mask register (EXTI IMR) . . . . . . . . . . . . . . . . . . . . . . . . . . . 20210.3.2Event mask register (EXTI EMR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20210.3.3Rising trigger selection register (EXTI RTSR) . . . . . . . . . . . . . . . . . . 20310.3.4Falling trigger selection register (EXTI FTSR) . . . . . . . . . . . . . . . . . . 20310.3.5Software interrupt event register (EXTI SWIER) . . . . . . . . . . . . . . . . . 204Doc ID 13902 Rev 14

RM000811Contents10.3.6Pending register (EXTI PR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20410.3.7EXTI register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205Analog-to-digital converter (ADC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20611.1ADC introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20611.2ADC main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20711.3ADC functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20711.3.1ADC on-off control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21011.3.2ADC clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21011.3.3Channel selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21011.3.4Single conversion mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21011.3.5Continuous conversion mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21111.3.6Timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21111.3.7Analog watchdog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21211.3.8Scan mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21211.3.9Injected channel management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21311.3.10 Discontinuous mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21411.4Calibration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21411.5Data alignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21511.6Channel-by-channel programmable sample time . . . . . . . . . . . . . . . . . . 21611.7Conversion on external trigger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21611.8DMA request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21811.9Dual ADC mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21911.9.1Injected simultaneous mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22111.9.2Regular simultaneous mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22111.9.3Fast interleaved mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22211.9.4Slow interleaved mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22211.9.5Alternate trigger mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22311.9.6Independent mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22411.9.7Combined regular/injected simultaneous mode . . . . . . . . . . . . . . . . . . 22411.9.8Combined regular simultaneous alternate trigger mode . . . . . . . . . . 22411.9.9Combined injected simultaneous interleaved . . . . . . . . . . . . . . . . . . 22511.10 Temperature sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22611.11 ADC interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22711.12 ADC registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22811.12.1 ADC status register (ADC SR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228Doc ID 13902 Rev 147/1096

ContentsRM000811.12.2 ADC control register 1 (ADC CR1) . . . . . . . . . . . . . . . . . . . . . . . . . . . 22911.12.3 ADC control register 2 (ADC CR2) . . . . . . . . . . . . . . . . . . . . . . . . . . . 23111.12.4 ADC sample time register 1 (ADC SMPR1) . . . . . . . . . . . . . . . . . . . . 23511.12.5 ADC sample time register 2 (ADC SMPR2) . . . . . . . . . . . . . . . . . . . . 23611.12.6 ADC injected channel data offset register x (ADC JOFRx)(x 1.4) . . 23611.12.7 ADC watchdog high threshold register (ADC HTR) . . . . . . . . . . . . . . 23711.12.8 ADC watchdog low threshold register (ADC LTR) . . . . . . . . . . . . . . . 23711.12.9 ADC regular sequence register 1 (ADC SQR1) . . . . . . . . . . . . . . . . . 23811.12.10 ADC regular sequence register 2 (ADC SQR2) . . . . . . . . . . . . . . . . . 23911.12.11 ADC regular sequence register 3 (ADC SQR3) . . . . . . . . . . . . . . . . . 24011.12.12 ADC injected sequence register (ADC JSQR) . . . . . . . . . . . . . . . . . . 24111.12.13 ADC injected data register x (ADC JDRx) (x 1.4) . . . . . . . . . . . . . . 24211.12.14 ADC regular data register (ADC DR) . . . . . . . . . . . . . . . . . . . . . . . . . 24211.12.15 ADC register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24312Digital-to-analog converter (DAC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24512.1DAC introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24512.2DAC main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24512.3DAC functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24712.48/109612.3.1DAC channel enable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24712.3.2DAC output buffer enable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24712.3.3DAC data format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24712.3.4DAC conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24812.3.5DAC output voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24912.3.6DAC trigger selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24912.3.7DMA request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25012.3.8Noise generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25012.3.9Triangle-wave generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251Dual DAC channel conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25212.4.1Independent trigger without wave generation . . . . . . . . . . . . . . . . . . . 25212.4.2Independent trigger with same LFSR generation . . . . . . . . . . . . . . . . 25312.4.3Independent trigger with different LFSR generation . . . . . . . . . . . . . . 25312.4.4Independent trigger with same triangle generation . . . . . . . . . . . . . . . 25312.4.5Independent trigger with different triangle generation . . . . . . . . . . . . . 25412.4.6Simultaneous software start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25412.4.7Simultaneous trigger without wave generation . . . . . . . . . . . . . . . . . . 25412.4.8Simultaneous trigger with same LFSR generation . . . . . . . . . . . . . . . 255Doc ID 13902 Rev 14

RM0008Contents12.4.9Simultaneous trigger with different LFSR generation . . . . . . . . . . . . . 25512.4.10 Simultaneous trigger with same triangle generation . . . . . . . . . . . . . . 25512.4.11 Simultaneous trigger with different triangle generation . . . . . . . . . . . . 25612.5DAC registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25612.5.1DAC control register (DAC CR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25612.5.2DAC software trigger register (DAC SWTRIGR) . . . . . . . . . . . . . . . . . 25912.5.3DAC channel1 12-bit right-aligned data holding register(DAC DHR12R1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26012.5.4DAC channel1 12-bit left aligned data holding register(DAC DHR12L1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26012.5.5DAC channel1 8-bit right aligned data holding register(DAC DHR8R1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26012.5.6DAC channel2 12-bit right aligned data holding register(DAC DHR12R2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26112.5.7DAC channel2 12-bit left aligned data holding register(DAC DHR12L2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26112.5.8DAC channel2 8-bit right-aligned data holding register(DAC DHR8R2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26112.5.9Dual DAC 12-bit right-aligned data holding register(DAC DHR12RD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26212.5.10 DUAL DAC 12-bit left aligned data holding register(DAC DHR12LD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26212.5.11 DUAL DAC 8-bit right aligned data holding register(DAC DHR8RD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26312.5.12 DAC channel1 data output register (DAC DOR1) . . . . . . . . . . . . . . . . 26312.5.13 DAC channel2 data output register (DAC DOR2) . . . . . . . . . . . . . . . . 26312.5.14 DAC register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26413Direct memory access controller (DMA) . . . . . . . . . . . . . . . . . . . . . . . 26513.1DMA introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26513.2DMA main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26513.3DMA functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26713.3.1DMA transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26713.3.2Arbiter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26813.3.3DMA channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26813.3.4Programmable data width, data alignment and endians . . . . . . . . . . . 27013.3.5Error management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27113.3.6Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27113.3.7DMA request mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272Doc ID 13902 Rev 149/1096

ContentsRM000813.414DMA registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27513.4.1DMA interrupt status register (DMA ISR) . . . . . . . . . . . . . . . . . . . . . . 27513.4.2DMA interrupt flag clear register (DMA IFCR) . . . . . . . . . . . . . . . . . . 27613.4.3DMA channel x configuration register (DMA CCRx) (x 1.7,where x channel number) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27713.4.4DMA channel x number of data register (DMA CNDTRx) (x 1.7),where x channel number) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2781

PM0075, the Flash programming manual for low-, medium- high-density and connectivity line STM32F10xxx devices PM0068, the Flash programming manual for XL-density STM32F10xxx devices. For information on the ARM Cortex -M3 core, please refer to the STM32F10xxx Cortex -M3 programming manual (PM0056). Related documents Available from www.st.com: