This reference manual targets application developers. It provides complete information on how to use the STM32L0x3 microcontroller memory and peripherals.
The STM32L0x3 is a line of microcontrollers with different memory sizes, packages and peripherals.
For ordering information, mechanical and electrical device characteristics please refer to the corresponding datasheets.
The STM32L0x3 microcontrollers include state-of-the-art patented technology.
| 1 | Documentation conventions . . . . . | 52 |
| 1.1 | General information . . . . . | 52 |
| 1.2 | List of abbreviations for registers . . . . . | 52 |
| 1.3 | Glossary . . . . . | 53 |
| 1.4 | Availability of peripherals . . . . . | 53 |
| 1.5 | Product category definition . . . . . | 53 |
| 2 | System and memory overview . . . . . | 56 |
| 2.1 | System architecture . . . . . | 56 |
| 2.1.1 | S0: Cortex®-bus . . . . . | 57 |
| 2.1.2 | S1: DMA-bus . . . . . | 57 |
| 2.1.3 | BusMatrix . . . . . | 57 |
| AHB/APB bridges . . . . . | 57 |
| 2.2 | Memory organization . . . . . | 58 |
| 2.2.1 | Introduction . . . . . | 58 |
| 2.2.2 | Memory map and register boundary addresses . . . . . | 59 |
| 2.3 | Embedded SRAM . . . . . | 64 |
| 2.4 | Boot configuration . . . . . | 64 |
| Bank swapping (category 5 devices only) . . . . . | 65 |
| Physical remap . . . . . | 65 |
| Embedded bootloader . . . . . | 65 |
| 3 | Flash program memory and data EEPROM (FLASH) . . . . . | 66 |
| 3.1 | Introduction . . . . . | 66 |
| 3.2 | NVM main features . . . . . | 66 |
| 3.3 | NVM functional description . . . . . | 67 |
| 3.3.1 | NVM organization . . . . . | 67 |
| 3.3.2 | Dual-bank boot capability . . . . . | 71 |
| 3.3.3 | Reading the NVM . . . . . | 72 |
| Protocol to read . . . . . | 72 |
| Relation between CPU frequency/Operation mode/NVM read time . . . . . | 73 |
| Data buffering . . . . . | 75 |
| 3.3.4 | Writing/erasing the NVM . . . . . | 81 |
| Write/erase protocol . . . . . | 81 |
| Unlocking/locking operations . . . . . | 82 |
| Detailed description of NVM write/erase operations. . . . . | 85 |
| Parallel write half-page Flash program memory. . . . . | 91 |
| Status register . . . . . | 95 |
| 3.4 Memory protection . . . . . | 96 |
| 3.4.1 RDP (Read Out Protection) . . . . . | 97 |
| 3.4.2 PcROP (Proprietary Code Read-Out Protection) . . . . . | 98 |
| 3.4.3 Protections against unwanted write/erase operations . . . . . | 100 |
| 3.4.4 Write/erase protection management . . . . . | 101 |
| 3.4.5 Protection errors . . . . . | 102 |
| Write protection error flag (WRPERR) . . . . . | 102 |
| Read error (RDERR) . . . . . | 102 |
| 3.5 NVM interrupts . . . . . | 102 |
| 3.5.1 Hard fault . . . . . | 103 |
| 3.6 Memory interface management . . . . . | 103 |
| 3.6.1 Operation priority and evolution . . . . . | 103 |
| Read . . . . . | 103 |
| Write/erase . . . . . | 103 |
| Option byte loading. . . . . | 104 |
| 3.6.2 Sequence of operations . . . . . | 104 |
| Read as data while write . . . . . | 104 |
| Fetch while write. . . . . | 104 |
| Write while another write operation is ongoing. . . . . | 105 |
| 3.6.3 Change the number of wait states while reading . . . . . | 105 |
| 3.6.4 Power-down . . . . . | 105 |
| 3.7 Flash register description . . . . . | 106 |
| Read registers . . . . . | 106 |
| Write to registers . . . . . | 106 |
| 3.7.1 Access control register (FLASH_ACR) . . . . . | 107 |
| 3.7.2 Program and erase control register (FLASH_PECR) . . . . . | 108 |
| 3.7.3 Power-down key register (FLASH_PDKEYR) . . . . . | 112 |
| 3.7.4 PECR unlock key register (FLASH_PEKEYR) . . . . . | 112 |
| 3.7.5 Program and erase key register (FLASH_PRGKEYR) . . . . . | 112 |
| 3.7.6 Option bytes unlock key register (FLASH_OPTKEYR) . . . . . | 113 |
| 3.7.7 Status register (FLASH_SR) . . . . . | 114 |
| 3.7.8 Option bytes register (FLASH_OPTR) . . . . . | 116 |
| 3.7.9 Write protection register 1 (FLASH_WRPROT1) . . . . . | 118 |
| 3.7.10 Write protection register 2 (FLASH_WRPROT2) . . . . . | 119 |
| 7.1 | Reset ..... | 173 |
| 7.1.1 | System reset ..... | 173 |
| Software reset ..... | 173 |
| Low-power management reset ..... | 173 |
| Option byte loader reset ..... | 173 |
| 7.1.2 | Power reset ..... | 174 |
| 7.1.3 | RTC and backup registers reset ..... | 174 |
| 7.2 | Clocks ..... | 175 |
| 7.2.1 | HSE clock ..... | 178 |
| External source (HSE bypass) ..... | 179 |
| External crystal/ceramic resonator (HSE crystal) ..... | 179 |
| 7.2.2 | HSI16 clock ..... | 179 |
| Calibration ..... | 179 |
| 7.2.3 | MSI clock ..... | 180 |
| Calibration ..... | 180 |
| 7.2.4 | HSI48 clock ..... | 180 |
| 7.2.5 | PLL ..... | 181 |
| 7.2.6 | LSE clock ..... | 182 |
| External source (LSE bypass) ..... | 182 |
| 7.2.7 | LSI clock ..... | 182 |
| LSI measurement ..... | 182 |
| 7.2.8 | System clock (SYSCLK) selection ..... | 183 |
| 7.2.9 | System clock source frequency versus voltage range ..... | 183 |
| 7.2.10 | HSE clock security system (CSS) ..... | 183 |
| 7.2.11 | LSE Clock Security System ..... | 184 |
| 7.2.12 | RTC and LCD clock ..... | 184 |
| 7.2.13 | Watchdog clock ..... | 185 |
| 7.2.14 | Clock-out capability ..... | 185 |
| 7.2.15 | Internal/external clock measurement using TIM21 ..... | 185 |
| 7.2.16 | Clock-independent system clock sources for TIM2/TIM21/TIM22 ..... | 186 |
| 7.3 | RCC registers ..... | 187 |
| 7.3.1 | Clock control register (RCC_CR) ..... | 187 |
| 7.3.2 | Internal clock sources calibration register (RCC_ICSCR) ..... | 190 |
| 7.3.3 | Clock recovery RC register (RCC_CRRRCR) ..... | 191 |
| 7.3.4 | Clock configuration register (RCC_CFGR) ..... | 192 |
| 7.3.5 | Clock interrupt enable register (RCC_CIER) ..... | 194 |
| 7.3.6 | Clock interrupt flag register (RCC_CIFR) ..... | 196 |
| 7.3.7 | Clock interrupt clear register (RCC_CICR) ..... | 197 |
| 8.7.4 | CRS interrupt flag clear register (CRS_ICR) . . . . . | 235 |
| 8.7.5 | CRS register map . . . . . | 235 |
| 9 | General-purpose I/Os (GPIO) . . . . . | 237 |
| 9.1 | Introduction . . . . . | 237 |
| 9.2 | GPIO main features . . . . . | 237 |
| 9.3 | GPIO functional description . . . . . | 237 |
| 9.3.1 | General-purpose I/O (GPIO) . . . . . | 239 |
| 9.3.2 | I/O pin alternate function multiplexer and mapping . . . . . | 240 |
| 9.3.3 | I/O port control registers . . . . . | 241 |
| 9.3.4 | I/O port data registers . . . . . | 241 |
| 9.3.5 | I/O data bitwise handling . . . . . | 241 |
| 9.3.6 | GPIO locking mechanism . . . . . | 241 |
| 9.3.7 | I/O alternate function input/output . . . . . | 242 |
| 9.3.8 | External interrupt/wakeup lines . . . . . | 242 |
| 9.3.9 | Input configuration . . . . . | 242 |
| 9.3.10 | Output configuration . . . . . | 243 |
| 9.3.11 | Alternate function configuration . . . . . | 244 |
| 9.3.12 | Analog configuration . . . . . | 245 |
| 9.3.13 | Using the HSE or LSE oscillator pins as GPIOs . . . . . | 246 |
| 9.3.14 | Using the GPIO pins in the RTC supply domain . . . . . | 246 |
| 9.4 | GPIO registers . . . . . | 246 |
| 9.4.1 | GPIO port mode register (GPIOx_MODER) (x = A to E and H) . . . . . | 246 |
| 9.4.2 | GPIO port output type register (GPIOx_OTYPER) (x = A to E and H) . . . . . | 247 |
| 9.4.3 | GPIO port output speed register (GPIOx_OSPEEDR) (x = A to E and H) . . . . . | 247 |
| 9.4.4 | GPIO port pull-up/pull-down register (GPIOx_PUPDR) (x = A to E and H) . . . . . | 248 |
| 9.4.5 | GPIO port input data register (GPIOx_IDR) (x = A to E and H) . . . . . | 248 |
| 9.4.6 | GPIO port output data register (GPIOx_ODR) (x = A to E and H) . . . . . | 249 |
| 9.4.7 | GPIO port bit set/reset register (GPIOx_BSRR) (x = A to E and H) . . . . . | 249 |
| 9.4.8 | GPIO port configuration lock register (GPIOx_LCKR) (x = A to E and H) . . . . . | 249 |
| 14.5.1 | Data register and data alignment (ADC_DR, ALIGN) . . . . . | 320 |
| 14.5.2 | ADC overrun (OVR, OVRMOD) . . . . . | 320 |
| 14.5.3 | Managing a sequence of data converted without using the DMA . . . . . | 321 |
| 14.5.4 | Managing converted data without using the DMA without overrun . . . . . | 321 |
| 14.5.5 | Managing converted data using the DMA . . . . . | 321 |
| DMA one shot mode (DMACFG = 0) . . . . . | 322 |
| DMA circular mode (DMACFG = 1) . . . . . | 322 |
| 14.6 | Low-power features . . . . . | 323 |
| 14.6.1 | Wait mode conversion . . . . . | 323 |
| 14.6.2 | Auto-off mode (AUTOFF) . . . . . | 324 |
| 14.7 | Analog window watchdog (AWDEN, AWDSGL, AWDCH, ADC_TR) . . . . . | 325 |
| 14.7.1 | Description of the analog watchdog . . . . . | 325 |
| 14.7.2 | ADC_AWD1_OUT output signal generation . . . . . | 326 |
| 14.7.3 | Analog watchdog threshold control . . . . . | 328 |
| 14.8 | Oversampler . . . . . | 329 |
| 14.8.1 | ADC operating modes supported when oversampling . . . . . | 331 |
| 14.8.2 | Analog watchdog . . . . . | 331 |
| 14.8.3 | Triggered mode . . . . . | 331 |
| 14.9 | Temperature sensor and internal reference voltage . . . . . | 332 |
| Main features . . . . . | 333 |
| Reading the temperature . . . . . | 333 |
| Calculating the actual V
DDA
voltage using the internal reference voltage . . . . . | 334 |
| Converting a supply-relative ADC measurement to an absolute voltage value . . . . . | 334 |
| 14.10 | VLCD voltage monitoring . . . . . | 334 |
| 14.11 | ADC interrupts . . . . . | 335 |
| 14.12 | ADC registers . . . . . | 336 |
| 14.12.1 | ADC interrupt and status register (ADC_ISR) . . . . . | 336 |
| 14.12.2 | ADC interrupt enable register (ADC_IER) . . . . . | 337 |
| 14.12.3 | ADC control register (ADC_CR) . . . . . | 339 |
| 14.12.4 | ADC configuration register 1 (ADC_CFGR1) . . . . . | 341 |
| 14.12.5 | ADC configuration register 2 (ADC_CFGR2) . . . . . | 345 |
| 14.12.6 | ADC sampling time register (ADC_SMPR) . . . . . | 346 |
| 14.12.7 | ADC watchdog threshold register (ADC_TR) . . . . . | 347 |
| 14.12.8 | ADC channel selection register (ADC_CHSELR) . . . . . | 347 |
| 14.12.9 | ADC data register (ADC_DR) . . . . . | 348 |
| 14.12.10 | ADC Calibration factor (ADC_CALFACT) . . . . . | 348 |
| 17 | Liquid crystal display controller (LCD) . . . . . | 383 |
| 17.1 | Introduction . . . . . | 383 |
| Glossary . . . . . | 383 |
| 17.2 | LCD main features . . . . . | 384 |
| 17.3 | LCD implementation . . . . . | 385 |
| 17.4 | LCD functional description . . . . . | 385 |
| 17.4.1 | General description . . . . . | 385 |
| 17.4.2 | Frequency generator . . . . . | 386 |
| 17.4.3 | Common driver . . . . . | 387 |
| COM signal bias . . . . . | 387 |
| COM signal duty . . . . . | 388 |
| 8 to 1 Mux. . . . . | 390 |
| 17.4.4 | Segment driver . . . . . | 390 |
| In the case of 1/4 or 1/8 duty . . . . . | 390 |
| Blink . . . . . | 394 |
| 17.4.5 | Voltage generator and contrast control . . . . . | 394 |
| LCD supply source . . . . . | 394 |
| LCD intermediate voltages . . . . . | 395 |
| LCD drive selection . . . . . | 395 |
| External decoupling . . . . . | 397 |
| Deadtime . . . . . | 397 |
| 17.4.6 | Double buffer memory . . . . . | 398 |
| 17.4.7 | COM and SEG multiplexing . . . . . | 398 |
| Output pins versus duty modes . . . . . | 398 |
| Remapping capability for small packages . . . . . | 398 |
| Summary of COM and SEG functions versus duty and remap . . . . . | 399 |
| 17.4.8 | Flowchart . . . . . | 403 |
| 17.5 | LCD low-power modes . . . . . | 404 |
| 17.6 | LCD interrupts . . . . . | 404 |
| Start of frame (SOF) . . . . . | 404 |
| Update display done (UDD) . . . . . | 404 |
| 17.7 | LCD registers . . . . . | 405 |
| 17.7.1 | LCD control register (LCD_CR) . . . . . | 405 |
| 17.7.2 | LCD frame control register (LCD_FCR) . . . . . | 406 |
| 17.7.3 | LCD status register (LCD_SR) . . . . . | 408 |
| 17.7.4 | LCD clear register (LCD_CLR) . . . . . | 409 |
| 17.7.5 | LCD display memory (LCD_RAM) . . . . . | 410 |
| 17.7.6 | LCD register map . . . . . | 411 |
| 18 | Touch sensing controller (TSC) . . . . . | 413 |
| 18.1 | Introduction . . . . . | 413 |
| 18.2 | TSC main features . . . . . | 413 |
| 18.3 | TSC functional description . . . . . | 414 |
| 18.3.1 | TSC block diagram . . . . . | 414 |
| 18.3.2 | Surface charge transfer acquisition overview . . . . . | 414 |
| 18.3.3 | Reset and clocks . . . . . | 416 |
| 18.3.4 | Charge transfer acquisition sequence . . . . . | 417 |
| 18.3.5 | Spread spectrum feature . . . . . | 418 |
| 18.3.6 | Max count error . . . . . | 418 |
| 18.3.7 | Sampling capacitor I/O and channel I/O mode selection . . . . . | 419 |
| 18.3.8 | Acquisition mode . . . . . | 420 |
| 18.3.9 | I/O hysteresis and analog switch control . . . . . | 420 |
| 18.4 | TSC low-power modes . . . . . | 421 |
| 18.5 | TSC interrupts . . . . . | 421 |
| 18.6 | TSC registers . . . . . | 422 |
| 18.6.1 | TSC control register (TSC_CR) . . . . . | 422 |
| 18.6.2 | TSC interrupt enable register (TSC_IER) . . . . . | 424 |
| 18.6.3 | TSC interrupt clear register (TSC_ICR) . . . . . | 425 |
| 18.6.4 | TSC interrupt status register (TSC_ISR) . . . . . | 426 |
| 18.6.5 | TSC I/O hysteresis control register (TSC_IOHCR) . . . . . | 426 |
| 18.6.6 | TSC I/O analog switch control register (TSC_IOASCR) . . . . . | 427 |
| 18.6.7 | TSC I/O sampling control register (TSC_IOSCR) . . . . . | 427 |
| 18.6.8 | TSC I/O channel control register (TSC_IOCCR) . . . . . | 428 |
| 18.6.9 | TSC I/O group control status register (TSC_IOGCSR) . . . . . | 428 |
| 18.6.10 | TSC I/O group x counter register (TSC_IOGxCR) . . . . . | 429 |
| 18.6.11 | TSC register map . . . . . | 430 |
| 19 | AES hardware accelerator (AES) . . . . . | 432 |
| 19.1 | Introduction . . . . . | 432 |
| 19.2 | AES main features . . . . . | 432 |
| 19.3 | AES implementation . . . . . | 433 |
| 19.4 | AES functional description . . . . . | 433 |
| 19.4.1 | AES block diagram . . . . . | 433 |
| 19.4.2 | AES internal signals . . . . . | 433 |
| 20.6 | RNG entropy source validation . . . . . | 473 |
| 20.6.1 | Introduction . . . . . | 473 |
| 20.6.2 | Validation conditions . . . . . | 473 |
| 20.6.3 | Data collection . . . . . | 473 |
| 20.7 | RNG registers . . . . . | 473 |
| 20.7.1 | RNG control register (RNG_CR) . . . . . | 473 |
| 20.7.2 | RNG status register (RNG_SR) . . . . . | 475 |
| 20.7.3 | RNG data register (RNG_DR) . . . . . | 476 |
| 20.7.4 | RNG register map . . . . . | 476 |
| 21 | General-purpose timers (TIM2/TIM3) . . . . . | 477 |
| 21.1 | TIM2/TIM3 introduction . . . . . | 477 |
| 21.2 | TIM2/TIM3 main features . . . . . | 477 |
| 21.3 | TIM2/TIM3 functional description . . . . . | 479 |
| 21.3.1 | Time-base unit . . . . . | 479 |
| Prescaler description . . . . . | 479 |
| 21.3.2 | Counter modes . . . . . | 481 |
| Upcounting mode . . . . . | 481 |
| Downcounting mode . . . . . | 484 |
| Center-aligned mode (up/down counting) . . . . . | 487 |
| 21.3.3 | Clock selection . . . . . | 491 |
| Internal clock source (CK_INT) . . . . . | 491 |
| External clock source mode 1 . . . . . | 492 |
| External clock source mode 2 . . . . . | 494 |
| 21.3.4 | Capture/compare channels . . . . . | 495 |
| 21.3.5 | Input capture mode . . . . . | 497 |
| 21.3.6 | PWM input mode . . . . . | 499 |
| 21.3.7 | Forced output mode . . . . . | 500 |
| 21.3.8 | Output compare mode . . . . . | 500 |
| 21.3.9 | PWM mode . . . . . | 501 |
| PWM edge-aligned mode . . . . . | 502 |
| Downcounting configuration . . . . . | 503 |
| PWM center-aligned mode . . . . . | 503 |
| 21.3.10 | One-pulse mode . . . . . | 505 |
| Particular case: OCx fast enable: . . . . . | 506 |
| 21.3.11 | Clearing the OCxREF signal on an external event . . . . . | 506 |
| 21.3.12 | Encoder interface mode . . . . . | 507 |
| 21.3.13 | Timer input XOR function . . . . . | 509 |
| 21.3.14 | Timers and external trigger synchronization . . . . . | 510 |
| Slave mode: Reset mode . . . . . | 510 |
| Slave mode: Gated mode . . . . . | 511 |
| Slave mode: Trigger mode . . . . . | 512 |
| Slave mode: External Clock mode 2 + trigger mode . . . . . | 513 |
| 21.3.15 | Timer synchronization . . . . . | 514 |
| Using one timer as prescaler for another timer . . . . . | 514 |
| Using one timer to enable another timer . . . . . | 515 |
| Using one timer to start another timer . . . . . | 517 |
| Starting 2 timers synchronously in response to an external trigger . . . . . | 519 |
| 21.3.16 | Debug mode . . . . . | 520 |
| 21.4 | TIM2/TIM3 registers . . . . . | 521 |
| 21.4.1 | TIMx control register 1 (TIMx_CR1) . . . . . | 521 |
| 21.4.2 | TIMx control register 2 (TIMx_CR2) . . . . . | 523 |
| 21.4.3 | TIMx slave mode control register (TIMx_SMCR) . . . . . | 524 |
| 21.4.4 | TIMx DMA/Interrupt enable register (TIMx_DIER) . . . . . | 526 |
| 21.4.5 | TIMx status register (TIMx_SR) . . . . . | 527 |
| 21.4.6 | TIMx event generation register (TIMx_EGR) . . . . . | 529 |
| 21.4.7 | TIMx capture/compare mode register 1 (TIMx_CCMR1) . . . . . | 530 |
| Output compare mode . . . . . | 530 |
| Input capture mode. . . . . | 531 |
| 21.4.8 | TIMx capture/compare mode register 2 (TIMx_CCMR2) . . . . . | 533 |
| Output compare mode . . . . . | 533 |
| Input capture mode. . . . . | 534 |
| 21.4.9 | TIMx capture/compare enable register (TIMx_CCER) . . . . . | 534 |
| 21.4.10 | TIMx counter (TIMx_CNT) . . . . . | 536 |
| 21.4.11 | TIMx prescaler (TIMx_PSC) . . . . . | 536 |
| 21.4.12 | TIMx auto-reload register (TIMx_ARR) . . . . . | 536 |
| 21.4.13 | TIMx capture/compare register 1 (TIMx_CCR1) . . . . . | 537 |
| 21.4.14 | TIMx capture/compare register 2 (TIMx_CCR2) . . . . . | 537 |
| 21.4.15 | TIMx capture/compare register 3 (TIMx_CCR3) . . . . . | 538 |
| 21.4.16 | TIMx capture/compare register 4 (TIMx_CCR4) . . . . . | 538 |
| 21.4.17 | TIMx DMA control register (TIMx_DCR) . . . . . | 539 |
| 21.4.18 | TIMx DMA address for full transfer (TIMx_DMAR) . . . . . | 539 |
| Example of how to use the DMA burst feature . . . . . | 540 |
| 21.4.19 | TIM2 option register (TIM2_OR) . . . . . | 541 |
| 21.4.20 | TIM3 option register (TIM3_OR) . . . . . | 542 |
| 21.5 | TIMx register map . . . . . | 543 |
| 22 | General-purpose timers (TIM21/22) . . . . . | 545 |
| 22.1 | Introduction . . . . . | 545 |
| 22.2 | TIM21/22 main features . . . . . | 545 |
| 22.2.1 | TIM21/22 main features . . . . . | 545 |
| 22.3 | TIM21/22 functional description . . . . . | 547 |
| 22.3.1 | Timebase unit . . . . . | 547 |
| Prescaler description . . . . . | 547 |
| 22.3.2 | Counter modes . . . . . | 549 |
| Upcounting mode . . . . . | 549 |
| Downcounting mode . . . . . | 553 |
| Center-aligned mode (up/down counting) . . . . . | 556 |
| 22.3.3 | Clock selection . . . . . | 560 |
| Internal clock source (CK_INT) . . . . . | 560 |
| External clock source mode 2 . . . . . | 562 |
| 22.3.4 | Capture/compare channels . . . . . | 563 |
| 22.3.5 | Input capture mode . . . . . | 565 |
| 22.3.6 | PWM input mode . . . . . | 567 |
| 22.3.7 | Forced output mode . . . . . | 568 |
| 22.3.8 | Output compare mode . . . . . | 568 |
| 22.3.9 | PWM mode . . . . . | 569 |
| PWM center-aligned mode . . . . . | 571 |
| Hints on using center-aligned mode . . . . . | 572 |
| 22.3.10 | Clearing the OCxREF signal on an external event . . . . . | 572 |
| 22.3.11 | One-pulse mode . . . . . | 573 |
| Particular case: OCx fast enable . . . . . | 575 |
| 22.3.12 | Encoder interface mode . . . . . | 575 |
| 22.3.13 | TIM21/22 external trigger synchronization . . . . . | 577 |
| Slave mode: Reset mode . . . . . | 577 |
| Slave mode: Gated mode . . . . . | 578 |
| Slave mode: Trigger mode . . . . . | 579 |
| 22.3.14 | Timer synchronization (TIM21/22) . . . . . | 580 |
| 22.3.15 | Debug mode . . . . . | 580 |
| 22.4 | TIM21/22 registers . . . . . | 581 |
| 22.4.1 | TIM21/22 control register 1 (TIMx_CR1) . . . . . | 581 |
| 22.4.2 | TIM21/22 control register 2 (TIMx_CR2) . . . . . | 583 |
| 22.4.3 | TIM21/22 slave mode control register (TIMx_SMCR) . . . . . | 584 |
| 22.4.4 | TIM21/22 Interrupt enable register (TIMx_DIER) . . . . . | 587 |
| 22.4.5 | TIM21/22 status register (TIMx_SR) . . . . . | 587 |
| 27.4.2 | GPIOs controlled by the RTC . . . . . | 652 |
| 27.4.3 | Clock and prescalers . . . . . | 653 |
| 27.4.4 | Real-time clock and calendar . . . . . | 654 |
| 27.4.5 | Programmable alarms . . . . . | 655 |
| 27.4.6 | Periodic auto-wakeup . . . . . | 655 |
| 27.4.7 | RTC initialization and configuration . . . . . | 656 |
| RTC register access . . . . . | 656 |
| RTC register write protection . . . . . | 656 |
| Calendar initialization and configuration . . . . . | 656 |
| Daylight saving time . . . . . | 657 |
| Programming the alarm . . . . . | 657 |
| Programming the wakeup timer . . . . . | 657 |
| 27.4.8 | Reading the calendar . . . . . | 657 |
| When BYPSHAD control bit is cleared in the RTC_CR register. . . . . | 657 |
| When the BYPSHAD control bit is set in the RTC_CR register (bypass shadow registers) . . . . . | 658 |
| 27.4.9 | Resetting the RTC . . . . . | 658 |
| 27.4.10 | RTC synchronization . . . . . | 659 |
| 27.4.11 | RTC reference clock detection . . . . . | 659 |
| 27.4.12 | RTC smooth digital calibration . . . . . | 660 |
| Calibration when PREDIV_A<3 . . . . . | 661 |
| Verifying the RTC calibration . . . . . | 661 |
| Re-calibration on-the-fly . . . . . | 662 |
| 27.4.13 | Time-stamp function . . . . . | 662 |
| 27.4.14 | Tamper detection . . . . . | 663 |
| RTC backup registers . . . . . | 663 |
| Tamper detection initialization . . . . . | 663 |
| Trigger output generation on tamper event . . . . . | 664 |
| Timestamp on tamper event . . . . . | 664 |
| Edge detection on tamper inputs . . . . . | 664 |
| Level detection with filtering on RTC_TAMPx inputs . . . . . | 664 |
| 27.4.15 | Calibration clock output . . . . . | 665 |
| 27.4.16 | Alarm output . . . . . | 665 |
| Alarm output . . . . . | 665 |
| 27.5 | RTC low-power modes . . . . . | 666 |
| 27.6 | RTC interrupts . . . . . | 666 |
| 27.7 | RTC registers . . . . . | 667 |
| 27.7.1 | RTC time register (RTC_TR) . . . . . | 667 |
| 27.7.2 | RTC date register (RTC_DR) . . . . . | 668 |
| Idle characters . . . . . | 771 |
| 29.5.3 USART receiver . . . . . | 772 |
| Start bit detection . . . . . | 772 |
| Character reception . . . . . | 773 |
| Break character . . . . . | 773 |
| Idle character . . . . . | 773 |
| Overrun error . . . . . | 774 |
| Selecting the proper oversampling method . . . . . | 774 |
| Framing error . . . . . | 776 |
| Configurable stop bits during reception . . . . . | 777 |
| 29.5.4 USART baud rate generation . . . . . | 777 |
| How to derive USARTDIV from USART_BRR register values . . . . . | 778 |
| 29.5.5 Tolerance of the USART receiver to clock deviation . . . . . | 779 |
| 29.5.6 USART auto baud rate detection . . . . . | 781 |
| 29.5.7 Multiprocessor communication using USART . . . . . | 782 |
| Idle line detection (WAKE=0) . . . . . | 783 |
| 4-bit/7-bit address mark detection (WAKE=1) . . . . . | 783 |
| 29.5.8 Modbus communication using USART . . . . . | 784 |
| Modbus/RTU . . . . . | 784 |
| Modbus/ASCII . . . . . | 784 |
| 29.5.9 USART parity control . . . . . | 785 |
| Even parity . . . . . | 785 |
| Odd parity . . . . . | 785 |
| Parity checking in reception . . . . . | 785 |
| Parity generation in transmission . . . . . | 785 |
| 29.5.10 USART LIN (local interconnection network) mode . . . . . | 786 |
| LIN transmission . . . . . | 786 |
| LIN reception . . . . . | 786 |
| 29.5.11 USART synchronous mode . . . . . | 788 |
| 29.5.12 USART Single-wire Half-duplex communication . . . . . | 791 |
| 29.5.13 USART Smartcard mode . . . . . | 791 |
| Block mode (T=1) . . . . . | 794 |
| Direct and inverse convention . . . . . | 795 |
| 29.5.14 USART IrDA SIR ENDEC block . . . . . | 796 |
| IrDA low-power mode . . . . . | 797 |
| 29.5.15 USART continuous communication in DMA mode . . . . . | 798 |
| Transmission using DMA . . . . . | 798 |
| Reception using DMA . . . . . | 799 |
| Error flagging and interrupt generation in multibuffer communication . . . . . | 800 |
| Start bit detection . . . . . | 837 |
| Character reception . . . . . | 838 |
| Break character . . . . . | 838 |
| Idle character . . . . . | 838 |
| Overrun error . . . . . | 839 |
| Selecting the clock source . . . . . | 839 |
| Framing error . . . . . | 840 |
| Configurable stop bits during reception . . . . . | 840 |
| 30.4.4 LPUART baud rate generation . . . . . | 840 |
| 30.4.5 Tolerance of the LPUART receiver to clock deviation . . . . . | 842 |
| 30.4.6 Multiprocessor communication using LPUART . . . . . | 843 |
| Idle line detection (WAKE=0) . . . . . | 843 |
| 4-bit/7-bit address mark detection (WAKE=1) . . . . . | 844 |
| 30.4.7 LPUART parity control . . . . . | 845 |
| Even parity . . . . . | 845 |
| Odd parity . . . . . | 845 |
| Parity checking in reception . . . . . | 846 |
| Parity generation in transmission . . . . . | 846 |
| 30.4.8 Single-wire Half-duplex communication using LPUART . . . . . | 846 |
| 30.4.9 Continuous communication in DMA mode using LPUART . . . . . | 846 |
| Transmission using DMA . . . . . | 847 |
| Reception using DMA . . . . . | 848 |
| Error flagging and interrupt generation in multibuffer communication . . . . . | 849 |
| 30.4.10 RS232 Hardware flow control and RS485 Driver Enable using LPUART . . . . . | 849 |
| RS232 RTS flow control . . . . . | 850 |
| RS232 CTS flow control . . . . . | 850 |
| RS485 Driver Enable . . . . . | 851 |
| 30.4.11 Wakeup from Stop mode using LPUART . . . . . | 852 |
| Using Mute mode with Stop mode . . . . . | 853 |
| Determining the maximum LPUART baud rate allowing to wakeup correctly from Stop mode when the LPUART clock source is the HSI clock . . . . . | 853 |
| 30.5 LPUART in low-power mode . . . . . | 854 |
| 30.6 LPUART interrupts . . . . . | 854 |
| 30.7 LPUART registers . . . . . | 856 |
| 30.7.1 Control register 1 (LPUART_CR1) . . . . . | 856 |
| 30.7.2 Control register 2 (LPUART_CR2) . . . . . | 859 |
| 30.7.3 Control register 3 (LPUART_CR3) . . . . . | 861 |
| 30.7.4 Baud rate register (LPUART_BRR) . . . . . | 863 |
| 30.7.5 Request register (LPUART_RQR) . . . . . | 863 |
| 30.7.6 | Interrupt & status register (LPUART_ISR) . . . . . | 864 |
| 30.7.7 | Interrupt flag clear register (LPUART_ICR) . . . . . | 867 |
| 30.7.8 | Receive data register (LPUART_RDR) . . . . . | 868 |
| 30.7.9 | Transmit data register (LPUART_TDR) . . . . . | 868 |
| 30.7.10 | LPUART register map . . . . . | 870 |
| 31 | Serial peripheral interface/ inter-IC sound (SPI/I2S) . . . . . | 871 |
| 31.1 | Introduction . . . . . | 871 |
| 31.1.1 | SPI main features . . . . . | 871 |
| 31.1.2 | SPI extended features . . . . . | 872 |
| 31.1.3 | I2S features . . . . . | 872 |
| 31.2 | SPI/I2S implementation . . . . . | 872 |
| 31.3 | SPI functional description . . . . . | 873 |
| 31.3.1 | General description . . . . . | 873 |
| 31.3.2 | Communications between one master and one slave . . . . . | 874 |
| Full-duplex communication . . . . . | 874 |
| Half-duplex communication . . . . . | 874 |
| Simplex communications . . . . . | 875 |
| 31.3.3 | Standard multi-slave communication . . . . . | 877 |
| 31.3.4 | Multi-master communication . . . . . | 878 |
| 31.3.5 | Slave select (NSS) pin management . . . . . | 878 |
| 31.3.6 | Communication formats . . . . . | 880 |
| Clock phase and polarity controls . . . . . | 880 |
| Data frame format . . . . . | 881 |
| 31.3.7 | SPI configuration . . . . . | 882 |
| 31.3.8 | Procedure for enabling SPI . . . . . | 882 |
| 31.3.9 | Data transmission and reception procedures . . . . . | 883 |
| Rx and Tx buffers . . . . . | 883 |
| Tx buffer handling . . . . . | 883 |
| Rx buffer handling . . . . . | 883 |
| Sequence handling . . . . . | 883 |
| 31.3.10 | Procedure for disabling the SPI . . . . . | 885 |
| 31.3.11 | Communication using DMA (direct memory addressing) . . . . . | 886 |
| 31.3.12 | SPI status flags . . . . . | 888 |
| Tx buffer empty flag (TXE) . . . . . | 888 |
| Rx buffer not empty (RXNE) . . . . . | 888 |
| Busy flag (BSY) . . . . . | 888 |
| 31.3.13 | SPI error flags . . . . . | 889 |
| Overrun flag (OVR) . . . . . | 889 |
| Mode fault (MODF) . . . . . | 889 |
| CRC error (CRCERR) . . . . . | 890 |
| TI mode frame format error (FRE) . . . . . | 890 |
| 31.4 SPI special features . . . . . | 890 |
| 31.4.1 TI mode . . . . . | 890 |
| TI protocol in master mode . . . . . | 890 |
| 31.4.2 CRC calculation . . . . . | 891 |
| CRC principle . . . . . | 891 |
| CRC transfer managed by CPU . . . . . | 891 |
| CRC transfer managed by DMA . . . . . | 892 |
| Resetting the SPIx_TXCRC and SPIx_RXCRC values . . . . . | 892 |
| 31.5 SPI interrupts . . . . . | 893 |
| 31.6 I
2
S functional description . . . . . | 894 |
| 31.6.1 I
2
S general description . . . . . | 894 |
| 31.6.2 I
2
S full-duplex . . . . . | 895 |
| 31.6.3 Supported audio protocols . . . . . | 896 |
| I
2
S Philips standard . . . . . | 897 |
| MSB justified standard . . . . . | 899 |
| LSB justified standard . . . . . | 900 |
| PCM standard . . . . . | 902 |
| 31.6.4 Clock generator . . . . . | 903 |
| 31.6.5 I
2
S master mode . . . . . | 905 |
| Procedure . . . . . | 905 |
| Transmission sequence . . . . . | 905 |
| Reception sequence . . . . . | 906 |
| 31.6.6 I
2
S slave mode . . . . . | 907 |
| Transmission sequence . . . . . | 907 |
| Reception sequence . . . . . | 908 |
| 31.6.7 I
2
S status flags . . . . . | 908 |
| Busy flag (BSY) . . . . . | 908 |
| Tx buffer empty flag (TXE) . . . . . | 909 |
| RX buffer not empty (RXNE) . . . . . | 909 |
| Channel Side flag (CHSIDE) . . . . . | 909 |
| 31.6.8 I
2
S error flags . . . . . | 909 |
| Underrun flag (UDR) . . . . . | 909 |
| Overrun flag (OVR) . . . . . | 910 |
| Frame error flag (FRE) . . . . . | 910 |
| 31.6.9 I
2
S interrupts . . . . . | 910 |
| 31.6.10 DMA features . . . . . | 910 |
| 31.7 | SPI and I
2
S registers . . . . . | 911 |
| 31.7.1 | SPI control register 1 (SPI_CR1) (not used in I
2
S mode) . . . . . | 911 |
| 31.7.2 | SPI control register 2 (SPI_CR2) . . . . . | 913 |
| 31.7.3 | SPI status register (SPI_SR) . . . . . | 914 |
| 31.7.4 | SPI data register (SPI_DR) . . . . . | 916 |
| 31.7.5 | SPI CRC polynomial register (SPI_CRCPR) (not used in I
2
S mode) . . . . . | 916 |
| 31.7.6 | SPI RX CRC register (SPI_RXCRCR) (not used in I
2
S mode) . . . . . | 917 |
| 31.7.7 | SPI TX CRC register (SPI_TXCRCR) (not used in I
2
S mode) . . . . . | 917 |
| 31.7.8 | SPI_I
2
S configuration register (SPI_I2SCFGR) . . . . . | 918 |
| 31.7.9 | SPI_I
2
S prescaler register (SPI_I2SPR) . . . . . | 919 |
| 31.7.10 | SPI register map . . . . . | 920 |
| 32 | Universal serial bus full-speed device interface (USB) . . . . . | 921 |
| 32.1 | Introduction . . . . . | 921 |
| 32.2 | USB main features . . . . . | 921 |
| 32.3 | USB implementation . . . . . | 921 |
| 32.4 | USB functional description . . . . . | 922 |
| 32.4.1 | Description of USB blocks . . . . . | 923 |
| 32.5 | Programming considerations . . . . . | 924 |
| 32.5.1 | Generic USB device programming . . . . . | 924 |
| 32.5.2 | System and power-on reset . . . . . | 925 |
| USB reset (RESET interrupt) . . . . . | 925 |
| Structure and usage of packet buffers . . . . . | 925 |
| Endpoint initialization . . . . . | 927 |
| IN packets (data transmission) . . . . . | 927 |
| OUT and SETUP packets (data reception) . . . . . | 928 |
| Control transfers . . . . . | 929 |
| 32.5.3 | Double-buffered endpoints . . . . . | 930 |
| 32.5.4 | Isochronous transfers . . . . . | 932 |
| 32.5.5 | Suspend/Resume events . . . . . | 933 |
| 32.6 | USB and USB SRAM registers . . . . . | 936 |
| 32.6.1 | Common registers . . . . . | 936 |
| USB control register (USB_CNTR) . . . . . | 936 |
| USB interrupt status register (USB_ISTR) . . . . . | 938 |
| USB frame number register (USB_FNR) . . . . . | 941 |
| USB device address (USB_DADDR) . . . . . | 941 |
| Buffer table address (USB_BTABLE) . . . . . | 942 |
| A.5.2 | Alternate function selection sequence code example . . . . . | 982 |
| A.5.3 | Analog GPIO configuration code example . . . . . | 982 |
| A.6 | DMA . . . . . | 983 |
| A.6.1 | DMA Channel Configuration sequence code example . . . . . | 983 |
| A.7 | Interrupts and event . . . . . | 983 |
| A.7.1 | NVIC initialization example . . . . . | 983 |
| A.7.2 | Extended interrupt selection code example . . . . . | 983 |
| A.8 | ADC . . . . . | 984 |
| A.8.1 | Calibration code example . . . . . | 984 |
| A.8.2 | ADC enable sequence code example . . . . . | 984 |
| A.8.3 | ADC disable sequence code example . . . . . | 985 |
| A.8.4 | ADC clock selection code example . . . . . | 985 |
| A.8.5 | Single conversion sequence code example - Software trigger . . . . . | 985 |
| A.8.6 | Continuous conversion sequence code example - Software trigger . . . . . | 986 |
| A.8.7 | Single conversion sequence code example - Hardware trigger . . . . . | 986 |
| A.8.8 | Continuous conversion sequence code example - Hardware trigger . . . . . | 987 |
| A.8.9 | DMA one shot mode sequence code example . . . . . | 987 |
| A.8.10 | DMA circular mode sequence code example . . . . . | 988 |
| A.8.11 | Wait mode sequence code example . . . . . | 988 |
| A.8.12 | Auto off and no wait mode sequence code example . . . . . | 988 |
| A.8.13 | Auto off and wait mode sequence code example . . . . . | 989 |
| A.8.14 | Analog watchdog code example . . . . . | 989 |
| A.8.15 | Oversampling code example . . . . . | 990 |
| A.8.16 | Temperature configuration code example . . . . . | 990 |
| A.8.17 | Temperature computation code example . . . . . | 990 |
| A.9 | DAC . . . . . | 991 |
| A.9.1 | Independent trigger without wave generation code example . . . . . | 991 |
| A.9.2 | Independent trigger with single triangle generation code example . . . . . | 991 |
| A.9.3 | DMA initialization code example . . . . . | 991 |
| A.10 | TSC code example . . . . . | 992 |
| A.10.1 | TSC configuration code example . . . . . | 992 |
| A.10.2 | TSC interrupt code example . . . . . | 993 |
| A.11 | Timers . . . . . | 993 |
| A.11.1 | Upcounter on TI2 rising edge code example . . . . . | 993 |
| A.11.2 | Up counter on each 2 ETR rising edges code example . . . . . | 993 |
| A.11.3 | Input capture configuration code example . . . . . | 994 |
| A.11.4 | Input capture data management code example . . . . . | 994 |
| A.11.5 | PWM input configuration code example . . . . . | 995 |
| A.11.6 | PWM input with DMA configuration code example . . . . . | 995 |
| A.11.7 | Output compare configuration code example . . . . . | 996 |
| A.11.8 | Edge-aligned PWM configuration example. . . . . | 996 |
| A.11.9 | Center-aligned PWM configuration example . . . . . | 997 |
| A.11.10 | ETR configuration to clear OCxREF code example . . . . . | 997 |
| A.11.11 | Encoder interface code example . . . . . | 998 |
| A.11.12 | Reset mode code example . . . . . | 998 |
| A.11.13 | Gated mode code example. . . . . | 999 |
| A.11.14 | Trigger mode code example . . . . . | 999 |
| A.11.15 | External clock mode 2 + trigger mode code example. . . . . | 1000 |
| A.11.16 | One-Pulse mode code example . . . . . | 1000 |
| A.11.17 | Timer prescaling another timer code example . . . . . | 1001 |
| A.11.18 | Timer enabling another timer code example. . . . . | 1001 |
| A.11.19 | Master and slave synchronization code example . . . . . | 1002 |
| A.11.20 | Two timers synchronized by an external trigger code example . . . . . | 1004 |
| A.11.21 | DMA burst feature code example . . . . . | 1005 |
| A.12 | Low-power timer (LPTIM) . . . . . | 1006 |
| A.12.1 | Pulse counter configuration code example. . . . . | 1006 |
| A.13 | IWDG code example . . . . . | 1006 |
| A.13.1 | IWDG configuration code example . . . . . | 1006 |
| A.13.2 | IWDG configuration with window code example. . . . . | 1006 |
| A.14 | WWDG code example. . . . . | 1007 |
| A.14.1 | WWDG configuration code example. . . . . | 1007 |
| A.15 | RTC code example . . . . . | 1007 |
| A.15.1 | RTC calendar configuration code example. . . . . | 1007 |
| A.15.2 | RTC alarm configuration code example . . . . . | 1008 |
| A.15.3 | RTC WUT configuration code example . . . . . | 1008 |
| A.15.4 | RTC read calendar code example . . . . . | 1009 |
| A.15.5 | RTC calibration code example . . . . . | 1009 |
| A.15.6 | RTC tamper and time stamp configuration code example . . . . . | 1009 |
| A.15.7 | RTC tamper and time stamp code example . . . . . | 1010 |
| A.15.8 | RTC clock output code example . . . . . | 1010 |
| A.16 | I2C code example . . . . . | 1010 |
| A.16.1 | I2C configured in slave mode code example . . . . . | 1010 |
| Table 1. | STM32L0x3 memory density . . . . . | 54 |
| Table 2. | Overview of features per category . . . . . | 54 |
| Table 3. | STM32L0x3 peripheral register boundary addresses . . . . . | 60 |
| Table 4. | Boot modes . . . . . | 64 |
| Table 5. | NVM organization (category 3 devices) . . . . . | 67 |
| Table 6. | NVM organization for UFB = 0 (192 Kbyte category 5 devices) . . . . . | 68 |
| Table 7. | Flash memory and data EEPROM remapping (192 Kbyte category 5 devices) . . . . . | 69 |
| Table 8. | NVM organization for UFB = 0 (128 Kbyte category 5 devices) . . . . . | 69 |
| Table 9. | Flash memory and data EEPROM remapping (128 Kbyte category 5 devices) . . . . . | 70 |
| Table 10. | NVM organization for UFB = 0 (64 Kbyte category 5 devices) . . . . . | 70 |
| Table 11. | Boot pin and BFB2 bit configuration . . . . . | 71 |
| Table 12. | Link between master clock power range and frequencies . . . . . | 73 |
| Table 13. | Delays to memory access and number of wait states . . . . . | 73 |
| Table 14. | Internal buffer management . . . . . | 76 |
| Table 15. | Configurations for buffers and speculative reading . . . . . | 79 |
| Table 16. | Dhrystone performances in all memory interface configurations . . . . . | 80 |
| Table 17. | NVM write/erase timings . . . . . | 94 |
| Table 18. | NVM write/erase duration . . . . . | 94 |
| Table 19. | Protection level and content of RDP Option bytes . . . . . | 98 |
| Table 20. | Link between protection bits of FLASH_WRPROTx register and protected address in Flash program memory . . . . . | 99 |
| Table 21. | Memory access vs mode, protection and Flash program memory sectors . . . . . | 100 |
| Table 22. | Flash interrupt request . . . . . | 103 |
| Table 23. | Flash interface - register map and reset values . . . . . | 120 |
| Table 24. | Option byte format . . . . . | 121 |
| Table 25. | Option byte organization . . . . . | 121 |
| Table 26. | CRC internal input/output signals . . . . . | 124 |
| Table 27. | CRC register map and reset values . . . . . | 129 |
| Table 28. | Segment accesses according to the Firewall state . . . . . | 133 |
| Table 29. | Segment granularity and area ranges . . . . . | 134 |
| Table 30. | Firewall register map and reset values . . . . . | 141 |
| Table 31. | Performance versus VCORE ranges . . . . . | 146 |
| Table 32. | Summary of low-power modes . . . . . | 153 |
| Table 33. | Sleep-now . . . . . | 157 |
| Table 34. | Sleep-on-exit . . . . . | 158 |
| Table 35. | Sleep-now (Low-power sleep) . . . . . | 159 |
| Table 36. | Sleep-on-exit (Low-power sleep) . . . . . | 160 |
| Table 37. | Stop mode . . . . . | 162 |
| Table 38. | Standby mode . . . . . | 164 |
| Table 39. | PWR - register map and reset values . . . . . | 172 |
| Table 40. | HSE/LSE clock sources . . . . . | 178 |
| Table 41. | System clock source frequency . . . . . | 183 |
| Table 42. | RCC register map and reset values . . . . . | 223 |
| Table 43. | CRS features . . . . . | 226 |
| Table 44. | Effect of low-power modes on CRS . . . . . | 230 |
| Table 45. | Interrupt control bits . . . . . | 230 |
| Table 46. | CRS register map and reset values . . . . . | 235 |
| Table 47. | Port bit configuration table . . . . . | 239 |
| Table 48. | GPIO register map and reset values . . . . . | 252 |
| Table 49. | SYSCFG register map and reset values . . . . . | 262 |
| Table 50. | DMA implementation . . . . . | 265 |
| Table 51. | DMA requests for each channel . . . . . | 266 |
| Table 52. | Programmable data width and endian behavior (when PINC = MINC = 1) . . . . . | 274 |
| Table 53. | DMA interrupt requests . . . . . | 275 |
| Table 54. | DMA register map and reset values . . . . . | 285 |
| Table 55. | List of vectors . . . . . | 288 |
| Table 56. | EXTI lines connections . . . . . | 295 |
| Table 57. | Extended interrupt/event controller register map and reset values . . . . . | 300 |
| Table 58. | ADC input/output pins . . . . . | 303 |
| Table 59. | ADC internal input/output signals . . . . . | 304 |
| Table 60. | External triggers . . . . . | 304 |
| Table 61. | Latency between trigger and start of conversion . . . . . | 309 |
| Table 62. | Configuring the trigger polarity . . . . . | 315 |
| Table 63. | tSAR timings depending on resolution . . . . . | 317 |
| Table 64. | Analog watchdog comparison . . . . . | 326 |
| Table 65. | Analog watchdog channel selection . . . . . | 326 |
| Table 66. | Maximum output results vs N and M. Grayed values indicates truncation . . . . . | 330 |
| Table 67. | ADC interrupts . . . . . | 335 |
| Table 68. | ADC register map and reset values . . . . . | 350 |
| Table 69. | DAC pins . . . . . | 353 |
| Table 70. | External triggers . . . . . | 356 |
| Table 71. | DAC register map and reset values . . . . . | 374 |
| Table 72. | COMP register map and reset values . . . . . | 382 |
| Table 73. | Implementation . . . . . | 385 |
| Table 74. | Example of frame rate calculation . . . . . | 386 |
| Table 75. | Blink frequency . . . . . | 394 |
| Table 76. | VLCD rail connections to GPIO pins . . . . . | 397 |
| Table 77. | Remapping capability . . . . . | 399 |
| Table 78. | LCD behavior in low-power modes . . . . . | 404 |
| Table 79. | LCD interrupt requests . . . . . | 404 |
| Table 80. | LCD register map and reset values . . . . . | 411 |
| Table 81. | Acquisition sequence summary . . . . . | 416 |
| Table 82. | Spread spectrum deviation versus AHB clock frequency . . . . . | 418 |
| Table 83. | I/O state depending on its mode and IODEF bit value . . . . . | 419 |
| Table 84. | Effect of low-power modes on TSC . . . . . | 421 |
| Table 85. | Interrupt control bits . . . . . | 421 |
| Table 86. | TSC register map and reset values . . . . . | 430 |
| Table 87. | AES internal input/output signals . . . . . | 433 |
| Table 88. | CTR mode initialization vector definition . . . . . | 449 |
| Table 89. | Key endianness in AES_KEYRx registers . . . . . | 452 |
| Table 90. | DMA channel configuration for memory-to-AES data transfer . . . . . | 453 |
| Table 91. | DMA channel configuration for AES-to-memory data transfer . . . . . | 454 |
| Table 92. | AES interrupt requests . . . . . | 456 |
| Table 93. | Processing latency (in clock cycle) . . . . . | 456 |
| Table 94. | AES register map and reset values . . . . . | 464 |
| Table 95. | RNG internal input/output signals . . . . . | 467 |
| Table 96. | RNG interrupt requests . . . . . | 472 |
| Table 97. | RNG register map and reset map . . . . . | 476 |
| Table 98. | Counting direction versus encoder signals . . . . . | 508 |
| Table 99. | TIM2/TIM3 internal trigger connection . . . . . | 525 |
| Table 100. | Output control bit for standard OCx channels. . . . . | 535 |
| Table 101. | TIM2/3 register map and reset values . . . . . | 543 |
| Table 102. | Counting direction versus encoder signals. . . . . | 576 |
| Table 103. | TIMx Internal trigger connection . . . . . | 586 |
| Table 104. | Output control bit for standard OCx channels. . . . . | 594 |
| Table 105. | TIM21/22 register map and reset values . . . . . | 598 |
| Table 106. | TIM6/7 register map and reset values . . . . . | 612 |
| Table 107. | STM32L0x3 LPTIM features. . . . . | 614 |
| Table 108. | LPTIM1 external trigger connection . . . . . | 615 |
| Table 109. | Prescaler division ratios . . . . . | 616 |
| Table 110. | Encoder counting scenarios . . . . . | 622 |
| Table 111. | Effect of low-power modes on the LPTIM. . . . . | 623 |
| Table 112. | Interrupt events. . . . . | 624 |
| Table 113. | LPTIM register map and reset values. . . . . | 633 |
| Table 114. | IWDG register map and reset values . . . . . | 642 |
| Table 115. | WWDG register map and reset values . . . . . | 648 |
| Table 116. | RTC implementation. . . . . | 650 |
| Table 117. | RTC pin PC13 configuration. . . . . | 652 |
| Table 118. | RTC_OUT mapping . . . . . | 653 |
| Table 119. | Effect of low-power modes on RTC . . . . . | 666 |
| Table 120. | Interrupt control bits . . . . . | 666 |
| Table 121. | RTC register map and reset values . . . . . | 691 |
| Table 122. | STM32L0x3 I2C features . . . . . | 694 |
| Table 123. | I2C input/output pins. . . . . | 697 |
| Table 124. | I2C internal input/output signals . . . . . | 697 |
| Table 125. | Comparison of analog vs. digital filters. . . . . | 699 |
| Table 126. | I2C-SMBus specification data setup and hold times . . . . . | 702 |
| Table 127. | I2C configuration. . . . . | 706 |
| Table 128. | I2C-SMBus specification clock timings. . . . . | 717 |
| Table 129. | Examples of timing settings for f
I2CCLK
= 8 MHz . . . . . | 727 |
| Table 130. | Examples of timings settings for f
I2CCLK
= 16 MHz . . . . . | 727 |
| Table 131. | SMBus timeout specifications. . . . . | 729 |
| Table 132. | SMBus with PEC configuration. . . . . | 732 |
| Table 133. | Examples of TIMEOUTA settings for various I2CCLK frequencies (max t
TIMEOUT
= 25 ms) . . . . . | 733 |
| Table 134. | Examples of TIMEOUTB settings for various I2CCLK frequencies . . . . . | 733 |
| Table 135. | Examples of TIMEOUTA settings for various I2CCLK frequencies (max t
IDLE
= 50 µs) . . . . . | 733 |
| Table 136. | Effect of low-power modes on the I2C . . . . . | 744 |
| Table 137. | I2C Interrupt requests. . . . . | 745 |
| Table 138. | I2C register map and reset values . . . . . | 760 |
| Table 139. | STM32L0x3 USART/LPUART features . . . . . | 764 |
| Table 140. | Noise detection from sampled data . . . . . | 776 |
| Table 141. | Error calculation for programmed baud rates at f
CK
= 32 MHz in both cases of oversampling by 16 or by 8. . . . . | 779 |
| Table 142. | Tolerance of the USART receiver when BRR [3:0] = 0000. . . . . | 780 |
| Table 143. | Tolerance of the USART receiver when BRR [3:0] is different from 0000 . . . . . | 780 |
| Table 144. | Frame formats . . . . . | 785 |
| Table 145. | Effect of low-power modes on the USART. . . . . | 804 |
| Table 146. | USART interrupt requests. . . . . | 804 |
| Table 147. | USART register map and reset values . . . . . | 827 |
| Table 148. | STM32L0x3 USART/LPUART features . . . . . | 831 |
| Table 149. | Error calculation for programmed baud rates at fck = 32.768 kHz . . . . . | 841 |
| Table 150. | Error calculation for programmed baud rates at fck = 32 MHz . . . . . | 841 |
| Table 151. | Tolerance of the LPUART receiver . . . . . | 842 |
| Table 152. | Frame formats . . . . . | 845 |
| Table 153. | Effect of low-power modes on the LPUART . . . . . | 854 |
| Table 154. | LPUART interrupt requests . . . . . | 854 |
| Table 155. | LPUART register map and reset values . . . . . | 870 |
| Table 156. | STM32L0x3 SPI implementation . . . . . | 872 |
| Table 157. | SPI interrupt requests . . . . . | 893 |
| Table 158. | Audio-frequency precision using standard 8 MHz HSE . . . . . | 904 |
| Table 159. | I
2
S interrupt requests . . . . . | 910 |
| Table 160. | SPI register map and reset values . . . . . | 920 |
| Table 161. | STM32L0x3 USB implementation . . . . . | 921 |
| Table 162. | Double-buffering buffer flag definition . . . . . | 931 |
| Table 163. | Bulk double-buffering memory buffers usage . . . . . | 931 |
| Table 164. | Isochronous memory buffers usage . . . . . | 933 |
| Table 165. | Resume event detection . . . . . | 934 |
| Table 166. | Reception status encoding . . . . . | 947 |
| Table 167. | Endpoint type encoding . . . . . | 947 |
| Table 168. | Endpoint kind meaning . . . . . | 947 |
| Table 169. | Transmission status encoding . . . . . | 948 |
| Table 170. | Definition of allocated buffer memory . . . . . | 951 |
| Table 171. | USB register map and reset values . . . . . | 952 |
| Table 172. | SW debug port pins . . . . . | 955 |
| Table 173. | REV_ID values . . . . . | 957 |
| Table 174. | Packet request (8-bits) . . . . . | 957 |
| Table 175. | ACK response (3 bits) . . . . . | 958 |
| Table 176. | DATA transfer (33 bits) . . . . . | 958 |
| Table 177. | SW-DP registers . . . . . | 959 |
| Table 178. | 32-bit debug port registers addressed through the shifted value A[3:2] . . . . . | 960 |
| Table 179. | Core debug registers . . . . . | 961 |
| Table 180. | DBG register map and reset values . . . . . | 968 |
| Table 181. | Document revision history . . . . . | 1019 |
| Figure 1. | System architecture . . . . . | 56 |
| Figure 2. | Memory map . . . . . | 59 |
| Figure 3. | Structure of one internal buffer . . . . . | 75 |
| Figure 4. | Timing to fetch and execute instructions with prefetch disabled . . . . . | 77 |
| Figure 5. | Timing to fetch and execute instructions with prefetch enabled . . . . . | 79 |
| Figure 6. | RDP levels . . . . . | 98 |
| Figure 7. | CRC calculation unit block diagram . . . . . | 124 |
| Figure 8. | STM32L0x3 firewall connection schematics . . . . . | 131 |
| Figure 9. | Firewall functional states . . . . . | 135 |
| Figure 10. | Power supply overview . . . . . | 143 |
| Figure 11. | Performance versus VDD and VCORE range . . . . . | 146 |
| Figure 12. | Power supply supervisors . . . . . | 149 |
| Figure 13. | Power-on reset/power-down reset waveform . . . . . | 150 |
| Figure 14. | BOR thresholds . . . . . | 151 |
| Figure 15. | PVD thresholds . . . . . | 152 |
| Figure 16. | Simplified diagram of the reset circuit . . . . . | 174 |
| Figure 17. | Clock tree . . . . . | 177 |
| Figure 18. | Using TIM21 channel 1 input capture to measure frequencies . . . . . | 185 |
| Figure 19. | CRS block diagram . . . . . | 227 |
| Figure 20. | CRS counter behavior . . . . . | 228 |
| Figure 21. | Basic structure of an I/O port bit . . . . . | 238 |
| Figure 22. | Basic structure of a 5-Volt tolerant I/O port bit . . . . . | 238 |
| Figure 23. | Input floating / pull up / pull down configurations . . . . . | 243 |
| Figure 24. | Output configuration . . . . . | 244 |
| Figure 25. | Alternate function configuration . . . . . | 245 |
| Figure 26. | High impedance-analog configuration . . . . . | 245 |
| Figure 27. | DMA request mapping . . . . . | 266 |
| Figure 28. | DMA block diagram . . . . . | 268 |
| Figure 29. | Extended interrupts and events controller (EXTI) block diagram . . . . . | 292 |
| Figure 30. | Extended interrupt/event GPIO mapping . . . . . | 294 |
| Figure 31. | ADC block diagram . . . . . | 303 |
| Figure 32. | ADC calibration . . . . . | 306 |
| Figure 33. | Calibration factor forcing . . . . . | 307 |
| Figure 34. | Enabling/disabling the ADC . . . . . | 308 |
| Figure 35. | ADC clock scheme . . . . . | 308 |
| Figure 36. | ADC connectivity . . . . . | 310 |
| Figure 37. | Analog to digital conversion time . . . . . | 314 |
| Figure 38. | ADC conversion timings . . . . . | 314 |
| Figure 39. | Stopping an ongoing conversion . . . . . | 315 |
| Figure 40. | Single conversions of a sequence, software trigger . . . . . | 318 |
| Figure 41. | Continuous conversion of a sequence, software trigger . . . . . | 318 |
| Figure 42. | Single conversions of a sequence, hardware trigger . . . . . | 319 |
| Figure 43. | Continuous conversions of a sequence, hardware trigger . . . . . | 319 |
| Figure 44. | Data alignment and resolution (oversampling disabled: OVSE = 0) . . . . . | 320 |
| Figure 45. | Example of overrun (OVR) . . . . . | 321 |
| Figure 46. | Wait mode conversion (continuous mode, software trigger) . . . . . | 323 |
| Figure 47. | Behavior with WAIT = 0, AUTOFF = 1 . . . . . | 324 |
| Figure 48. | Behavior with WAIT = 1, AUTOFF = 1 . . . . . | 325 |
| Figure 49. | Analog watchdog guarded area . . . . . | 326 |
| Figure 50. | ADC_AWD1_OUT signal generation . . . . . | 327 |
| Figure 51. | ADC_AWD1_OUT signal generation (AWD flag not cleared by software) . . . . . | 328 |
| Figure 52. | ADC1_AWD_OUT signal generation (on a single channel) . . . . . | 328 |
| Figure 53. | Analog watchdog threshold update . . . . . | 329 |
| Figure 54. | 20-bit to 16-bit result truncation . . . . . | 330 |
| Figure 55. | Numerical example with 5-bits shift and rounding . . . . . | 330 |
| Figure 56. | Triggered oversampling mode (TOVS bit = 1) . . . . . | 332 |
| Figure 57. | Temperature sensor and VREFINT channel block diagram . . . . . | 333 |
| Figure 58. | DAC block diagram . . . . . | 353 |
| Figure 59. | Data registers in single DAC channel mode . . . . . | 354 |
| Figure 60. | Timing diagram for conversion with trigger disabled TEN = 0 . . . . . | 355 |
| Figure 61. | Data registers in dual DAC channel mode . . . . . | 357 |
| Figure 62. | DAC LFSR register calculation algorithm . . . . . | 361 |
| Figure 63. | DAC conversion (SW trigger enabled) with LFSR wave generation . . . . . | 362 |
| Figure 64. | DAC triangle wave generation . . . . . | 362 |
| Figure 65. | DAC conversion (SW trigger enabled) with triangle wave generation . . . . . | 363 |
| Figure 66. | Comparator 1 and 2 block diagrams . . . . . | 377 |
| Figure 67. | LCD controller block diagram . . . . . | 385 |
| Figure 68. | 1/3 bias, 1/4 duty . . . . . | 388 |
| Figure 69. | Static duty case 1 . . . . . | 389 |
| Figure 70. | Static duty case 2 . . . . . | 389 |
| Figure 71. | 1/2 duty, 1/2 bias . . . . . | 390 |
| Figure 72. | 1/3 duty, 1/3 bias . . . . . | 391 |
| Figure 73. | 1/4 duty, 1/3 bias . . . . . | 392 |
| Figure 74. | 1/8 duty, 1/4 bias . . . . . | 393 |
| Figure 75. | LCD voltage control . . . . . | 396 |
| Figure 76. | Deadtime . . . . . | 397 |
| Figure 77. | SEG/COM mux feature example . . . . . | 402 |
| Figure 78. | Flowchart example . . . . . | 403 |
| Figure 79. | TSC block diagram . . . . . | 414 |
| Figure 80. | Surface charge transfer analog I/O group structure . . . . . | 415 |
| Figure 81. | Sampling capacitor voltage variation . . . . . | 416 |
| Figure 82. | Charge transfer acquisition sequence . . . . . | 417 |
| Figure 83. | Spread spectrum variation principle . . . . . | 418 |
| Figure 84. | AES block diagram . . . . . | 433 |
| Figure 85. | ECB encryption and decryption principle . . . . . | 435 |
| Figure 86. | CBC encryption and decryption principle . . . . . | 436 |
| Figure 87. | CTR encryption and decryption principle . . . . . | 437 |
| Figure 88. | STM32 cryptolib AES flowchart example . . . . . | 438 |
| Figure 89. | Encryption key derivation for ECB/CBC decryption (Mode 2). . . . . | 441 |
| Figure 90. | Example of suspend mode management . . . . . | 442 |
| Figure 91. | ECB encryption . . . . . | 442 |
| Figure 92. | ECB decryption . . . . . | 443 |
| Figure 93. | CBC encryption . . . . . | 443 |
| Figure 94. | CBC decryption . . . . . | 444 |
| Figure 95. | ECB/CBC encryption (Mode 1) . . . . . | 445 |
| Figure 96. | ECB/CBC decryption (Mode 3) . . . . . | 446 |
| Figure 97. | Message construction in CTR mode . . . . . | 448 |
| Figure 98. | CTR encryption . . . . . | 448 |
| Figure 99. | CTR decryption . . . . . | 449 |
| Figure 100. 128-bit block construction with respect to data swap . . . . . | 451 |
| Figure 101. DMA transfer of a 128-bit data block during input phase . . . . . | 453 |
| Figure 102. DMA transfer of a 128-bit data block during output phase . . . . . | 454 |
| Figure 103. AES interrupt signal generation . . . . . | 456 |
| Figure 104. RNG block diagram . . . . . | 467 |
| Figure 105. Entropy source model . . . . . | 468 |
| Figure 106. General-purpose timer block diagram . . . . . | 478 |
| Figure 107. Counter timing diagram with prescaler division change from 1 to 2 . . . . . | 480 |
| Figure 108. Counter timing diagram with prescaler division change from 1 to 4 . . . . . | 480 |
| Figure 109. Counter timing diagram, internal clock divided by 1 . . . . . | 481 |
| Figure 110. Counter timing diagram, internal clock divided by 2 . . . . . | 482 |
| Figure 111. Counter timing diagram, internal clock divided by 4 . . . . . | 482 |
| Figure 112. Counter timing diagram, internal clock divided by N . . . . . | 483 |
| Figure 113. Counter timing diagram, Update event when ARPE=0 (TIMx_ARR not preloaded). . . . . | 483 |
| Figure 114. Counter timing diagram, Update event when ARPE=1 (TIMx_ARR preloaded). . . . . | 484 |
| Figure 115. Counter timing diagram, internal clock divided by 1 . . . . . | 485 |
| Figure 116. Counter timing diagram, internal clock divided by 2 . . . . . | 485 |
| Figure 117. Counter timing diagram, internal clock divided by 4 . . . . . | 486 |
| Figure 118. Counter timing diagram, internal clock divided by N . . . . . | 486 |
Figure 119. Counter timing diagram, Update event when repetition counter is not used . . . . . | 487 |
| Figure 120. Counter timing diagram, internal clock divided by 1, TIMx_ARR=0x6 . . . . . | 488 |
| Figure 121. Counter timing diagram, internal clock divided by 2 . . . . . | 489 |
| Figure 122. Counter timing diagram, internal clock divided by 4, TIMx_ARR=0x36 . . . . . | 489 |
| Figure 123. Counter timing diagram, internal clock divided by N . . . . . | 490 |
| Figure 124. Counter timing diagram, Update event with ARPE=1 (counter underflow). . . . . | 490 |
| Figure 125. Counter timing diagram, Update event with ARPE=1 (counter overflow). . . . . | 491 |
| Figure 126. Control circuit in normal mode, internal clock divided by 1 . . . . . | 492 |
| Figure 127. TI2 external clock connection example. . . . . | 492 |
| Figure 128. Control circuit in external clock mode 1 . . . . . | 493 |
| Figure 129. External trigger input block . . . . . | 494 |
| Figure 130. Control circuit in external clock mode 2 . . . . . | 495 |
| Figure 131. Capture/compare channel (example: channel 1 input stage). . . . . | 496 |
| Figure 132. Capture/compare channel 1 main circuit . . . . . | 496 |
| Figure 133. Output stage of capture/compare channel (channel 1). . . . . | 497 |
| Figure 134. PWM input mode timing . . . . . | 499 |
| Figure 135. Output compare mode, toggle on OC1. . . . . | 501 |
| Figure 136. Edge-aligned PWM waveforms (ARR=8). . . . . | 502 |
| Figure 137. Center-aligned PWM waveforms (ARR=8). . . . . | 504 |
| Figure 138. Example of one-pulse mode. . . . . | 505 |
| Figure 139. Clearing TIMx_OCxREF . . . . . | 507 |
| Figure 140. Example of counter operation in encoder interface mode . . . . . | 509 |
| Figure 141. Example of encoder interface mode with TI1FP1 polarity inverted . . . . . | 509 |
| Figure 142. Control circuit in reset mode . . . . . | 510 |
| Figure 143. Control circuit in gated mode . . . . . | 511 |
| Figure 144. Control circuit in trigger mode . . . . . | 512 |
| Figure 145. Control circuit in external clock mode 2 + trigger mode . . . . . | 514 |
| Figure 146. Master/Slave timer example . . . . . | 514 |
| Figure 147. Gating timer y with OC1REF of timer x. . . . . | 516 |
| Figure 148. Gating timer y with Enable of timer x . . . . . | 517 |
| Figure 149. Triggering timer y with update of timer x. . . . . | 518 |
| Figure 150. Triggering timer y with Enable of timer x . . . . . | 518 |
| Figure 151. Triggering timer x and y with timer x TI1 input . . . . . | 519 |
| Figure 152. General-purpose timer block diagram (TIM21/22) . . . . . | 546 |
| Figure 153. Counter timing diagram with prescaler division change from 1 to 2 . . . . . | 548 |
| Figure 154. Counter timing diagram with prescaler division change from 1 to 4 . . . . . | 549 |
| Figure 155. Counter timing diagram, internal clock divided by 1 . . . . . | 550 |
| Figure 156. Counter timing diagram, internal clock divided by 2 . . . . . | 551 |
| Figure 157. Counter timing diagram, internal clock divided by 4 . . . . . | 551 |
| Figure 158. Counter timing diagram, internal clock divided by N . . . . . | 552 |
| Figure 159. Counter timing diagram, update event when ARPE=0 (TIMx_ARR not preloaded). . . . . | 552 |
| Figure 160. Counter timing diagram, update event when ARPE=1 (TIMx_ARR preloaded). . . . . | 553 |
| Figure 161. Counter timing diagram, internal clock divided by 1 . . . . . | 554 |
| Figure 162. Counter timing diagram, internal clock divided by 2 . . . . . | 554 |
| Figure 163. Counter timing diagram, internal clock divided by 4 . . . . . | 555 |
| Figure 164. Counter timing diagram, internal clock divided by N . . . . . | 555 |
| Figure 165. Counter timing diagram, internal clock divided by 1, TIMx_ARR=0x6 . . . . . | 557 |
| Figure 166. Counter timing diagram, internal clock divided by 2 . . . . . | 557 |
| Figure 167. Counter timing diagram, internal clock divided by 4, TIMx_ARR=0x36 . . . . . | 558 |
| Figure 168. Counter timing diagram, internal clock divided by N . . . . . | 558 |
| Figure 169. Counter timing diagram, Update event with ARPE=1 (counter underflow). . . . . | 559 |
| Figure 170. Counter timing diagram, Update event with ARPE=1 (counter overflow). . . . . | 559 |
| Figure 171. Control circuit in normal mode, internal clock divided by 1 . . . . . | 560 |
| Figure 172. TI2 external clock connection example. . . . . | 561 |
| Figure 173. Control circuit in external clock mode 1 . . . . . | 562 |
| Figure 174. External trigger input block . . . . . | 562 |
| Figure 175. Control circuit in external clock mode 2 . . . . . | 563 |
| Figure 176. Capture/compare channel (example: channel 1 input stage). . . . . | 564 |
| Figure 177. Capture/compare channel 1 main circuit . . . . . | 564 |
| Figure 178. Output stage of capture/compare channel (channel 1 and 2). . . . . | 565 |
| Figure 179. PWM input mode timing . . . . . | 567 |
| Figure 180. Output compare mode, toggle on OC1 . . . . . | 569 |
| Figure 181. Edge-aligned PWM waveforms (ARR=8). . . . . | 570 |
| Figure 182. Center-aligned PWM waveforms (ARR=8). . . . . | 571 |
| Figure 183. Clearing TIMx_OCxREF . . . . . | 573 |
| Figure 184. Example of one pulse mode . . . . . | 574 |
| Figure 185. Example of counter operation in encoder interface mode . . . . . | 576 |
| Figure 186. Example of encoder interface mode with TI1FP1 polarity inverted . . . . . | 577 |
| Figure 187. Control circuit in reset mode . . . . . | 578 |
| Figure 188. Control circuit in gated mode . . . . . | 579 |
| Figure 189. Control circuit in trigger mode . . . . . | 580 |
| Figure 190. Basic timer block diagram . . . . . | 600 |
| Figure 191. Counter timing diagram with prescaler division change from 1 to 2 . . . . . | 602 |
| Figure 192. Counter timing diagram with prescaler division change from 1 to 4 . . . . . | 602 |
| Figure 193. Counter timing diagram, internal clock divided by 1 . . . . . | 603 |
| Figure 194. Counter timing diagram, internal clock divided by 2 . . . . . | 604 |
| Figure 195. Counter timing diagram, internal clock divided by 4 . . . . . | 604 |
| Figure 196. Counter timing diagram, internal clock divided by N . . . . . | 605 |
| Figure 197. Counter timing diagram, update event when ARPE = 0 (TIMx_ARR not preloaded). . . . . | 605 |
| Figure 198. Counter timing diagram, update event when ARPE=1 (TIMx_ARR preloaded). . . . . | 606 |
| Figure 199. Control circuit in normal mode, internal clock divided by 1 . . . . . | 607 |
| Figure 200. Low-power timer block diagram . . . . . | 614 |
| Figure 201. Glitch filter timing diagram . . . . . | 616 |
| Figure 202. LPTIM output waveform, single counting mode configuration . . . . . | 618 |
Figure 203. LPTIM output waveform, Single counting mode configuration and Set-once mode activated (WAVE bit is set). . . . . | 618 |
| Figure 204. LPTIM output waveform, Continuous counting mode configuration . . . . . | 619 |
| Figure 205. Waveform generation . . . . . | 620 |
| Figure 206. Encoder mode counting sequence . . . . . | 623 |
| Figure 207. Independent watchdog block diagram . . . . . | 634 |
| Figure 208. Watchdog block diagram . . . . . | 644 |
| Figure 209. Window watchdog timing diagram . . . . . | 645 |
| Figure 210. RTC block diagram . . . . . | 651 |
| Figure 211. I2C1/3 block diagram . . . . . | 695 |
| Figure 212. I2C2 block diagram . . . . . | 696 |
| Figure 213. I2C bus protocol . . . . . | 698 |
| Figure 214. Setup and hold timings . . . . . | 700 |
| Figure 215. I2C initialization flow . . . . . | 703 |
| Figure 216. Data reception . . . . . | 704 |
| Figure 217. Data transmission . . . . . | 705 |
| Figure 218. Slave initialization flow . . . . . | 708 |
| Figure 219. Transfer sequence flow for I2C slave transmitter, NOSTRETCH = 0 . . . . . | 710 |
| Figure 220. Transfer sequence flow for I2C slave transmitter, NOSTRETCH = 1 . . . . . | 711 |
| Figure 221. Transfer bus diagrams for I2C slave transmitter . . . . . | 712 |
| Figure 222. Transfer sequence flow for slave receiver with NOSTRETCH = 0 . . . . . | 713 |
| Figure 223. Transfer sequence flow for slave receiver with NOSTRETCH = 1 . . . . . | 714 |
| Figure 224. Transfer bus diagrams for I2C slave receiver . . . . . | 714 |
| Figure 225. Master clock generation . . . . . | 716 |
| Figure 226. Master initialization flow . . . . . | 718 |
| Figure 227. 10-bit address read access with HEAD10R = 0 . . . . . | 718 |
| Figure 228. 10-bit address read access with HEAD10R = 1 . . . . . | 719 |
| Figure 229. Transfer sequence flow for I2C master transmitter for N≤255 bytes . . . . . | 720 |
| Figure 230. Transfer sequence flow for I2C master transmitter for N>255 bytes . . . . . | 721 |
| Figure 231. Transfer bus diagrams for I2C master transmitter . . . . . | 722 |
| Figure 232. Transfer sequence flow for I2C master receiver for N≤255 bytes . . . . . | 724 |
| Figure 233. Transfer sequence flow for I2C master receiver for N >255 bytes . . . . . | 725 |
| Figure 234. Transfer bus diagrams for I2C master receiver . . . . . | 726 |
| Figure 235. Timeout intervals for
\(
t_{LOW:SEXT}
\)
,
\(
t_{LOW:MEXT}
\)
. . . . . | 730 |
| Figure 236. Transfer sequence flow for SMBus slave transmitter N bytes + PEC . . . . . | 734 |
| Figure 237. Transfer bus diagrams for SMBus slave transmitter (SBC=1) . . . . . | 735 |
| Figure 238. Transfer sequence flow for SMBus slave receiver N Bytes + PEC . . . . . | 736 |
| Figure 239. Bus transfer diagrams for SMBus slave receiver (SBC=1). . . . . | 737 |
| Figure 240. Bus transfer diagrams for SMBus master transmitter . . . . . | 738 |
| Figure 241. Bus transfer diagrams for SMBus master receiver . . . . . | 740 |
| Figure 242. USART block diagram . . . . . | 766 |
| Figure 243. Word length programming . . . . . | 768 |
| Figure 244. Configurable stop bits . . . . . | 770 |
| Figure 245. TC/TXE behavior when transmitting . . . . . | 771 |
| Figure 246. Start bit detection when oversampling by 16 or 8 . . . . . | 772 |
| Figure 247. Data sampling when oversampling by 16 . . . . . | 775 |
| Figure 248. Data sampling when oversampling by 8 . . . . . | 776 |
| Figure 249. Mute mode using Idle line detection . . . . . | 783 |
| Figure 250. Mute mode using address mark detection . . . . . | 784 |
| Figure 251. Break detection in LIN mode (11-bit break length - LBDL bit is set) . . . . . | 787 |
| Figure 252. Break detection in LIN mode vs. Framing error detection. . . . . | 788 |
| Figure 253. USART example of synchronous transmission. . . . . | 789 |
| Figure 254. USART data clock timing diagram (M bits = 00) . . . . . | 789 |
| Figure 255. USART data clock timing diagram (M bits = 01) . . . . . | 790 |
| Figure 256. RX data setup/hold time . . . . . | 790 |
| Figure 257. ISO 7816-3 asynchronous protocol . . . . . | 792 |
| Figure 258. Parity error detection using the 1.5 stop bits . . . . . | 793 |
| Figure 259. IrDA SIR ENDEC- block diagram . . . . . | 797 |
| Figure 260. IrDA data modulation (3/16) -Normal Mode . . . . . | 798 |
| Figure 261. Transmission using DMA . . . . . | 799 |
| Figure 262. Reception using DMA . . . . . | 800 |
| Figure 263. Hardware flow control between 2 USARTs . . . . . | 800 |
| Figure 264. RS232 RTS flow control . . . . . | 801 |
| Figure 265. RS232 CTS flow control . . . . . | 802 |
| Figure 266. USART interrupt mapping diagram . . . . . | 805 |
| Figure 267. LPUART block diagram . . . . . | 832 |
| Figure 268. Word length programming . . . . . | 834 |
| Figure 269. Configurable stop bits . . . . . | 835 |
| Figure 270. TC/TXE behavior when transmitting . . . . . | 837 |
| Figure 271. Mute mode using Idle line detection . . . . . | 844 |
| Figure 272. Mute mode using address mark detection . . . . . | 845 |
| Figure 273. Transmission using DMA . . . . . | 848 |
| Figure 274. Reception using DMA . . . . . | 849 |
| Figure 275. Hardware flow control between 2 LPUARTs . . . . . | 849 |
| Figure 276. RS232 RTS flow control . . . . . | 850 |
| Figure 277. RS232 CTS flow control . . . . . | 851 |
| Figure 278. LPUART interrupt mapping diagram . . . . . | 855 |
| Figure 279. SPI block diagram. . . . . | 873 |
| Figure 280. Full-duplex single master/ single slave application. . . . . | 874 |
| Figure 281. Half-duplex single master/ single slave application . . . . . | 875 |
Figure 282. Simplex single master/single slave application (master in transmit-only/ slave in receive-only mode) . . . . . | 876 |
| Figure 283. Master and three independent slaves. . . . . | 877 |
| Figure 284. Multi-master application . . . . . | 878 |
| Figure 285. Hardware/software slave select management . . . . . | 879 |
| Figure 286. Data clock timing diagram . . . . . | 881 |
Figure 287. TXE/RXNE/BSY behavior in master / full-duplex mode (BIDIMODE=0, RXONLY=0) in the case of continuous transfers . . . . . | 884 |
Figure 288. TXE/RXNE/BSY behavior in slave / full-duplex mode (BIDIMODE=0, RXONLY=0) in the case of continuous transfers . . . . . | 885 |
| Figure 289. Transmission using DMA . . . . . | 887 |
| Figure 290. Reception using DMA . . . . . | 888 |
| Figure 291. TI mode transfer . . . . . | 891 |
| Figure 292. I
2
S block diagram . . . . . | 894 |
| Figure 293. Full-duplex communication . . . . . | 896 |
| Figure 294. I
2
S Philips protocol waveforms (16/32-bit full accuracy, CPOL = 0). . . . . | 897 |
| Figure 295. I
2
S Philips standard waveforms (24-bit frame with CPOL = 0). . . . . | 897 |
| Figure 296. Transmitting 0x8EAA33 . . . . . | 898 |
| Figure 297. Receiving 0x8EAA33 . . . . . | 898 |
| Figure 298. I
2
S Philips standard (16-bit extended to 32-bit packet frame with CPOL = 0) . . . . . | 898 |
| Figure 299. Example of 16-bit data frame extended to 32-bit channel frame . . . . . | 899 |
| Figure 300. MSB Justified 16-bit or 32-bit full-accuracy length with CPOL = 0 . . . . . | 899 |
| Figure 301. MSB justified 24-bit frame length with CPOL = 0 . . . . . | 899 |
| Figure 302. MSB justified 16-bit extended to 32-bit packet frame with CPOL = 0 . . . . . | 900 |
| Figure 303. LSB justified 16-bit or 32-bit full-accuracy with CPOL = 0 . . . . . | 900 |
| Figure 304. LSB justified 24-bit frame length with CPOL = 0 . . . . . | 900 |
| Figure 305. Operations required to transmit 0x3478AE. . . . . | 901 |
| Figure 306. Operations required to receive 0x3478AE . . . . . | 901 |
| Figure 307. LSB justified 16-bit extended to 32-bit packet frame with CPOL = 0 . . . . . | 901 |
| Figure 308. Example of 16-bit data frame extended to 32-bit channel frame . . . . . | 902 |
| Figure 309. PCM standard waveforms (16-bit) . . . . . | 902 |
| Figure 310. PCM standard waveforms (16-bit extended to 32-bit packet frame). . . . . | 902 |
| Figure 311. Audio sampling frequency definition . . . . . | 903 |
| Figure 312. I
2
S clock generator architecture . . . . . | 903 |
| Figure 313. USB peripheral block diagram . . . . . | 922 |
| Figure 314. Packet buffer areas with examples of buffer description table locations . . . . . | 926 |
| Figure 315. Block diagram of STM32L0x3 MCU and Cortex
®
-M0+-level debug support . . . . . | 954 |