STM8S103K3 STM8S103F3 STM8S103F2
Access line, 16 MHz STM8S 8-bit MCU, up to 8 Kbytes Flash, data
EEPROM,10-bit ADC, 3 timers, UART, SPI, I²C
•
Permanently active, low consumption power-on
and power-down reset
Interrupt management
Nested interrupt controller with 32 interrupts
LQFP32 7x7
UFQFPN32 5x5
•
•
Up to 27 external interrupts on 6 vectors
•
Timers
Advanced control timer: 16-bit, 4 CAPCOM
channels, 3 complementary outputs, dead-time
insertion and flexible synchronization
TSSOP20
UFQFPN20 3x3
Features
Core
16 MHz advanced STM8 core with Harvard
architecture and 3-stage pipeline
purpose timer,
•
16-bit generalOC or PWM) with 3 CAPCOM
channels (IC,
•
8-bit basic timer with 8-bit prescaler
•
Auto wake-up timer
•
2 watchdog timers: Window watchdog and
independent watchdog
Communications interfaces
UART with clock output for synchronous
operation, Smartcard, IrDA, LIN master mode
•
•
Extended instruction set
Memories
Program memory: 8 Kbytes Flash; data retention
20 years at 55 °C after 10 kcycles
•
•
Data memory: 640 bytes true data EEPROM;
endurance 300 kcycles
•
RAM: 1 Kbytes
Clock, reset and supply management
2.95 to 5.5 V operating voltage
•
•
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 5 multiplexed
channels, scan mode and analog watchdog
•
•
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
November 2009
I/Os
Up to 28 I/Os on a 32-pin package including 21
high sink outputs
•
•
Highly robust I/O design, immune against current
injection
•
Development supportwire interface module
single
-
Embedded fast on-chip programming and
(SWIM) for
non intrusive debugging
Unique ID
96-bit unique key for each device
•
DocID15441 Rev 4
1/104
www.st.com
Contents
STM8S103K3 STM8S103F3 STM8S103F2
Contents
1
2
3
4
Introduction ..............................................................................................................8
Description ...............................................................................................................9
Block diagram ........................................................................................................10
Product overview ...................................................................................................11
4.1 Central processing unit STM8 .....................................................................................11
4.2 Single wire interface module (SWIM) and debug module (DM) ..................................11
4.3 Interrupt controller .......................................................................................................12
4.4 Flash program and data EEPROM memory ................................................................12
4.5 Clock controller ............................................................................................................13
4.6 Power management ....................................................................................................14
4.7 Watchdog timers ..........................................................................................................14
4.8 Auto wakeup counter ...................................................................................................15
4.9 Beeper .........................................................................................................................15
4.10 TIM1 - 16-bit advanced control timer .........................................................................15
4.11 TIM2 - 16-bit general purpose timer ..........................................................................16
4.12 TIM4 - 8-bit basic timer ..............................................................................................16
4.13 Analog-to-digital converter (ADC1) ............................................................................16
4.14 Communication interfaces .........................................................................................17
4.14.1 UART1 ...............................................................................................17
4.14.2 SPI .....................................................................................................18
4.14.3 I²C ......................................................................................................18
5 Pinout and pin description ...................................................................................19
5.1 STM8S103K UFQFPN32/LQFP32 pinout and description ..........................................20
5.2 STM8S103F TSSOP20 pinout ....................................................................................22
5.3 STM8S103F UFQFPN20 pinout ..................................................................................23
5.4 STM8S103F TSSOP20/UFQFPN20 pin description ...................................................23
5.5 Alternate function remapping .......................................................................................25
6 Memory and register map .....................................................................................26
6.1 Memory map
6.2 Register map
6.2.1
6.2.2
6.2.3
................................................................................................................26
...............................................................................................................27
I/O port hardware register map ............................................................27
General hardware register map ..........................................................28
CPU/SWIM/debug module/interrupt controller registers .....................35
7 Interrupt vector mapping ......................................................................................37
8 Option bytes ...........................................................................................................39
8.1 Alternate function remapping bits ................................................................................41
9 Unique ID ................................................................................................................44
2/104
DocID15441 Rev 4
STM8S103K3 STM8S103F3 STM8S103F2
Contents
10 Electrical characteristics ....................................................................................45
10.1 Parameter conditions .................................................................................................45
10.1.1 Minimum and maximum values .........................................................45
10.1.2 Typical values .....................................................................................45
10.1.3 Typical curves ....................................................................................45
10.1.4 Loading capacitor ...............................................................................45
10.1.5 Pin input voltage .................................................................................46
10.2 Absolute maximum ratings ........................................................................................46
10.3 Operating conditions ..................................................................................................47
10.3.1 VCAP external capacitor ....................................................................49
10.3.2 Supply current characteristics ............................................................50
10.3.3 External clock sources and timing characteristics .............................59
10.3.4 Internal clock sources and timing characteristics ...............................61
10.3.5 Memory characteristics ......................................................................64
10.3.6 I/O port pin characteristics .................................................................65
10.3.7 Reset pin characteristics ....................................................................73
10.3.8 SPI serial peripheral interface ............................................................75
2
10.3.9 I C interface characteristics ...............................................................78
10.3.10 10-bit ADC characteristics ................................................................79
10.3.11 EMC characteristics .........................................................................82
11 Package characteristics ......................................................................................86
11.1 Ecopack packages ....................................................................................................86
11.2 Package mechanical data ..........................................................................................86
11.2.1 32- pin LQFP package mechanical data ............................................86
11.2.2 32-lead UFQFPN package mechanical data ......................................87
11.2.3 20-lead UFQFPN package mechanical data ......................................88
11.2.4 UFQFPN recommended footprint .......................................................90
11.2.5 20-pin TSSOP package mechanical data ..........................................91
11.3 Thermal characteristics ..............................................................................................92
11.3.1 Reference document ..........................................................................93
11.3.2 Selecting the product temperature range ...........................................93
12 Ordering information ...........................................................................................94
12.1 STM8S103 FASTROM microcontroller option list .....................................................95
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
DocID15441 Rev 4
3/104
List of tables
STM8S103K3 STM8S103F3 STM8S103F2
List of tables
Table 1. STM8S103xx access line features .............................................................................................9
Table 2. Peripheral clock gating bit assignments in CLK_PCKENR1/2 registers ..................................14
Table 3. TIM timer features ....................................................................................................................16
Table 4. Legend/abbreviations ..............................................................................................................19
Table 5. UFQFPN32/LQFP32 pin description ........................................................................................20
Table 6. STM8S103F pin description .....................................................................................................23
Table 7. I/O port hardware register map ................................................................................................27
Table 8. General hardware register map ...............................................................................................28
Table 9. CPU/SWIM/debug module/interrupt controller registers .........................................................35
Table 10. Interrupt mapping ...................................................................................................................37
Table 11. Option bytes .........................................................................................................................102
Table 12. Option byte description ...........................................................................................................39
Table 13. STM8S103K alternate function remapping bits for 32-pin devices ........................................41
Table 14. STM8S103F alternate function remapping bits for 20-pin devices ........................................42
Table 15. Unique ID registers (96 bits) .................................................................................................102
Table 16. Voltage characteristics ...........................................................................................................46
Table 17. Current characteristics ...........................................................................................................47
Table 18. Thermal characteristics ..........................................................................................................47
Table 19. General operating conditions .................................................................................................47
Table 20. Operating conditions at power-up/power-down ......................................................................49
Table 21. Total current consumption with code execution in run mode at V
DD
= 5 V .............................50
Table 22. Total current consumption with code execution in run mode at V
DD
= 3.3 V ..........................51
Table 23. Total current consumption in wait mode at V
DD
= 5 V ............................................................52
Table 24. Total current consumption in wait mode at V
DD
= 3.3 V .........................................................52
Table 25. Total current consumption in active halt mode at V
DD
= 5 V ..................................................53
Table 26. Total current consumption in active halt mode at V
DD
= 3.3 V ...............................................53
Table 27. Total current consumption in halt mode at V
DD
= 5 V .............................................................54
Table 28. Total current consumption in halt mode at V
DD
= 3.3 V ..........................................................54
Table 29. Wakeup times .........................................................................................................................55
Table 30. Total current consumption and timing in forced reset state ....................................................56
Table 31. Peripheral current consumption .............................................................................................56
Table 32. HSE user external clock characteristics .................................................................................59
Table 33. HSE oscillator characteristics .................................................................................................60
Table 34. HSI oscillator characteristics ..................................................................................................61
Table 35. LSI oscillator characteristics ...................................................................................................63
Table 36. RAM and hardware registers ..................................................................................................64
Table 37. Flash program memory/data EEPROM memory ....................................................................64
Table 38. I/O static characteristics .........................................................................................................65
Table 39. Output driving current (standard ports) ..................................................................................67
Table 40. Output driving current (true open drain ports) ........................................................................67
Table 41. Output driving current (high sink ports) ..................................................................................67
Table 42. NRST pin characteristics ........................................................................................................73
Table 43. SPI characteristics ..................................................................................................................76
2
Table 44. I C characteristics ..................................................................................................................78
Table 45. ADC characteristics ................................................................................................................79
Table 46. ADC accuracy with R
AIN
< 10 kΩ , V
DD
= 5 V .........................................................................80
Table 47. ADC accuracy with R
AIN
< 10 kΩ R
AIN
, V
DD
= 3.3 V ..............................................................80
4/104
DocID15441 Rev 4
STM8S103K3 STM8S103F3 STM8S103F2
List of tables
Table 48. EMS data ................................................................................................................................83
Table 49. EMI data .................................................................................................................................83
Table 50. ESD absolute maximum ratings .............................................................................................84
Table 51. Electrical sensitivities .............................................................................................................84
Table 52. 32-pin low profile quad flat package mechanical data ............................................................86
Table 53. 32-lead, ultra thin, fine pitch quad flat no-lead package mechanical data .............................88
Table 54. 20-lead, ultra thin, fine pitch quad flat no-lead package (3 x 3) package mechanical data ....89
Table 55. 20-pin, 4.40 mm body, 0.65 mm pitch mechanical data .........................................................92
Table 56. Thermal characteristics ..........................................................................................................93
Table 57. Document revision history ....................................................................................................102
DocID15441 Rev 4
5/104