Stm8S001J3: 16 MHZ Stm8S 8-Bit Mcu, 8-Kbyte Flash Memory, 128-Byte Data Eeprom, 10-Bit Adc, 3 Timers, Uart, Spi, I2C
Stm8S001J3: 16 MHZ Stm8S 8-Bit Mcu, 8-Kbyte Flash Memory, 128-Byte Data Eeprom, 10-Bit Adc, 3 Timers, Uart, Spi, I2C
Features
Core
• 16 MHz advanced STM8 core with Harvard
architecture and 3-stage pipeline SO8N
4.9x6 mm or 150 mils width
• Extended instruction set
Timers
Memories
• Advanced control timer: 16-bit, 2 CAPCOM
• Program memory: 8-Kbyte Flash memory; data channels, 2 outputs, dead-time insertion and
retention 20 years at 55 °C after 100 cycles flexible synchronization
• RAM: 1 Kbyte • 16-bit general purpose timer, with 3 CAPCOM
• Data memory: 128-byte true data EEPROM; channels (IC, OC or PWM)
endurance up to 100 k write/erase cycles • 8-bit basic timer with 8-bit prescaler
Clock, reset and supply management • Auto wakeup timer
• Window and independent watchdog timers
• 2.95 V to 5.5 V operating voltage
• Flexible clock control, 3 master clock sources Communications interfaces
– External clock input
• UART, SmartCard, IrDA, LIN master mode
– Internal, user-trimmable 16 MHz RC
• SPI unidirectional interface up to 8 Mbit/s
– Internal low-power 128 kHz RC
(master simplex mode, slave receiver only)
• Clock security system with clock monitor
• I2C interface up to 400 Kbit/s
• Power management
– Low-power modes (wait, active-halt, halt) Analog to digital converter (ADC)
– Switch-off peripheral clocks individually • 10-bit ADC, ± 1 LSB ADC with up to 3
– Permanently active, low-consumption multiplexed channels, scan mode and analog
power-on and power-down reset watchdog
Interrupt management • Internal reference voltage measurement
Development support
• Embedded single-wire interface module
(SWIM) or fast on-chip programming and non-
intrusive debugging
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3 Block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4 Functional overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.1 Central processing unit STM8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11
4.2 Single wire interface module (SWIM) and debug module (DM) . . . . . . . . 12
4.3 Interrupt controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.4 Flash program memory and data EEPROM . . . . . . . . . . . . . . . . . . . . . . . 12
4.5 Clock controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.6 Power management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4.7 Watchdog timers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4.8 Auto wakeup counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.9 TIM1 - 16-bit advanced control timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.10 TIM2 - 16-bit general purpose timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.11 TIM4 - 8-bit basic timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.12 Analog-to-digital converter (ADC1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.13 Communication interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.13.1 UART1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.13.2 SPI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.13.3 I2C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
8 Option bytes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
8.1 Alternate function remapping bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
9 Electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
9.1 Parameter conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
9.1.1 Minimum and maximum values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
9.1.2 Typical values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
9.1.3 Typical curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
9.1.4 Loading capacitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
9.1.5 Pin input voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
9.2 Absolute maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
9.3 Operating conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
9.3.1 VCAP external capacitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
9.3.2 Supply current characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
9.3.3 External clock sources and timing characteristics . . . . . . . . . . . . . . . . . 53
9.3.4 Internal clock sources and timing characteristics . . . . . . . . . . . . . . . . . 54
9.3.5 Memory characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
9.3.6 I/O port pin characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
9.3.7 SPI serial peripheral interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
9.3.8 I2C interface characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
9.3.9 10-bit ADC characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
9.3.10 EMC characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
10 Package information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
10.1 SO8N package information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
10.2 Thermal characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
10.2.1 Reference document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
10.2.2 Selecting the product temperature range . . . . . . . . . . . . . . . . . . . . . . . 78
11 Ordering information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
13 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
List of tables
List of figures
1 Introduction
This datasheet contains the description of the STM8S001J3 features, pinout, electrical
characteristics, mechanical data and ordering information.
• For complete information on the STM8S microcontroller memory, registers and
peripherals, please refer to the STM8S and STM8A microcontroller families reference
manual (RM0016).
• For information on programming, erasing and protection of the internal Flash memory
please refer to the PM0051 (How to program STM8S and STM8A Flash program
memory and data EEPROM).
• For information on the debug 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).
2 Description
The STM8S001J3 8-bit microcontrollers offer 8 Kbytes of Flash program memory, plus
integrated true data EEPROM. It is referred to as low-density device in the STM8S
microcontroller family reference manual (RM0016).
The STM8S001J3 device provides the following benefits: performance, robustness and
reduced system cost.
Device performance and robustness are ensured by true data EEPROM supporting up to
100000 write/erase cycles, advanced core and peripherals made in a state-of-the-art
technology at 16 MHz clock frequency, robust I/Os, independent watchdogs with separate
clock source, and a clock security system.
The system cost is reduced thanks to a high system integration level with internal clock
oscillators, watchdog, and brown-out reset.
Full documentation is offered as well as a wide choice of development tools.
Table 1. STM8S001J3 features
Features STM8S001J3
Pin count 8
Max. number of GPIOs (I/O) 5
External interrupt pins 5
Timer CAPCOM channels 3
Timer complementary outputs 1
A/D converter channels 3
High-sink I/Os 4
Low-density Flash program memory
8K
(byte)
RAM (byte) 1K
True data EEPROM (byte) 128(1)
Multi purpose timer (TIM1), SPI unidirectional, I2C, UART,
Window WDG,
Peripheral set
independent WDG, ADC, PWM timer (TIM2), 8-bit timer
(TIM4)
1. Without read-while-write capability.
3 Block diagram
Reset
RC int. 16 MHz
Detector
POR BOR
RC int. 128 kHz
Window WDG
STM8 core
Independent WDG
Single wire
debug Debug / SWIM 8 Kbyte
interface program Flash
128 byte
data EEPROM
Address and data bus
Up to 2
8 Mbit/s Unidirectional SPI 16-bit advanced CAPCPOM
control timer (TM1) channels
16-bit general Up to 3
LIN master UART1 purpose timer CAPCPOM
(TIM2) channels
Up to 3
ADC1 8-bit basic timer
channels
(TIM4)
AWU timer
MSv44651V1
4 Functional overview
The following section intends to give an overview of the basic features of the STM8S001J3
functional modules and peripherals.
For more detailed information please refer to the corresponding family reference manual
(RM0016).
Addressing
• 20 addressing modes
• Indexed indirect addressing mode for look-up tables located anywhere in the address
space
• Stack pointer relative addressing mode for local variables and parameter passing
Instruction set
• 80 instructions with 2-byte average instruction size
• Standard data movement and logic/arithmetic functions
• 8-bit by 8-bit multiplication
• 16-bit by 8-bit and 16-bit by 16-bit division
• Bit manipulation
• Data transfer between stack and accumulator (push/pop) with direct stack access
• Data transfer using the X and Y registers or direct memory-to-memory transfers
4.2 Single wire interface module (SWIM) and debug module (DM)
The single wire interface module and debug module permits non-intrusive, real-time in-
circuit debugging and fast memory programming.
SWIM
Single wire interface module for direct access to the debug module and memory
programming. The interface can be activated in all device operation modes. The maximum
data transmission speed is 145 byte/ms.
Debug module
The non-intrusive debugging module features a performance close to a full-featured
emulator. Beside memory and peripherals, also CPU operation can be monitored in real-
time by means of shadow registers.
• R/W to RAM and peripheral registers in real-time
• R/W access to all resources by stalling the CPU
• Breakpoints on all program-memory instructions (software breakpoints)
• Two advanced breakpoints, 23 predefined configurations
Option bytes
Programmable
area from 64 bytes
UBC area (1 page) up to
Remains write protected during IAP 8 Kbytes
(in 1 page steps)
Low density
Flash program
memory
(8 Kbytes)
Program memory area
Write access possible for IAP
MS36408V1
Features
• Clock prescaler: To get the best compromise between speed and current
consumption the clock frequency to the CPU and peripherals can be adjusted by a
programmable prescaler.
• Safe clock switching: Clock sources can be changed safely on the fly in run mode
through a configuration register. The clock signal is not switched until the new clock
source is ready. The design guarantees glitch-free switching.
• Clock management: To reduce power consumption, the clock controller can stop the
clock to the core, individual peripherals or memory.
• Master clock sources: Three different clock sources can be used to drive the master
clock:
– Up to 16 MHz high-speed user-external clock (HSE user-ext)
– 16 MHz high-speed internal RC oscillator (HSI)
– 128 kHz low-speed internal RC (LSI)
• Startup clock: After reset, the microcontroller restarts by default with an internal
2 MHz clock (HSI/8). The prescaler ratio and clock source can be changed by the
application program as soon as the code execution starts.
• Clock security system (CSS): This feature can be enabled by software. If an HSE
clock failure occurs, the internal RC (16 MHz/8) is automatically selected by the CSS
and an interrupt can optionally be generated.
• Configurable main clock output (CCO): This outputs an external clock for use by the
application.
4.13.1 UART1
Main features
• 1 Mbit/s full duplex SCI
• High precision baud rate generator
• Smartcard reader emulation
• IrDA SIR encoder decoder
• LIN master mode
• Single wire half duplex mode
4.13.2 SPI
• Maximum speed: 8 Mbit/s (fMASTER/2) both for master and slave
• Unidirectional transfer: SPI master mode transmit/receive only, SPI slave mode receive
only
• Simplex master synchronous transfers on two lines with a possible bidirectional data
line
• Master or slave operation - selectable by software
• CRC calculation
• 1 byte Tx and Rx buffer
4.13.3 I2C
• I2C master features
– Clock generation
– Start and stop generation
• I2C slave features
– Programmable I2C address detection
– Stop bit detection
• Generation and detection of 7-bit/10-bit addressing and general call
• Supports different communication speeds
– Standard speed (up to 100 kHz)
– Fast speed (up to 400 kHz)
This section presents the pinouts and pin descriptions for STM8S001J3. Table 4 introduces
the legends and abbreviations that are used in the upcoming subsections.
PD5/AIN5/UART1_TX/
PD3/AIN4/TIM2_CH2/ADC_ETR/
PD6/AIN6/UART1_RX/ PD1/SWIM/
PA1/OSCIN 1 8 PC6/SPI_MOSI/[TIM1_CH1]
PC5/SPI_SCK/[TIM2_CH1]/
VSS/VSSA 2 7 PC4/CLK_CCO/TIM1_CH4/[AIN2]/[TIM1_CH2N]
PC3/TIM1_CH3/[TLI]/[TIM1_CH1N]
STM8S
VCAP 3 6 PB4/I2C_SCL/[ADC_ETR]
VDD/VDDA 4 5 PB5/I2C_SDA/[TIM1_BKIN]/
PA3/TIM2_CH3/[SPI_NSS]/[UART1_TX]
MSv44652V2
1. [ ] Alternative function option (if the same alternate function is shown twice, it indicated an exclusive choice
and not a duplication of the function).
Ext. interr.
function function
Floating
Pin name Type alternate
Speed
High (after after remap
wpu
SO8N OD PP function
sink(1) reset) [option bit]
Analog input
PD6/ AIN6/
I/O X X X HS O3 X X Port D6 6/ UART1 -
UART1 _RX(2)
data receive
1
External
PA1/ OSCIN(3) I/O X X X - O1 X X Port A1 clock input -
(HSE clock)
2 VSS/VSSA S - - - - - - - Ground -
1.8 V regulator
3 VCAP S - - - - - - - -
capacitor
4 VDD/VDDA S - - - - - - - Power supply -
SPI master/
slave select
PA3/ TIM2_ CH3 [AFR1]
Timer 2
[SPI_ NSS]\ I/O X X X HS O3 X X Port A3 UART1 data
channel 3
[UART1_TX](2) transmit
5 [AFR1 and
AFR0]
Timer 1 -
PB5/ I2C_ SDA
I/O X - X - O1 T(4) - Port B5 I2C data break input
[TIM1_ BKIN]
[AFR4]
ADC
PB4/ I2C_ SCL external
6 I/O X - X - O1 T(4) - Port B4 I2C clock
/[ADC_ETR] trigger
[AFR4]
Top level
interrupt
PC3/ TIM1_CH3 [AFR3]
Timer 1 -
[TLI] I/O X X X HS O3 X X Port C3 Timer 1 -
channel 3
[TIM1_ CH1N] inverted
channel 1
[AFR7]
Analog input
7
PC4/ CLK_CCO/ Configurable 2 [AFR2],
TIM1_ clock Timer 1 -
I/O X X X HS O3 X X Port C4
CH4/[AIN2]/ output/Timer inverted
[TIM1_ CH2N] 1 - channel 4 channel 2
[AFR7]
Timer 2 -
PC5/ SPI_SCK
I/O X X X HS O3 X X Port C5 SPI clock channel 1
[TIM2_ CH1]
[AFR0]
Ext. interr.
function function
Floating
Pin name Type alternate
Speed
High (after after remap
wpu
SO8N OD PP function
sink(1) reset) [option bit]
Timer 1 -
PC6/ SPI_MOSI SPI master
I/O X(5) X X HS O3 X X Port C6 channel 1
[TIM1_ CH1] out/slave in
[AFR0]
SWIM data
PD1/ SWIM(5) I/O X X(5) X HS O4 X X Port D1 -
interface
Analog input
8 4/ Timer 2 -
PD3/ AIN4/
channel
TIM2_ CH2/ I/O X(5) X X HS O3 X X Port D3 -
2/ADC
ADC_ ETR
external
trigger
Analog input
PD5/ AIN5/
I/O X(5) X X HS O3 X X Port D5 5/ UART1 -
UART1 _TX
data transmit
1. I/O pins used simultaneously for high current source/sink must be uniformly spaced around the package. In addition, the total
driven current must respect the absolute maximum ratings.
2. By remapping UART1_TX (AFR0=1 and AFR1=1) to PA3 the UART1_RX alternate function on PD6 becomes unavailable.
UART1 can be then used only in Single wire half-duplex mode or in Smartcard-reader emulation mode.
3. When the MCU is in halt/active-halt mode, PA1 is automatically configured in input weak pull-up and cannot be used for
waking up the device. In this mode, the output state of PA1 is not driven. It is recommended d to use PA1 only in input mode
if halt/active-halt is used in the application.
4. In the open-drain output column, “T” defines a true open-drain I/O (P-buffer, weak pull-up, and protection diode to VDD are
not implemented). Although PB5 itself is a true open drain GPIO with its respective internal circuitry and characteristics, VIN
maximum of the pin number 5 is limited by the standard GPIO PA3 which is also bonded to pin number 5.
5. The PD1 pin is in input pull-up during the reset phase and after internal reset release. This PD1 default state influences all
GPIOs connected in parallel on pin# 8 (PC6, PD3, PD5).
Note: The PA2, PB0, PB1, PB2, PB3, PB6, PB7, PC1, PC2, PC7, PD0, PD2, PD4, PD7, PE5 and
PF4 GPIOs should be configured after device reset in output push-pull mode with output
low-state to reduce the device’s consumption and to improve its EMC immunity. The GPIOs
mentioned above are not connected to pins, and they are in input-floating mode after a
device reset.
Note: As several pins provide a connection to multiple GPIOs, the mode selection for any of those
GPIOs impacts all the other GPIOs connected to the same pin. The user is responsible for
the proper setting of the GPIO modes in order to avoid conflicts between GPIOs bonded to
the same pin (including their alternate functions). For example, pull-up enabled on PD1 is
also seen on PC6, PD3 and PD5. Push-pull configuration of PC3 is also seen on PC4 and
PC5, etc.
Reserved
0x00 4000
Data EEPROM
0x00 407F
0x00 47FF Reserved
0x00 4800
Option bytes
0x00 480A
0x00 480B
Reserved
0x00 4FFF
0x00 5000
GPIO and periph. reg.
0x00 57FF
0x00 5800
Reserved
0x00 7EFF
0x00 7F00
CPU/SWIM/debug/ITC
registers
0x00 7FFF
0x00 8000
32 interrupt vectors
0x00 807F
0x00 8080 Flash program memory
(8 Kbyte)
0x00 9FFF
0x00 A000
Reserved
Table 6 lists the boundary addresses for each memory size. The top of the stack is at the
RAM end address in each case.
0x00 501E to
Reserved area (60 byte)
0x00 5059
0x00 505A FLASH_CR1 Flash control register 1 0x00
0x00 505B FLASH_CR2 Flash control register 2 0x00
0x00 505C FLASH_NCR2 Flash complementary control register 2 0xFF
0x00 505D Flash FLASH _FPR Flash protection register 0x00
0x00 505E FLASH _NFPR Flash complementary protection register 0xFF
Flash in-application programming status
0x00 505F FLASH _IAPSR 0x00
register
0x00 5060 to
Reserved area (2 byte)
0x00 5061
Flash Program memory unprotection
0x00 5062 Flash FLASH _PUKR 0x00
register
0x00 5063 Reserved area (1 byte)
0x00 5064 Flash FLASH _DUKR Data EEPROM unprotection register 0x00
0x00 5065 to
Reserved area (59 byte)
0x00 509F
0x00 50A0 EXTI_CR1 External interrupt control register 1 0x00
ITC
0x00 50A1 EXTI_CR2 External interrupt control register 2 0x00
0x00 50A2 to
Reserved area (17 byte)
0x00 50B2
0x00 50B3 RST RST_SR Reset status register 0xXX(1)
0x00 50B4 to
Reserved area (12 byte)
0x00 50BF
0x00 50C0 CLK_ICKR Internal clock control register 0x01
CLK
0x00 50C1 CLK_ECKR External clock control register 0x00
0x00 50C2 Reserved area (1 byte)
0x00 50C3 CLK_CMSR Clock master status register 0xE1
0x00 50C4 CLK_SWR Clock master switch register 0xE1
0x00 50C5 CLK_SWCR Clock switch control register 0xXX
0x00 50C6 CLK_CKDIVR Clock divider register 0x18
CLK
0x00 50C7 CLK_PCKENR1 Peripheral clock gating register 1 0xFF
0x00 50C8 CLK_CSSR Clock security system register 0x00
0x00 50C9 CLK_CCOR Configurable clock control register 0x00
0x00 50CA CLK_PCKENR2 Peripheral clock gating register 2 0xFF
0x00 5349 to
Reserved area (153 byte)
0x00 53DF
0x00 53E0 to
ADC1 ADC_DBxR ADC data buffer registers 0x00
0x00 53F3
0x00 53F4 to
Reserved area (12 byte)
0x00 53FF
0x00 5400 ADC _CSR ADC control/status register 0x00
0x00 5401 ADC_CR1 ADC configuration register 1 0x00
0x00 5402 ADC_CR2 ADC configuration register 2 0x00
0x00 5403 ADC_CR3 ADC configuration register 3 0x00
0x00 5404 ADC_DRH ADC data register high 0xXX
0x00 5405 ADC_DRL ADC data register low 0xXX
0x00 5406 ADC_TDRH ADC Schmitt trigger disable register high 0x00
0x00 5407 ADC_TDRL ADC Schmitt trigger disable register low 0x00
ADC1
0x00 5408 ADC_HTRH ADC high threshold register high 0x03
0x00 5409 ADC_HTRL ADC high threshold register low 0xFF
0x00 540A ADC_LTRH ADC low threshold register high 0x00
0x00 540B ADC_LTRL ADC low threshold register low 0x00
0x00 540C ADC_AWSRH ADC analog watchdog status register high 0x00
0x00 540D ADC_AWSRL ADC analog watchdog status register low 0x00
0x00 540E ADC_AWCRH ADC analog watchdog control register high 0x00
0x00 540F ADC_AWCRL ADC analog watchdog control register low 0x00
0x00 5410 to
Reserved area (1008 byte)
0x00 57FF
1. Depends on the previous reset source.
2. Write only register.
8 Option bytes
Option bytes contain configurations for device hardware features as well as the memory
protection of the device. They are stored in a dedicated block of the memory. Except for the
ROP (read-out protection) byte, each option byte has to be stored twice, in a regular form
(OPTx) and a complemented one (NOPTx) for redundancy.
Option bytes can be modified in ICP mode (via SWIM) by accessing the EEPROM address
shown in Table 11: Option bytes below. Option bytes can also be modified ‘on the fly’ by the
application in IAP mode, except the ROP option that can only be modified in ICP mode (via
SWIM).
Refer to the STM8S Flash programming manual (PM0051) and STM8 SWIM
communication protocol and debug module user manual (UM0470) for information on SWIM
programming procedures.
0x4803 Alternate OPT2 AFR7 AFR6 AFR5 AFR4 AFR3 AFR2 AFR1 AFR0 0x00
function
0x4804 remapping NOPT2 NAFR7 NAFR6 NAFR5 NAFR4 NAFR3 NAFR2 NAFR1 NAFR0 0xFF
(AFR)
Table 13. STM8S001J3 alternate function remapping bits for 8-pin devices
Option byte number Description
9 Electrical characteristics
STM8 pin
50 pF
STM8 pin
VIN
fCPU (MHz)
Functionality
not guaranteed 16
in this area
12 Functionality guaranteed
4
0
2.95 4.0 5.0 5.5
Supply voltage
MSv46305V1
ESR
RLeak
MSv36488V1
1. Legend: ESR is the equivalent series resistance and ESL is the equivalent inductance.
Table 19. Total current consumption with code execution in run mode at VDD = 5 V
Symbol Parameter Conditions Typ Max (1) Unit
Table 20. Total current consumption with code execution in run mode at VDD = 3.3 V
Symbol Parameter Conditions Typ Max(1) Unit
HSE user
external clock 1030 - -
Operating mode (16 MHz)
LSI RC oscillator
200 260 300
(128 kHz)
On
Supply current HSE user
IDD(AH) in active halt external clock 970 - - µA
Power-down (16 MHz)
mode
mode
LSI RC oscillator
150 200 230
(128 kHz)
Operating mode 66 85 110
LSI RC oscillator
Off Power-down (128 kHz) 10 20 40
mode
1. Guaranteed by characterization results.
2. Configured by the REGAH bit in the CLK_ICKR register.
3. Configured by the AHALT bit in the FLASH_CR1 register.
Table 24. Total current consumption in active halt mode at VDD = 3.3 V
Conditions
Max Max
at at
Symbol Parameter Main voltage Typ Unit
85° 125°
regulator Flash mode(3) Clock source
C(1) C(1)
(MVR)(2)
Table 28. Total current consumption and timing in forced reset state
Symbol Parameter Conditions Typ Max(1) Unit
VDD = 5 V 400 -
IDD(R) Supply current in reset state (2) µA
VDD = 3.3 V 300 -
tRESETBL Reset release to vector fetch - - 150 µs
1. Guaranteed by design.
2. Characterized with all I/Os tied to VSS.
Figure 9. Typ. IDD(RUN) vs VDD, HSE user external clock, fCPU = 16 MHz
Figure 10. Typ. IDD(RUN) vs fCPU, HSE user external clock, VDD = 5 V
Figure 12. Typ. IDD(WFI) vs. VDD HSE user external clock, fCPU = 16 MHz
Figure 13. Typ. IDD(WFI) vs. fCPU, HSE user external clock, VDD = 5 V
VHSEH
V HSEL
fHSE
External clock
source
OSCIN
STM8
MS36489V2
Operating voltage
VDD fCPU ≤ 16 MHz 2.95 - 5.5 V
(all modes, execution/write/erase)
Standard programming time (including
erase) for byte/word/block - - 6.0 6.6 ms
tprog (1 byte/4 bytes/64 bytes)
Fast programming time for 1 block (64
- - 3.0 3.3 ms
bytes)
terase Erase time for 1 block (64 bytes) - - 3.0 3.3 ms
Erase/write cycles(2)
100 - -
(program memory)
NRW TA = 85 °C cycles
Erase/write cycles(2)
100 k - -
(data memory)
Data retention (program memory)
after 100 erase/write cycles at 20 - -
TA = 85 °C TRET = 55° C
Data retention (data memory) after
tRET 20 - - years
10 k erase/write cycles at TA = 85 °C
Data retention (data memory) after
100 k erase/write cycles at TRET = 85° C 1.0 - -
TA = 125 °C
Supply current (Flash programming or
IDD - - 2.0 - mA
erasing for 1 to 128 bytes)
1. Guaranteed by characterization results.
2. The physical granularity of the memory is 4 bytes, so cycling is performed on 4 bytes even when a
write/erase operation addresses a single byte.
Output low level with 8 pins sunk IIO = 10 mA, VDD = 5 V - 0.8
VOL Output low level with 4 pins sunk IIO = 10 mA, VDD = 3.3 V - 1.0(1)
Output low level with 4 pins sunk IIO = 20 mA, VDD = 5 V - 1.5(1)
V
Output high level with 8 pins sourced IIO = 10 mA, VDD = 5 V 4.0 -
VOH Output high level with 4 pins sourced IIO = 10 mA, VDD = 3.3 V 2.1(1) -
(1)
Output high level with 4 pins sourced IIO = 20 mA, VDD = 5 V 3.3 -
1. Guaranteed by characterization results.
Figure 23. Typ. VOL @ VDD = 3.3 V (true open drain ports)
Figure 29. Typ. VDD - VOH @ VDD = 3.3 V (high sink ports)
tv(MO)(1) Data output valid time Master mode (after enable edge) - 30
th(SO)(1) Slave mode (after enable edge) 27 - ns
Data output hold time
(1)
th(MO) Master mode (after enable edge) 11 -
1. Values based on design simulation and/or characterization results, and not tested in production.
2. Min time is for the minimum time to drive the output and the max time is for the maximum time to validate the data.
3. Min time is for the minimum time to invalidate the output and the max time is for the maximum time to put the data in Hi-Z.
Figure 31. SPI timing diagram - slave mode and CPHA = 1(1)
NSS input
CPHA=1
CPOL=0 tw(SCKH)
CPHA=1 tw(SCKL)
CPOL=1
tr(SCK)
tv(SO) th(SO) tdis(SO)
ta(SO) tf(SCK)
MISO
MSB OUT BIT6 OUT LSB OUT
OUTPUT
tsu(SI) th(SI)
MOSI
INPUT MSB IN BIT 1 IN LSB IN
ai14135b
1. Measurement points are done at CMOS levels: 0.3 VDD and 0.7 VDD.
High
NSS input
tc(SCK)
SCK Output
CPHA= 0
CPOL=0
CPHA= 0
CPOL=1
SCK Output
CPHA=1
CPOL=0
CPHA=1
CPOL=1
tw(SCKH) tr(SCK)
tsu(MI) tw(SCKL) tf(SCK)
MISO
INP UT MSB IN BIT6 IN LSB IN
th(MI)
MOSI
MSB OUT B I T1 OUT LSB OUT
OUTPUT
tv(MO) th(MO)
ai14136c
1. Measurement points are done at CMOS levels: 0.3 VDD and 0.7 VDD.
Figure 33. Typical application with I2C bus and timing diagram
VDD VDD
S TART REPEATED
S TART
tsu(STA) S TART
SDA
tf(SDA) tr(SDA) tsu(SDA)
S TOP tsu(STA:STO)
th(STA) tw(SCLL) th(SDA)
SCL
tw(SCLH) tr(SCL) tf(SCL) tsu(STO)
ai17490V2
1. Measurement points are made at CMOS levels: 0.3 x VDD and 0.7 x VDD
VDDA = 3 to 5.5 V 1 - 4
fADC ADC clock frequency MHz
VDDA = 4.5 to 5.5 V 1 - 6
Table 43. ADC accuracy with RAIN < 10 kΩ RAIN, VDD = 3.3 V
Symbol Parameter Conditions Typ Max(1) Unit
EG
1023
V –V
1022 DDA SSA
1LSB = -----------------------------------------
1021 IDEAL 1024
(2)
ET
7 (3)
(1)
6
5
EO EL
4
3 ED
2
1 1 LSBIDEAL
0 1 2 3 4 5 6 7 1021102210231024
VSSA VDDA
VDD STM8
VT
0.6V
RAIN AINx
VAIN 10-bit A/D
conversion
CAIN VT
0.6V IL CADC
±1µA
Max fHSE/fCPU(1)
Symbol Parameter Unit
Monitored
General conditions
frequency band 16 MHz/ 16 MHz/
8 MHz 16 MHz
Static latch-up
Two complementary static tests are required on 10 parts to assess the latch-up
performance:
• A supply overvoltage (applied to each power supply pin)
• A current injection (applied to each input, output and configurable I/O pin) is performed
on each sample.
This test conforms to the EIA/JESD 78 IC latch-up standard. For more details, refer to the
application note AN1181.
TA = 25 °C A
LU Static latch-up class
TA = 85 °C A
1. Class description: A Class is an STMicroelectronics internal specification. All its limits are higher than the
JEDEC specifications, that means when a device belongs to class A it exceeds the JEDEC standard. B
class strictly covers all the JEDEC criteria (international standard).
10 Package information
Table 48. SO8N – 8-lead 4.9 x 6 mm, plastic small outline, 150 mils body width,
package mechanical data
millimeters inches(1)
Symbol
Min. Typ. Max. Min. Typ. Max.
A - - 1.750 - - 0.0689
A1 0.100 - 0.250 0.0039 - 0.0098
A2 1.250 - - 0.0492 - -
b 0.280 - 0.480 0.0110 - 0.0189
c 0.170 - 0.230 0.0067 - 0.0091
Table 48. SO8N – 8-lead 4.9 x 6 mm, plastic small outline, 150 mils body width,
package mechanical data
millimeters inches(1)
Symbol
Min. Typ. Max. Min. Typ. Max.
Figure 37. SO8N – 8-lead 4.9 x 6 mm, plastic small outline, 150 mils body width,
package recommended footprint
0.6 (x8) 3.9
6.7
1.27
O7_FP_V1
Device marking for SO8N – 8-lead 4.9 x 6 mm, plastic small outline, 150 mils body
width
The following figure gives an example of topside marking orientation versus pin 1/ball A1
identifier location.
Other optional marking or inset/upset marks, which identify the parts throughout supply
chain operations, are not indicated below.
Figure 38. SO8N – 8-lead 4.9 x 6 mm, plastic small outline, 150 mils body width,
marking example
Product identification
8S001J3
R Y WW
Date code
Unmarkable surface
Additional information
PIN1 reference
MSv17033v1
1. Parts marked as ES or E or accompanied by an Engineering Sample notification letter are not yet qualified
and therefore not approved for use in production. ST is not responsible for any consequences resulting
from such use. In no event will ST be liable for the customer using any of these engineering samples in
production. ST's Quality department must be contacted prior to any decision to use these engineering
samples to run a qualification activity.
Using the values obtained in Section Table 49.: Thermal characteristics TJmax is calculated
as follows for SO8N package 102 °C/W :
TJmax = 75 °C + (102 °C/W x 52.8 mW) = 75 °C + 5.4 °C = 80.4 °C.
Above information is within the range (-40 < TJ < 130 °C)
11 Ordering information
Product class
STM8 microcontroller
Family type
S = standard
Sub-family type
001 = low density
Pin count
J = 8 pins
Package type
M =SO8N
Temperature range
3 = -40°C to 125°C
Packing
No character = tube
TR = Tape and reel
1. For a list of available options (e.g. memory size, package) and orderable part numbers or for further
information on any aspect of this device, please go to www.st.com or contact the nearest ST Sales Office.
Development tools for the STM8 microcontrollers include the full-featured STice emulation
system supported by a complete software tool package including C compiler, assembler and
integrated development environment with high-level language debugger. In addition, the
STM8 is to be supported by a complete range of tools including starter kits, evaluation
boards and a low-cost in-circuit debugger/programmer.
13 Revision history
STMicroelectronics NV and its subsidiaries (“ST”) reserve the right to make changes, corrections, enhancements, modifications, and
improvements to ST products and/or to this document at any time without notice. Purchasers should obtain the latest relevant information on
ST products before placing orders. ST products are sold pursuant to ST’s terms and conditions of sale in place at the time of order
acknowledgment.
Purchasers are solely responsible for the choice, selection, and use of ST products and ST assumes no liability for application assistance or
the design of Purchasers’ products.
Resale of ST products with provisions different from the information set forth herein shall void any warranty granted by ST for such product.
ST and the ST logo are trademarks of ST. For additional information about ST trademarks, please refer to www.st.com/trademarks. All other
product or service names are the property of their respective owners.
Information in this document supersedes and replaces information previously supplied in any prior versions of this document.