![]() |
|
If you can't view the Datasheet, Please click here to try to view without PDF Reader . |
|
Datasheet File OCR Text: |
this is information on a product in full production. april 2017 docid15962 rev 15 1/142 stm8l151x4, stm8l151x6, stm8l152x4, stm8l152x6 8-bit ultra-low-power mcu, up to 32 kb flash, 1 kb data eeprom, rtc, lcd, timers, usart, i2c, spi, adc, dac, comparators datasheet - production data features ? operating conditions ? operating power supply range 1.8 v to 3.6 v (down to 1.65 v at power down) ? temp. range: - 40 c to 85, 105 or 125 c ? low power features ? 5 low power modes: wait, low power run (5.1 a), low power wait (3 a), active-halt with full rtc (1.3 a ), halt (350 na) ? consumption: 195 a/mhz + 440 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 selectable thresholds ? ultra-low-power por/pdr ? programmable voltage detector (pvd) ? clock management ? 1 to 16 mhz crystal oscillator ? 32 khz crystal oscillator ? internal 16 mhz factory-trimmed rc ? internal 38 khz low consumption rc ? clock security system ? low power rtc ? bcd calendar with alarm interrupt ? auto-wakeup from halt w/ periodic interrupt ? lcd: up to 4x28 segments w/ step-up converter ? memories ? up to 32 kb of flash program memory and 1 kbyte of data eeprom with ecc, rww ? flexible write and read protection modes ? up to 2 kbyte of ram ? dma ? 4 channels; supported peripherals: adc, dac, spi, i2c, usart, timers ? 1 channel for memory-to-memory ? 12-bit dac with output buffer ? 12-bit adc up to 1 msps/25 channels ? t. sensor and internal reference voltage ? 2 ultra-low-power comparators ? 1 with fixed threshol d and 1 rail to rail ? wakeup capability ? timers ? two 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 ? synchronous serial interface (spi) ? fast i2c 400 khz smbus and pmbus ? usart (iso 7816 interface and irda) ? up to 41 i/os, all mappab le on interrupt vectors ? up to 16 capacitive sensing channels supporting touchkey, proximity, linear touch and rotary touch sensors ? development support ? fast on-chip programming and non intrusive debugging with swim ? bootloader using usart ? 96-bit unique id table 1. device summary reference part number stm8l151xx (without lcd) STM8L151C4, stm8l151c6, stm8l151k4, stm8l151k6, stm8l151g4, stm8l151g6 stm8l152xx (with lcd) stm8l152c4, stm8l152c6, stm8l152k4, stm8l152k6 lqfp48 7x7 mm ufqfpn48 lqfp32 7x7 mm ufqfpn32 (5x5 mm) 7x7 mm ufqfpn28 (4x4 mm) wlcsp28 # 3 0 www.st.com
contents stm8l151x4/6, stm8l152x4/6 2/142 docid15962 rev 15 contents 1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2 description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2.1 device overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 2.2 ultra-low-power continuum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 3 functional overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 3.1 low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 3.2 central processing unit stm8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 3.2.1 advanced stm8 core . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 3.2.2 interrupt controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 3.3 reset and supply management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 3.3.1 power supply scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 3.3.2 power supply supervisor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 3.3.3 voltage regulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 3.4 clock management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 3.5 low power real-time clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 3.6 lcd (liquid crystal display) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 3.7 memories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 3.8 dma . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 3.9 analog-to-digital converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 3.10 digital-to-analog converter (dac) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 3.11 ultra-low-power comparators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 3.12 system configuration controller and routi ng interface . . . . . . . . . . . . . . . 21 3.13 touch sensing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 3.14 timers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 3.14.1 tim1 - 16-bit advanced control timer . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 3.14.2 16-bit general purpose timers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 3.14.3 8-bit basic timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 3.15 watchdog timers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 3.15.1 window watchdog timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 3.15.2 independent watchdog timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 docid15962 rev 15 3/142 stm8l151x4/6, stm8l152x4/6 contents 4 3.16 beeper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 3.17 communication interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 3.17.1 spi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 3.17.2 i2c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 3.17.3 usart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 3.18 infrared (ir) interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 3.19 development support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 4 pinout and pin description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 4.1 system configuration options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 5 memory and register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 5.1 memory mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 5.2 register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 6 interrupt vector mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 7 option bytes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 8 unique id . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 9 electrical parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 9.1 parameter conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 9.1.1 minimum and maximum values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 9.1.2 typical values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 9.1.3 typical curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 9.1.4 loading capacitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 9.1.5 pin input voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 9.2 absolute maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 9.3 operating conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 9.3.1 general operating conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 9.3.2 embedded reset and power control bloc k characteristics . . . . . . . . . . . 67 9.3.3 supply current characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 9.3.4 clock and timing characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 9.3.5 memory characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 9.3.6 i/o current injection characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 9.3.7 i/o port pin characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 contents stm8l151x4/6, stm8l152x4/6 4/142 docid15962 rev 15 9.3.8 communication interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 9.3.9 lcd controller (stm8l152xx only) . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 9.3.10 embedded reference voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 9.3.11 temperature sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 9.3.12 comparator characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 9.3.13 12-bit dac characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 9.3.14 12-bit adc1 characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 9.3.15 emc characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 10 package information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 10.1 ecopack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .116 10.2 lqfp48 package information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .116 10.3 ufqfpn48 package information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 10.4 lqfp32 package information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 10.5 ufqfpn32 package information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 10.6 ufqfpn28 package information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 10.7 wlcsp28 package information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 10.8 thermal characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 11 part numbering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 12 revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 docid15962 rev 15 5/142 stm8l151x4/6, stm8l152x4/6 list of tables 6 list of tables table 1. device summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 table 2. medium-density stm8l151x4/6 and stm8l152x4/6 low-power device features and peripheral counts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 table 3. timer feature comparison . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 table 4. legend/abbreviation for table 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 table 5. medium-density stm8l151x4/6 , stm8l152x4/6 pin description. . . . . . . . . . . . . . . . . . . . 29 table 6. flash and ram boundary addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 table 7. factory conversion registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 table 8. i/o port hardware register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 table 9. general hardware register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 table 10. cpu/swim/debug module/interrupt controller registers . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 table 11. interrupt mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 table 12. option byte addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 table 13. option byte description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 table 14. unique id registers (96 bits) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 table 15. voltage characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 table 16. current characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 table 17. thermal characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 table 18. general operating conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 table 19. embedded reset and power control block characterist ics. . . . . . . . . . . . . . . . . . . . . . . . . . 67 table 20. total current consumption in run mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 table 21. total current consumption in wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 table 22. total current consumption and timing in low power run mode at vdd = 1.65 v to 3.6 v . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 table 23. total current consumption in low power wait mode at vdd = 1.65 v to 3.6 v . . . . . . . . . 76 table 24. total current consumption a nd timing in active-halt mode at vdd = 1.65 v to 3.6 v. . . . . 78 table 25. typical current consumption in active-hal t mode, rtc clocked by lse external crystal . . 80 table 26. total current consumption and timing in halt mode at vdd = 1.65 to 3.6 v . . . . . . . . . . . 80 table 27. peripheral current consumption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 table 28. current consumption under external reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 table 29. hse external clock characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 table 30. lse external clock characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 table 31. hse oscillator characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 table 32. lse oscillator characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 table 33. hsi oscillator characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 table 34. lsi oscillator characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 table 35. ram and hardware registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 table 36. flash program and da ta eeprom memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 table 37. i/o current injection susceptibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 table 38. i/o static characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 table 39. output driving current (high sink ports). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 table 40. output driving current (true open drain ports). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 table 41. output driving current (pa0 wi th high sink led driver capability). . . . . . . . . . . . . . . . . . . . 93 table 42. nrst pin characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 table 43. spi1 characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 table 44. i2c characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 table 45. lcd characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 table 46. reference voltage characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 list of tables stm8l151x4/6, stm8l152x4/6 6/142 docid15962 rev 15 table 47. ts characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 table 48. comparator 1 characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 table 49. comparator 2 characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 table 50. dac characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 table 51. dac accuracy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 table 52. dac output on pb4-pb5-pb6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 7 table 53. adc1 characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 table 54. adc1 accuracy with vdda = 3.3 v to 2.5 v. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 table 55. adc1 accuracy with vdda = 2.4 v to 3.6 v. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 table 56. adc1 accuracy with vdda = vref+ = 1.8 v to 2.4 v. . . . . . . . . . . . . . . . . . . . . . . . . . . 110 table 57. r ain max for f adc = 16 mhz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 table 58. ems data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 table 59. emi data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 table 60. esd absolute maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 5 table 61. electrical sensitivities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 table 62. lqfp48 - 48-pin, 7 x 7 mm low-profile quad flat package mechanical data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 table 63. ufqfpn48 - 48-lead, 7 x 7 mm, 0.5 mm pitch, ultra thin fine pitch quad flat package mechanical data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 table 64. lqfp32 - 32-pin, 7 x 7 mm low-profile quad flat package mechanical data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 table 65. ufqfpn32 - 32-pin, 5 x 5 mm, 0.5 mm pitch ultra thin fine pitch quad flat package mechanical data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 table 66. ufqfpn28 - 28-lead, 4 x 4 mm, 0.5 mm pitch, ultra thin fine pitch quad flat package mechanical data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 table 67. wlcsp28 - 28-pin, 1.703 x 2.841 mm, 0.4 mm pitch wafer level chip scale package mechanical data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 table 68. thermal characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 table 69. document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 docid15962 rev 15 7/142 stm8l151x4/6, stm8l152 x4/6 list of figures 8 list of figures figure 1. medium-density stm8l151x4/6 and stm8l152x4/6 device block diagram . . . . . . . . . . . 14 figure 2. medium-density stm8l151x4/6 and stm8l152x4/6 clock tree diagram . . . . . . . . . . . . . 19 figure 3. STM8L151C4, stm8l151c6 48-pin pinout (without lcd). . . . . . . . . . . . . . . . . . . . . . . . . 26 figure 4. stm8l151k4, stm8l151k6 32-pin package pinout (without lcd). . . . . . . . . . . . . . . . . . 26 figure 5. stm8l151gx ufqfpn28 package pinout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 figure 6. stm8l151g4, stm8l151g6 wlcsp28 package pinout . . . . . . . . . . . . . . . . . . . . . . . . . 27 figure 7. stm8l152c4, stm8l152c6 48-pin pinout (with lcd) . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 figure 8. stm8l152k4, stm8l152k6 32-pin package pinout (with lcd) . . . . . . . . . . . . . . . . . . . . 28 figure 9. memory map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 figure 10. pin loading conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 figure 11. pin input voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 figure 12. por/bor thresholds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 figure 13. typ. idd(run) vs. vdd, fcpu = 16 mhz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 figure 14. typ. idd(wait) vs. vdd, fcpu = 16 mhz 1). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 figure 15. typ. idd(lpr) vs. vdd (lsi cloc k source) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 figure 16. typ. idd(lpw) vs. vdd (lsi cloc k source) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 figure 17. hse oscillator circuit diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 figure 18. lse oscillator circuit diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 figure 19. typical hsi frequency vs v dd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 figure 20. typical lsi frequency vs. vdd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 figure 21. typical vil and vih vs vdd (high sink i/os) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 figure 22. typical vil and vih vs vdd (true open drain i/os) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 figure 23. typical pull-up resistance r pu vs v dd with vin=vss . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 figure 24. typical pull-up current i pu vs v dd with vin=vss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 figure 25. typ. vol @ vdd = 3.0 v (high sink ports) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 figure 26. typ. vol @ vdd = 1.8 v (high sink ports) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 figure 27. typ. vol @ vdd = 3.0 v (true open drain ports) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 figure 28. typ. vol @ vdd = 1.8 v (true open drain ports) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 figure 29. typ. vdd - voh @ vdd = 3.0 v (high sink ports) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 figure 30. typ. vdd - voh @ vdd = 1.8 v (high sink ports) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 figure 31. typical nrst pull-up resistance r pu vs v dd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 figure 32. typical nrst pull-up current i pu vs v dd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 figure 33. recommended nrst pin configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 figure 34. spi1 timing diagram - slave mode and cpha=0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 figure 35. spi1 timing diagram - slave mode and cpha=1 (1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 figure 36. spi1 timing diagram - master mode (1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 figure 37. typical application with i2c bus and timing diagram 1) . . . . . . . . . . . . . . . . . . . . . . . . . . 101 figure 38. adc1 accuracy characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 figure 39. typical connection diagram using the adc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 figure 40. maximum dynamic current consumption on v ref+ supply pin during adc conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 figure 41. power supply and reference decoupling (v ref+ not connected to v dda ). . . . . . . . . . . . . 113 figure 42. power supply and reference decoupling (vre f+ connected to vdda) . . . . . . . . . . . . . . 113 figure 43. lqfp48 - 48-pin, 7 x 7 mm low-profile quad flat package outline . . . . . . . . . . . . . . . . . . 116 figure 44. lqfp48 - 48-pin, 7 x 7 mm low-profile quad flat package recommended footprint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 figure 45. lqfp48 marking example (package top view) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 figure 46. ufqfpn48 - 48-lead, 7 x 7 mm, 0.5 mm pitch, ultra thin fine pitch quad flat list of figures stm8l151x4/6, stm8l152x4/6 8/142 docid15962 rev 15 package outline. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 figure 47. ufqfpn48 - 48-lead, 7 x 7 mm, 0.5 mm pitch, ultra thin fine pitch quad flat package recommended footprint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 figure 48. ufqfpn48 marking example (package top view) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 figure 49. lqfp32 - 32-pin, 7 x 7 mm low-profile quad flat package outline . . . . . . . . . . . . . . . . . . 123 figure 50. lqfp32 - 32-pin, 7 x 7 mm low-profile quad flat package recommended footprint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 figure 51. lqfp32 marking example (package top view) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 figure 52. ufqfpn32 - 32-pin, 5 x 5 mm, 0.5 mm pitch ultra thin fine pitch quad flat package outline. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 figure 53. ufqfpn32 - 32-pin, 5 x 5 mm, 0.5 mm pitch ultra thin fine pitch quad flat package recommended footprint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 figure 54. ufqfpn32 marking example (package top view) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 figure 55. ufqfpn28 - 28-lead, 4 x 4 mm, 0.5 mm pitch, ultra thin fine pitch quad flat package outline. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 figure 56. ufqfpn28 - 28-lead, 4 x 4 mm, 0.5 mm pitch, ultra thin fine pitch quad flat package recommended footprint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 figure 57. ufqfpn28 marking example (package top view) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 figure 58. wlcsp28 - 28-pin, 1.703 x 2.841 mm, 0.4 mm pitch wafer level chip scale package outline. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 figure 59. wlcsp28 marking example (package top view) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 figure 60. medium-density stm8l15x ordering information sc heme . . . . . . . . . . . . . . . . . . . . . . . . 136 docid15962 rev 15 9/142 stm8l151x4/6, stm8l152x4/6 introduction 58 1 introduction this document describes the features, pinout, mechanical data and ordering information of the medium-density stm8l151x4/6 and st m8l152x4/6 devices (stm8l151cx/kx/gx, stm8l152cx/kx microcontrollers with a 16-kby te or 32-kbyte flash memory density). these devices are referred to as medium-dens ity devices in the stm8l15x and stm8l16x reference manual (rm0031) and in the stm8l flash programming manual (pm0054). for more details on the whole stmicroelectronics ultra-low-power family please refer to section 2.2: ultra-low-power continuum on page 13 . 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, please refer to the stm8 cpu programming manual (pm0044). the medium-density devices provide the following benefits: ? integrated system ? up to 32 kbyte of medium-density embedded flash program memory ? 1 kbyte of data eeprom ? internal high speed and low-power low speed rc ? embedded reset ? ultra-low power consumption ? 195 a/mhz + 440 a (consumption) ? 0.9 a with lsi 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 all devices offer 12-bit adc, dac, two comparators, real-time clock three 16-bit timers, one 8-bit timer as well as standard communication interface such as spi, i2c and usart. a 4x28-segment lcd is available on the medium-density stm8l152xx line. table 2: medium- density stm8l151x4/6 and stm8l152x4/6 low-power device features and peripheral counts and section 3: functional overview give an overview of the complete range of peripherals proposed in this family. figure 1 on page 14 shows the general block diagram of the device family. introduction stm8l151x4/6, stm8l152x4/6 10/142 docid15962 rev 15 the medium-density stm8l15x microcontroller family is suitable for a wide range of applications: ? medical and hand-held equipment ? application control and user interface ? pc peripherals, gaming, gps and sport equipment ? alarm systems, wired and wireless sensors docid15962 rev 15 11/142 stm8l151x4/6, stm8l152x4/6 description 58 2 description the medium-density stm8l151x4/6 and st m8l152x4/6 devices are members of the stm8l ultra-low-power 8-bit family. the medium-density stm8l15x family operates from 1.8 v to 3.6 v (down to 1.65 v at power down) and is available in the - 40 to +85 c and - 40 to +125 c temperature ranges. the medium-density stm8l15x ultra-low-power family 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 improv ed code density, a 24-bit linear addressing space and an optimized architectu re for low power operations. the family includes an integrated debug modu le with a hardware in terface (swim) which allows non-intrusive in-application debug ging and ultra-fast flash programming. all medium-density stm8l15x microcontrollers fe ature embedded da ta eeprom and low- power, low-voltage, single-supply program flash memory. they incorporate an extensive rang e of enhanced i/os and peripherals. the modular design of the peripheral set allows the same peripherals to be found in different st microcontroller fam ilies including 32-bit families. this makes any transition to a different family very easy, and simplified even more by the use of a common set of development tools. six different packages are proposed from 28 to 48 pins. depending on the device chosen, different sets of peripherals are included. all stm8l ultra-low-power products are bas ed on the same architecture with the same memory mapping and a coherent pinout. description stm8l151x4/6, stm8l152x4/6 12/142 docid15962 rev 15 2.1 device overview table 2. medium-density stm8l151x4/6 and st m8l152x4/6 low-power device features and peripheral counts features stm8l151gx stm8l15xkx stm8l15xcx flash (kbyte) 16 32 16 32 16 32 data eeprom (kbyte) 1 ram (kbyte) 2 lcd no 4x17 (1) 4x28 (1) timers basic 1 (8-bit) general purpose 2 (16-bit) advanced control 1 (16-bit) communication interfaces spi 1 i2c 1 usart 1 gpios 26 (3) 30 (2)(3) or 29 (1)(3) 41 (3) 12-bit synchronized adc (number of channels) 1 (18) 1 (22 (2) or 21 (1) ) 1 (25) 12-bit dac (number of channels) 1 (1) comparators comp1/comp2 2 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 (down to 1.65 v at power down) operating temperature -40 to +85 c/ -40 to +105 c / -40 to +125 c packages ufqfpn28 (4x4; 0.6 mm thickness) wlcsp28 lqfp32(7x7) ufqfpn32 (5x5; 0.6 mm thickness) lqfp48 ufqfpn48 (4x4; 0.6 mm thickness) 1. stm8l152xx versions only 2. stm8l151xx versions only 3. the number of gpios given in this t able includes the nrst/pa1 pin but the application can use the nrst/pa1 pin as general purpose output only (pa1). docid15962 rev 15 13/142 stm8l151x4/6, stm8l152x4/6 description 58 2.2 ultra-low-power continuum the ultra-low-power medium-densitystm8l151x4 /6 and stm8l152x4/6 devices are fully pin-to-pin, software an d feature compatible. be sides the full compatib ility within the family, the devices are part of stmicroelectronics microcontrollers ultra-low-power strategy which also includes stm8l101xx and stm8l15xxx . 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 stm8l151xx and stm8l152xx are 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 incorpor ate highly energy-efficient cores with both harvard architecture and pipelined execution: advanced stm8 core for 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 stm8l151xx/152xx and stm8l15xxx share identical peripherals which ensure a very easy migration from one family to another: ? analog peripherals: adc1, dac, and comparators comp1/comp2 ? digital peripherals: rtc and some communication interfaces common system strategy to offer flexibility and optim ize performance, the stm8l 151xx/152xx and stm8l15xxx devices use a common architecture: ? same power supply range from 1.8 to 3.6 v, down to 1.65 v at power down ? 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 stm8l15x and stm32l15xxx 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 kbyte functional overview stm8l151x4/6, stm8l152x4/6 14/142 docid15962 rev 15 3 functional overview figure 1. medium-density stm8l151x4/6 and stm8l152x4/6 device block diagram 1. legend : adc: analog-to-digital converter bor: brownout reset dma: direct memory access dac: digital-to-analog converter i2c: inter-integrated circuit multi master interface 0 + ] l q w h u q d o 5 & |