![]() |
|
If you can't view the Datasheet, Please click here to try to view without PDF Reader . |
|
Datasheet File OCR Text: |
june 2012 doc id 023133 rev 2 1/55 1 stm8l052r8 value line, 8-bit ultralow power mcu, 64-kb flash, 256-bytes data eeprom, rtc, lcd, timers,usart, i2c, spi, adc data brief features operating conditions ? operating power supply: 1.8 v to 3.6 v ? temperature range: -40 c to 85 c low power features ? 5 low power modes: wait, low power run (5.9 a), low power wait (3 a), active-halt with full rtc (1.4 a), halt (400 na) ? dynamic power consumption: 200 a/mhz + 330 a ? ultra-low leakage per i/0: 50 na ? fast wakeup from halt: 4.7 s advanced stm8 core ? harvard architecture and 3-stage pipeline ? max freq. 16 mhz, 16 cisc mips peak ? up to 40 external interrupt sources reset and supply management ? low power, ultra-safe bor reset with 5 programmable thresholds ? ultra low power por/pdr ? programmable voltage detector (pvd) clock management ? 32 khz and 1 to 16 mhz crystal oscillators ? internal 16 mhz factory-trimmed rc ? 38 khz low consumption rc ? clock security system low power rtc ? bcd calendar with alarm interrupt ? digital calibration with +/- 0.5ppm accuracy ? advanced anti-tamper detection lcd: 8x24 or 4x28 w/ step-up converter memories ? 64 kb flash program memory and 256 bytes data eeprom with ecc, rww ? flexible write and read protection modes ? 4 kb of ram dma ? 4 channels supporting adc, spis, i2c, usarts, timers ? 1 channel for memory-to-memory 12-bit adc up to 1 msps/28 channels ? internal reference voltage timers ? three 16-bit timers with 2 channels (used as ic, oc, pwm), quadrature encoder ? one 16-bit advanced control timer with 3 channels, supporting motor control ? one 8-bit timer with 7-bit prescaler ? 2 watchdogs: 1 window, 1 independent ? beeper timer with 1, 2 or 4 khz frequencies communication interfaces ? two synchronous serial interfaces (spi) ?fast i 2 c 400 khz smbus and pmbus ? three usarts (iso 7816 interface + irda) up to 54 i/os, all mappab le on interrupt vectors development support ? fast on-chip programming and non- intrusive debugging with swim ? bootloader using usart lqfp64 www.st.com
contents stm8l052r8 2/55 doc id 023133 rev 2 contents 1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 2 description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.1 device overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.2 ultra low power continuum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 3 functional overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 3.1 low power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 3.2 central processing unit stm8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 3.2.1 advanced stm8 core . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 3.2.2 interrupt controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 3.3 reset and supply management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 3.3.1 power supply scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 3.3.2 power supply supervisor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 3.3.3 voltage regulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 3.4 clock management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 3.5 low power real-time clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 3.6 lcd (liquid crystal display) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 3.7 memories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 3.8 dma . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 3.9 analog-to-digital converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 3.10 system configuration controller and routi ng interface . . . . . . . . . . . . . . . 17 3.11 timers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 3.11.1 tim1 - 16-bit advanced control timer . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 3.11.2 16-bit general purpose timers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 3.11.3 8-bit basic timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 3.12 watchdog timers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 3.12.1 window watchdog timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 3.12.2 independent watchdog timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 3.13 beeper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 3.14 communication interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 3.14.1 spi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 3.14.2 i2c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 stm8l052r8 contents doc id 023133 rev 2 3/55 3.14.3 usart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 3.15 infrared (ir) interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 3.16 development support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 4 pin description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 4.1 system configuration options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 5 memory and register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 5.1 memory mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 5.2 register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 6 interrupt vector mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 7 package characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 7.1 package mechanical data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 8 ordering information scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 9 revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 list of tables stm8l052r8 4/55 doc id 023133 rev 2 list of tables table 1. high density value line stm8l05xxx low power device features and peripheral counts . . . 8 table 2. timer feature comparison . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 table 3. legend/abbreviation for table 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 table 4. high density value line stm8l05xxx pin description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 table 5. flash and ram boundary addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 table 6. i/o port hardware register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 table 7. general hardware register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 table 8. cpu/swim/debug module/interrupt controller registers . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 table 9. interrupt mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 table 10. lqfp64 ? 10 x 10 mm, 64-pin low-profile quad flat package mechanical data . . . . . . . . . 51 table 11. document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 stm8l052r8 list of figures doc id 023133 rev 2 5/55 list of figures figure 1. high density value line stm8l05xxx device block diagram . . . . . . . . . . . . . . . . . . . . . . 10 figure 2. high density value line stm8l05xxx clock tree diagram . . . . . . . . . . . . . . . . . . . . . . . . . 15 figure 3. stm8l052r8 64-pin lqfp64 package pinout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 figure 4. memory map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 figure 5. lqfp64 ? 10 x 10 mm, 64 pin low-profile quad flat package outline . . . . . . . . . . . . . . . . . 51 figure 6. recommended footprint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 figure 7. ordering information scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 introduction stm8l052r8 6/55 doc id 023133 rev 2 1 introduction this document describes the features, pinout, mechanical data and ordering information of the high density value line stm8l052r8 microcontroller with a flash memory density of 64 kbytes. for further details on the whole stmicroelectronics high density family please refer to section 2.2: ultra low power continuum . for detailed information on device operation and registers, refer to the reference manual (rm0031). for information on to the flash program memory and data eeprom, refer to the programming manual (pm0054). for information on the debug module and swim (single wire interface module), refer to the stm8 swim communication protocol and debug module user manual (um0470). for information on the stm8 core, refer to the stm8 cpu programming manual (pm0044). high density value line devices provide the following benefits: integrated system ? 64 kbytes of high density embedded flash program memory ? 256 bytes of data eeprom ? 4 kbytes of ram ? internal high speed and low-power low speed rc ? embedded reset ultra low power consumption ? 1 a in active-halt mode ? clock gated system and optimized power management ? capability to execute from ram for low power wait mode and low power run mode advanced features ? up to 16 mips at 16 mhz cpu clock frequency ? direct memory access (dma) for memory-to-memory or peripheral-to-memory access short development cycles ? application scalability acro ss a common family prod uct architecture with compatible pinout, memory map and modular peripherals ? wide choice of development tools these features make the value line stm8l05xxx ultra low power microcontroller family suitable for a wide range of consumer and mass market applications. refer to table 1: high density value line stm8l05xxx low power device features and peripheral counts and section 3: functional overview for an overview of the complete range of peripherals proposed in this family. figure 1 shows the block diagram of the high density value line stm8l05xxx family. stm8l052r8 description doc id 023133 rev 2 7/55 2 description the high density value line stm8l05xxx devices are members of the stm8l ultra low power 8-bit family. the value line stm8l05xxx ultra low power fam ily features the enhanced stm8 cpu core providing increased processing power (up to 16 mips at 16 mhz) while maintaining the advantages of a cisc architecture with improved code density, a 24-bit linear addressing space and an optimized architecture for low power operations. the family includes an integrated debug module with a hardware interface (swim) which allows non-intrusive in-application debug ging and ultra-fast flash programming. high density value line stm8l0 5xxx microcontrolle rs feature embedded data eeprom and low-power, low-voltage, single- supply program flash memory. all devices offer 12-bit adc, real-time clock, four 16-bit timers, one 8-bit timer as well as standard communication interface such as two spis, i2c, three usarts and 8x24 or 4x28- segment lcd. the 8x24 or 4x 28-segment lcd is available on the high density value line stm8l05xxx. the stm8l05xxx family operates from 1.8 v to 3.6 v and is available in the - 40 to +85 c temperature range. the modular design of the peripheral set allows the same peripherals to be found in different st microcontroller families includ ing 32-bit families. this make s any transition to a different family very easy, and simplified even more by the use of a common set of development tools. all value line stm8l ultra low power products are based on the same architecture with the same memory mapping and a coherent pinout. description stm8l052r8 8/55 doc id 023133 rev 2 2.1 device overview table 1. high density value line stm8l05xxx low power device features and peripheral counts features stm8l052r8 flash (kbytes) 64 data eeprom (bytes) 256 ram (kbytes) 4 lcd 8x24 or 4x28 timers basic 1 (8-bit) general purpose 3 (16-bit) advanced control 1 (16-bit) communication interfaces spi 2 i2c 1 usart 3 gpios 54 (1) 1. the number of gpios given in this table includes the nrst/pa1 pin but the application can use the nrst/pa1 pin as general purpose output only (pa1). 12-bit synchronized adc (number of channels) 1 (28) others rtc, window watchdog, independent watchdog, 16-mhz and 38-khz internal rc, 1- to 16-mhz and 32-khz external oscillator cpu frequency 16 mhz operating voltage 1.8 v to 3.6 v operating temperature -40 to +85 c package lqfp64 stm8l052r8 description doc id 023133 rev 2 9/55 2.2 ultra low power continuum the ultra low power value line stm8l05xxx and stm8l15xxx are fully pin-to-pin, software and feature compatible. besides the full comp atibility within the stm8l family, the devices are part of stmicroelectronics microcontrollers ul tra low power strategy which also includes stm8l101xx and stm32 l15xxx. the stm8l and stm32l families allow a continuum of performance, peripherals, system architecture, and features. they are all based on stmicroelectronics 0.13 m ultra-low leakage process. note: 1 the stm8l05xxx is pin-to-pin compatible with stm8l101xx devices. 2 the stm32l family is pin-to-pin compatible with the general purpose stm32f family. please refer to stm32l15x documentation for more information on these devices. performance all families incorporate highly energy-efficien t cores with both harvar d architecture and pipelined execution: advanced stm8 core fo r stm8l families and arm cortex?-m3 core for stm32l family. in addition specific care for the design architecture has been taken to optimize the ma/dmips and ma/mhz ratios. this allows the ultra low power performance to range from 5 up to 33.3 dmips. shared peripherals stm8l05x, stm8l15x and stm32l15xx share identical peripherals which ensure a very easy migration from one family to another: analog peripheral: adc1 digital peripherals: rtc and some communication interfaces common system strategy to offer flexibility and opti mize performance, the stm8 l and stm32l devices use a common architecture: same power supply range from 1.8 to 3.6 v architecture optimized to reach ultra-low consumption both in low power modes and run mode fast startup strategy from low power modes flexible system clock ultra-safe reset: same reset strategy for both stm8l and stm32l including power-on reset, power-down reset, brownout reset and programmable voltage detector features st ultra low power continuum al so lies in feature compatibility: more than 10 packages with pin count from 20 to 100 pins and size down to 3 x 3 mm memory density ranging from 4 to 128 kbytes functional overview stm8l052r8 10/55 doc id 023133 rev 2 3 functional overview figure 1. high density value line stm8l05xxx device block diagram 1. legend : adc: analog-to-digital converter bor: brownout reset dma: direct memory access i2c: inter-integrated circuit multimaster interface lcd: liquid crystal display por/pdr: power on reset / power down reset rtc: real-time clock spi: serial peripheral interface swim: single wire interface module usart: universal synchronous asyn chronous receiver transmitter wwdg: window watchdog iwdg: independent watchdog - 3 6 # l o c k c o n t r o l l e r a n d # 3 3 # l o c k s ! d d r e s s c o n t r o l a n d d a t a b u s e s + b y t e + b y t e 2 ! - t o c o r e a n d p e r i p h e r a l s ) 7 $ ' k ( z c l o c k 0 o r t ! 0 o r t " 0 o r t # 0 o w e r 6 / , 4 2 % ' , # $ d r i v e r 7 7 $ ' b y t e s 0 o r t $ 0 o r t % " e e p e r 2 4 # 0 r o g r a m m e m o r y $ a t a % % 0 2 / - 6 $ $ 6 $ $ 6 $ $ 6 6 3 3 3 7 ) - 3 # , 3 $ ! 3 0 ) ? - / 3 ) 3 0 ) ? - ) 3 / 3 0 ) ? 3 # + 3 0 ) ? . 3 3 5 3 ! 2 4 ? 2 8 5 3 ! 2 4 ? 4 8 5 3 ! 2 4 ? # + ! $ # ? ) . x 6 $ $ ! 6 3 3 ! 3 - " 6 $ $ ! 6 3 3 ! b i t ! $ # 6 2 % & |