STM8S005K6 STM8S005C6
Value line, 16 MHz STM8S 8-bit MCU, 32 Kbytes Flash, data
EEPROM,10-bit ADC, timers, UART, SPI, I²C
•
Permanently active, low consumption power-on
and power-down reset
Interrupt management
Nested interrupt controller with 32 interrupts
•
•
Up to 37 external interrupts on 6 vectors
LQFP48 7x7
LQFP32 7x7
Timers
2x 16-bit general purpose timers, with 2+3
CAPCOM channels (IC, OC or PWM)
•
•
Advanced 3control timer: 16-bit, 4 CAPCOM
channels, complementary outputs, dead-time
Features
Core
16 MHz advanced STM8 core with Harvard
architecture and 3-stage pipeline
insertion and flexible synchronization
•
•
Extended instruction set
•
-
-
•
8-bit basic timer with 8-bit prescaler
•
Auto wake-up timer
•
Window and independent watchdog timers
Communications interfaces
UART with clock output for synchronous
operation, Smartcard, IrDA, LIN
Memories
Medium-density Flash/EEPROM:
Program memory: 32 Kbytes of Flash
memory; data retention 20 years at 55°C
after 100 cycles
Data memory: 128 bytes of true data
EEPROM; endurance up to 100 k write/erase
cycles
•
•
SPI interface up to 8 Mbit/s
•
I C interface up to 400 Kbit/s
2
Analog-to-digital converter (ADC)
10-bit, ±1 LSB ADC with up to 10 multiplexed
channels, scan mode and analog watchdog
•
•
RAM: 2 Kbytes
Clock, reset and supply management
2.95 V to 5.5 V operating voltage
•
clock
4 master
•
Flexible powercontrol, resonator clock sources:
oscillator
-
Low crystal
-
External clock input
-
Internal, user-trimmable 16 MHz RC
-
Internal low power 128 kHz RC
•
Clock security system with clock monitor
•
Power management: (wait, active-halt, halt)
-
Low power modes
-
Switch-off peripheral clocks individually
June 2012
I/Os
Up to 38 I/Os on a 48-pin package including 16
high sink outputs
•
•
Highly robust I/O design, immune against current
injection
Development support
Embedded single wire interface module (SWIM)
for fast on-chip programming and non intrusive
debugging
•
DocID022186 Rev 3
1/103
www.st.com
Contents
STM8S005K6 STM8S005C6
Contents
1
2
3
4
Introduction ..............................................................................................................7
Description ...............................................................................................................8
Block diagram ..........................................................................................................9
Product overview ...................................................................................................10
4.1 Central processing unit STM8 .....................................................................................10
4.2 Single wire interface module (SWIM) and debug module (DM) ..................................10
4.3 Interrupt controller .......................................................................................................11
4.4 Flash program and data EEPROM memory ................................................................11
4.5 Clock controller ............................................................................................................12
4.6 Power management ....................................................................................................13
4.7 Watchdog timers ..........................................................................................................14
4.8 Auto wakeup counter ...................................................................................................14
4.9 Beeper ........................................................................................................................14
4.10 TIM1 - 16-bit advanced control timer .........................................................................15
4.11 TIM2, TIM3 - 16-bit general purpose timers ..............................................................15
4.12 TIM4 - 8-bit basic timer ..............................................................................................15
4.13 Analog-to-digital converter (ADC1) ............................................................................16
4.14 Communication interfaces .........................................................................................16
4.14.1 UART2 ...............................................................................................16
4.14.2 SPI .....................................................................................................17
4.14.3 I²C ......................................................................................................18
5 Pinout and pin description ...................................................................................19
5.1 STM8S005 pinouts and pin description .......................................................................20
5.1.1 Alternate function remapping ...............................................................24
6 Memory and register map .....................................................................................25
6.1 Memory map
6.2 Register map
6.2.1
6.2.2
6.2.3
................................................................................................................25
...............................................................................................................26
I/O port hardware register map ............................................................26
General hardware register map ...........................................................29
CPU/SWIM/debug module/interrupt controller registers ......................39
7 Interrupt vector mapping ......................................................................................42
8 Option bytes ...........................................................................................................44
9 Electrical characteristics ......................................................................................49
9.1 Parameter conditions ...................................................................................................49
9.1.1 Minimum and maximum values ...........................................................49
9.1.2 Typical values .......................................................................................49
9.1.3 Typical curves ......................................................................................49
2/103
DocID022186 Rev 3
STM8S005K6 STM8S005C6
Contents
9.1.4 Typical current consumption ................................................................49
9.1.5 Loading capacitor .................................................................................50
9.1.6 Pin input voltage ...................................................................................50
9.2 Absolute maximum ratings ..........................................................................................50
9.3 Operating conditions ...................................................................................................52
9.3.1 VCAP external capacitor ......................................................................54
9.3.2 Supply current characteristics ..............................................................55
9.3.3 External clock sources and timing characteristics ...............................66
9.3.4 Internal clock sources and timing characteristics .................................68
9.3.5
9.3.6
9.3.7
9.3.8
Memory characteristics ........................................................................70
I/O port pin characteristics ...................................................................72
Typical output level curves ...................................................................75
Reset pin characteristics ......................................................................79
9.3.9 SPI serial peripheral interface ..............................................................81
2
9.3.10 I C interface characteristics ...............................................................84
9.3.11 10-bit ADC characteristics ..................................................................86
9.3.12 EMC characteristics ...........................................................................89
10 Package information ...........................................................................................93
10.1 48-pin LQFP package mechanical data ....................................................................93
10.2 32-pin LQFP package mechanical data ....................................................................95
11 Thermal characteristics .......................................................................................97
11.1 Reference document .................................................................................................97
11.2 Selecting the product temperature range ..................................................................97
12 Ordering information ...........................................................................................99
13 STM8 development tools ..................................................................................100
13.1 Emulation and in-circuit debugging tools .................................................................100
13.2 Software tools ..........................................................................................................100
13.2.1 STM8 toolset ....................................................................................101
13.2.2 C and assembly toolchains ..............................................................101
13.3 Programming tools ..................................................................................................101
14 Revision history .................................................................................................102
DocID022186 Rev 3
3/103
List of tables
STM8S005K6 STM8S005C6
List of tables
Table 1. STM8S005xx value line features ................................................................................................8
Table 2. Peripheral clock gating bit assignments in CLK_PCKENR1/2 registers ..................................13
Table 3. TIM timer features ...................................................................................................................15
Table 4. Legend/abbreviations for pinout tables ...................................................................................19
Table 5. Pin description for STM8S005 microcontrollers .......................................................................21
Table 6. Flash, Data EEPROM and RAM boundary addresses ............................................................26
Table 7. I/O port hardware register map ................................................................................................26
Table 8. General hardware register map ................................................................................................29
Table 9. CPU/SWIM/debug module/interrupt controller registers ..........................................................39
Table 10. Interrupt mapping ...................................................................................................................42
Table 11. Option bytes ...........................................................................................................................44
Table 12. Option byte description ...........................................................................................................45
Table 13. Description of alternate function remapping bits [7:0] of OPT2 ..............................................47
Table 14. Voltage characteristics ...........................................................................................................50
Table 15. Current characteristics ...........................................................................................................51
Table 16. Thermal characteristics ..........................................................................................................52
Table 17. General operating conditions .................................................................................................53
Table 18. Operating conditions at power-up/power-down ......................................................................54
Table 19. Total current consumption with code execution in run mode at V
DD
= 5 V .............................55
Table 20. Total current consumption with code execution in run mode at V
DD
= 3.3 V ..........................66
Table 21. Total current consumption in wait mode at V
DD
= 5 V ............................................................58
Table 22. Total current consumption in wait mode at V
DD
= 3.3 V .........................................................58
Table 23. Total current consumption in active halt mode at V
DD
= 5 V ..................................................59
Table 24. Total current consumption in active halt mode at V
DD
= 3.3 V ...............................................60
Table 25. Total current consumption in halt mode at V
DD
= 5 V .............................................................61
Table 26. Total current consumption in halt mode at V
DD
= 3.3 V ..........................................................61
Table 27. Wakeup times .........................................................................................................................61
Table 28. Total current consumption and timing in forced reset state ....................................................92
Table 29. Peripheral current consumption .............................................................................................63
Table 30. HSE user external clock characteristics .................................................................................66
Table 31. HSE oscillator characteristics .................................................................................................67
Table 32. HSI oscillator characteristics ..................................................................................................68
Table 33. LSI oscillator characteristics ...................................................................................................70
Table 34. RAM and hardware registers ..................................................................................................70
Table 35. Flash program memory/data EEPROM memory ....................................................................71
Table 36. I/O static characteristics .........................................................................................................72
Table 37. Output driving current (standard ports) ..................................................................................74
Table 38. Output driving current (true open drain ports) ........................................................................74
Table 39. Output driving current (high sink ports) ..................................................................................74
Table 40. NRST pin characteristics ........................................................................................................79
Table 41. SPI characteristics ..................................................................................................................81
2
Table 42. I C characteristics ..................................................................................................................84
Table 43. ADC characteristics ................................................................................................................86
Table 44. ADC accuracy with R
AIN
< 10 kΩ , V
DDA
= 5 V .......................................................................87
Table 45. ADC accuracy with R
AIN
< 10 kΩ R
AIN
, V
DDA
= 3.3 V ............................................................88
Table 46. EMS data ................................................................................................................................90
Table 47. EMI data .................................................................................................................................91
4/103
DocID022186 Rev 3
STM8S005K6 STM8S005C6
List of tables
Table 48. ESD absolute maximum ratings .............................................................................................92
Table 49. Electrical sensitivities .............................................................................................................92
Table 50. 48-pin low profile quad flat package mechanical data ............................................................93
Table 51. 32-pin low profile quad flat package mechanical data .........................................................102
(1)
Table 52. Thermal characteristics
......................................................................................................97
Table 53. Document revision history ...................................................................................................102
DocID022186 Rev 3
5/103