STM 8 Af 6266
STM 8 Af 6266
STM8AF6266 STM8AF6268
Automotive 8-bit MCU, with up to 32 Kbyte Flash, data EEPROM,
10-bit ADC, timers, LIN, SPI, I2C, 3 to 5.5 V
Datasheet - production data
Features
• AEC-Q10x qualified
• Core
– Max fCPU: 16 MHz
– Advanced STM8A core with Harvard LQFP48 LQFP32 VFQFPN32
(7x7 mm) (7x7 mm) (5x5 mm)
architecture and 3-stage pipeline
– Average 1.6 cycles/instruction resulting in – Auto-wakeup timer
10 MIPS at 16 MHz fCPU for industry – Window and independent watchdog timers
standard benchmark • Communication interfaces
• Memories – LINUART
– Flash Program memory: 16 to 32 Kbyte – LIN 2.2 compliant, master/slave modes
Flash; data retention 20 years at 55 °C with automatic resynchronization
after 1 kcycle – SPI interface up to 8 Mbit/s or fMASTER/2
– Data memory: 0.5 to 1 Kbyte true data – I2C interface up to 400 Kbit/s
EEPROM; endurance 300 kcycle
• Analog-to-digital converter (ADC)
– RAM: 2 Kbyte
– 10-bit accuracy, 2LSB TUE accuracy, 2LSB
• Clock management TUE linearity ADC and up to 10 multiplexed
– Low-power crystal resonator oscillator with channels with individual data buffer
external clock input – Analog watchdog, scan and continuous
– Internal, user-trimmable 16 MHz RC and sampling mode
low-power 128 kHz RC oscillators • I/Os
– Clock security system with clock monitor – Up to 38 user pins including 10 HS I/Os
• Reset and supply management – Highly robust I/O design, immune against
– Wait/auto-wakeup/Halt low-power modes current injection
with user definable clock gating • Operating temperature up to 150 °C
– Low consumption power-on and power- • Qualification conforms to AEC-Q100 rev G
down reset
• Interrupt management
– Nested interrupt controller with 32 vectors
– Up to 34 external interrupts on 5 vectors
• Timers
– Up to 2 general purpose 16-bit PWM timers
with up to 3 CAPCOM channels each (IC,
OC or PWM)
– Advanced control timer: 16-bit, 4 CAPCOM
channels, 3 complementary outputs, dead-
time insertion and flexible synchronization
– 8-bit AR basic timer with 8-bit prescaler
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3 Product line-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4 Block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5 Product overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
5.1 STM8A central processing unit (CPU) . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
5.1.1 Architecture and registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
5.1.2 Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
5.1.3 Instruction set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
5.2 Single wire interface module (SWIM) and debug module (DM) . . . . . . . . 15
5.2.1 SWIM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.2.2 Debug module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.3 Interrupt controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.4 Flash program and data EEPROM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.4.1 Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.4.2 Write protection (WP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.4.3 Protection of user boot code (UBC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.4.4 Read-out protection (ROP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.5 Clock controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.5.1 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.5.2 16 MHz high-speed internal RC oscillator (HSI) . . . . . . . . . . . . . . . . . . 18
5.5.3 128 kHz low-speed internal RC oscillator (LSI) . . . . . . . . . . . . . . . . . . . 19
5.5.4 16 MHz high-speed external crystal oscillator (HSE) . . . . . . . . . . . . . . . 19
5.5.5 External clock input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
5.5.6 Clock security system (CSS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
5.6 Low-power operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
5.7 Timers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
5.7.1 Watchdog timers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
5.7.2 Auto-wakeup counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
5.7.3 Beeper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
8 Interrupt table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
9 Option bytes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
10 Electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
10.1 Parameter conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
10.1.1 Minimum and maximum values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
10.1.2 Typical values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
10.1.3 Typical curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
10.1.4 Loading capacitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
10.1.5 Pin input voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
10.2 Absolute maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
10.3 Operating conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
10.3.1 VCAP external capacitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
10.3.2 Supply current characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
10.3.3 External clock sources and timing characteristics . . . . . . . . . . . . . . . . . 57
10.3.4 Internal clock sources and timing characteristics . . . . . . . . . . . . . . . . . 59
10.3.5 Memory characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
10.3.6 I/O port pin characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
11 Package information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
11.1 VFQFPN32 package information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
11.2 LQFP48 package information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
11.3 LQFP32 package information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
11.4 Thermal characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
11.4.1 Reference document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
11.4.2 Selecting the product temperature range . . . . . . . . . . . . . . . . . . . . . . . 88
12 Ordering information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
14 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
List of tables
List of figures
recommended footprint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Figure 47. LQFP48 marking example (package top view) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Figure 48. LQFP32 - 32-pin, 7 x 7 mm low-profile quad flat package outline . . . . . . . . . . . . . . . . . . . 85
Figure 49. LQFP32 - 32-pin, 7 x 7 mm low-profile quad flat package
recommended footprint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Figure 50. LQFP32 marking example (package top view) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Figure 51. STM8AF6246/48/66/68 ordering information scheme(1) (2) . . . . . . . . . . . . . . . . . . . . . . . . 90
1 Introduction
2 Description
3 Product line-up
²
4 Block diagram
5HVHWEORFN ;7$/0+]
&ORFNFRQWUROOHU
5HVHW 5HVHW
5&LQW0+]
'HWHFWRU
325 %25 5&LQWN+]
&ORFNWRSHULSKHUDOVDQGFRUH
:LQGRZ:'*
670$FRUH
,QGHSHQGHQW:'*
6LQJOHZLUH 'HEXJ6:,0
GHEXJLQWHUIDFH 8SWR.E\WH
SURJUDP)ODVK
0DVWHUVODYH
DXWRPDWLF /,18$57 8SWR.E\WH
UHV\QFKURQL]DWLRQ GDWD((3520
$GGUHVVDQGGDWDEXV
.E\WH5$0
%RRW520
.ELWV ,&
ELWDGYDQFHGFRQWURO
WLPHU7,0
0ELWV 63,
8SWR
ELWJHQHUDOSXUSRVH &$3&20
FKDQQHOV ELW$'& WLPHUV7,07,0 FKDQQHOV
$:8WLPHU ELWEDVLFWLPHU
7,0
069
1. Legend:
ADC: Analog-to-digital converter
beCAN: Controller area network
BOR: Brownout reset
I²C: Inter-integrated circuit multimaster interface
IWDG: Independent window watchdog
LINUART: Local interconnect network universal asynchronous receiver transmitter
POR: Power on reset
SPI: Serial peripheral interface
SWIM: Single wire interface module
USART: Universal synchronous asynchronous receiver transmitter
Window WDG: Window watchdog
5 Product overview
This section describes the family features that are implemented in the products covered by
this datasheet.
For more detailed information on each feature please refer to STM8S series and STM8AF
series 8-bit microcontrollers reference manual (RM0016).
5.1.2 Addressing
• 20 addressing modes
• Indexed indirect addressing mode for look-up tables located anywhere in the address
space
• Stack pointer relative addressing mode for efficient implementation of local variables
and parameter passing
5.2 Single wire interface module (SWIM) and debug module (DM)
5.2.1 SWIM
The single wire interface module, SWIM, together with an integrated debug module, permits
non-intrusive, real-time in-circuit debugging and fast memory programming. The interface
can be activated in all device operation modes and can be connected to a running device
(hot plugging).The maximum data transmission speed is 145 bytes/ms.
5.4.1 Architecture
• The memory is organized in blocks of 128 bytes each
• Read granularity: 1 word = 4 bytes
• Write/erase granularity: 1 word (4 bytes) or 1 block (128 bytes) in parallel
• Writing, erasing, word and block management is handled automatically by the memory
interface.
3URJUDPPDEOH
8%&DUHD DUHDPD[LPXP
5HPDLQVZULWHSURWHFWHGGXULQJ,$3 .E\WH
)ODVKSURJUDP
PHPRU\
)ODVKSURJUDPPHPRU\DUHD
:ULWHDFFHVVSRVVLEOHIRU,$3
069
5.5.1 Features
• Clock sources
– 16 MHz high-speed internal RC oscillator (HSI)
– 128 kHz low-speed internal RC (LSI)
– 1-16 MHz high-speed external crystal (HSE)
– Up to 16 MHz high-speed user-external clock (HSE user-ext)
• Reset: After reset the microcontroller restarts by default with an internal 2-MHz clock
(16 MHz/8). The clock source and speed can be changed by the application program
as soon as the code execution starts.
• 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 or individual peripherals.
• Wakeup: In case the device wakes up from low-power modes, the internal RC
oscillator (16 MHz/8) is used for quick startup. After a stabilization time, the device
switches to the clock source that was selected before Halt mode was entered.
• Clock security system (CSS): The CSS permits monitoring of external clock sources
and automatic switching to the internal RC (16 MHz/8) in case of a clock failure.
• Configurable main clock output (CCO): This feature permits to output a clock signal
for use by the application.
User trimming
The register CLK_HSITRIMR with three trimming bits plus one additional bit for the sign
permits frequency tuning by the application program. The adjustment range covers all
possible frequency variations versus supply voltage and temperature. This trimming does
not change the initial production setting.
For reason of compatibility with other devices from the STM8A family, a special mode
with only two trimming bits plus sign can be selected. This selection is controlled
with the HSITRIM0 bit in the option byte registers OPT3 and NOPT3.
5.7 Timers
5.7.3 Beeper
This function generates a rectangular signal in the range of 1, 2 or 4 kHz which can be
output on a pin. This is useful when audible sounds without interference need to be
generated for use in the application.
Table 4. TIM4
Counter Counter Prescaler Inverted Repetition trigger External Break
Timer Channels
width type factor outputs counter unit trigger input
2n
TIM4 8-bit Up 0 None No No No No
n = 0 to 7
• 8-bit auto-reload, adjustable prescaler ratio to any power of two from 1 to 128
• Clock source: master clock
• Interrupt source: 1 x overflow/update
ADC ADC1
ADC features
• 10-bit resolution
• Single and continuous conversion modes
• Programmable prescaler: fMASTER divided by 2 to 18
• Conversion trigger on timer events and external events
• Interrupt generation at end of conversion
• Selectable alignment of 10-bit data in 2 x 8 bit result register
• Shadow registers for data consistency
• ADC input range: VSSA ≤ VIN ≤ VDDA
• Analog watchdog
• Schmitt-trigger on analog inputs can be disabled to reduce power consumption
• Scan mode (single and continuous)
• Dedicated result register for each conversion channel
• Buffer mode for continuous conversion
Note: An additional AIN12 analog input is not selectable in ADC scan mode or with analog
watchdog. Values converted from AIN12 are stored only into the ADC_DRH/ADC_DRL
registers.
LINUART UART2
• Interrupt:
– Successful address/data communication
– Error condition
– Wakeup from Halt
• Wakeup from Halt on address detection in slave mode
LIN mode
Master mode:
• LIN break and delimiter generation
• LIN break and delimiter detection with separate flag and interrupt source for read back
checking.
Slave mode:
• Autonomous header handling – one single interrupt per valid header
• Mute mode to filter responses
• Identifier parity error checking
• LIN automatic resynchronization, allowing operation with internal RC oscillator (HSI)
clock source
• Break detection at any time, even during a byte reception
• Header errors detection:
– Delimiter too short
– Synch field error
– Deviation error (if automatic resynchronization is enabled)
– Framing error in synch field or identifier field
– Header time-out
UART mode
• Full duplex, asynchronous communications - NRZ standard format (mark/space)
• High-precision baud rate generator
– A common programmable transmit and receive baud rates up to fMASTER/16
• Programmable data word length (8 or 9 bits) – 1 or 2 stop bits – parity control
• Separate enable bits for transmitter and receiver
• Error detection flags
• Reduced power consumption mode
• Multi-processor communication - enter mute mode if address match does not occur
• Wakeup from mute mode (by idle line detection or address mark detection)
• Two receiver wakeup modes:
– Address bit (MSB)
– Idle line
PD0 (HS)/TIM3_CH2/CLK_CCO/TIM1_BRK
PD2 (HS)/TIM3_CH1/TIM2_CH3
PD3 (HS)/TIM2_CH2/ADC_ETR
PD4 (HS)/TIM2_CH1/BEEP
PD6/LINUART_RX
PD5/LINUART_TX
PD1 (HS)/SWIM
PD7/TLI
32 31 30 29 28 27 26 25
NRST 1 24 PC7/SPI_MISO
OSCIN/PA1 2 23 PC6/SPI_MOSI
OSCOUT/PA2 3 22 PC5/SPI_SCK
VSS 4 21 PC4 (HS)/TIM1_CH4
VCAP 5 20 PC3 (HS)/TIM1_CH3
VDD 6 19 PC2 (HS)/TIM1_CH2
VDDIO 7 18 PC1 (HS)/TIM1_CH1
AIN12/PF4 8 17 PE5/SPI_NSS
9 10 11 12 13 14 1516
VDDA
VSSA
I2C_SDA/AIN5/PB5
I2C_SCL/AIN4/PB4
TIM1_ETR/AIN3/PB3
TIM1_CH3N/AIN2/PB2
TIM1_CH2N/AIN1/PB1
TIM1_CH1N/AIN0/PB0
PD3 (HS)/TIM2_CH2/ADC_ETR
PD4 (HS)/TIM2_CH1/BEEP
PD0 (HS)/TIM3_CH2
PD2 (HS)/TIM3_CH1
PD6/LINUART_RX
PD5/LINUART_TX
PE3/TIM1_BKIN
PD1 (HS)/SWIM
PE0/CLK_CCO
PE2/I2C_SDA
PE1/I2C_SCL
PD7/TLI
48 47 46 45 44 43 42 41 40 39 38 37
NRST 1 36 PG1
OSCIN/PA1 2 35 PG0
OSCOUT/PA2 3 34 PC7/SPI_MISO
VSSIO_1 4 33 PC6/SPI_MOSI
VSS 5 32 VDDIO_2
VCAP 6 31 VSSIO_2
VDD 7 30 PC5/SPI_SCK
VDDIO_1 8 29 PC4 (HS)/TIM1_CH4
TIM2_CH3/PA3 9 28 PC3 (HS)/TIM1_CH3
PA4 10 27 PC2 (HS)/TIM1_CH2
PA5 11 26 PC1 (HS)/TIM1_CH1
PA6 12 25 PE5/SPI_NSS
13 14 15 16 17 18 19 20 21 2223 24
VDDA
VSSA
AIN7/PB7
AIN6/PB6
AIN5/PB5
AIN4/PB4
TIM1_ETR/AIN3/PB3
TIM1_CH3N/AIN2/PB2
TIM1_CH2N/AIN1/PB1
TIM1_CH1N/AIN0/PB0
AIN8/PE7
AIN9/PE6
Table 7. Legend/abbreviation
Type I= input, O = output, S = power supply
Level Input CM = CMOS (standard for all I/Os)
Output HS = High sink (8 mA)
Output speed O1 = Standard (up to 2 MHz)
O2 = Fast (up to 10 MHz)
O3 = Fast/slow programmability with slow as default state after reset
O4 = Fast/slow programmability with fast as default state after reset
Port and control Input float = floating, wpu = weak pull-up
configuration
Output T = true open drain, OD = open drain, PP = push pull
Bold X (pin state after reset release).
Reset state Unless otherwise specified, the pin state is the same during the reset phase (i.e.
“under reset”) and after internal reset release (i.e. at reset state).
Main function
(after reset)
Alternate
VFQFPN/LQFP32
Ext. interrupt
Default alternate function after
Type
Pin name
High sink
LQFP48
floating
function remap
Speed
wpu
OD
PP
[option bit]
Main function
(after reset)
Alternate
VFQFPN/LQFP32
Ext. interrupt
Default alternate function after
Type
Pin name
High sink
LQFP48
floating
function remap
Speed
wpu
OD
PP
[option bit]
Main function
(after reset)
Alternate
VFQFPN/LQFP32
Ext. interrupt
Default alternate function after
Type
Pin name
High sink
LQFP48
floating
function remap
Speed
wpu
OD
PP
[option bit]
PD6/
47 31 I/O X X X - O1 X X Port D6 LINUART data receive -
LINUART_RX
48 32 PD7/TLI(8) I/O X X X - O1 X X Port D7 Top level interrupt -
1. Refer to Table 7 for the definition of the abbreviations.
2. Reset state is shown in bold.
3. In Halt/Active-halt mode this pad behaves in the following way:
- the input/output path is disabled
- if the HSE clock is used for wakeup, the internal weak pull up is disabled
- if the HSE clock is off, internal weak pull up setting from corresponding OR bit is used
By managing the OR bit correctly, it must be ensured that the pad is not left floating during Halt/Active-halt.
4. On this pin, a pull-up resistor as specified in Table 35. I/O static characteristics is enabled during the reset phase of the
product.
5. AIN12 is not selectable in ADC scan mode or with analog watchdog.
6. In the open-drain output column, ‘T’ defines a true open-drain I/O (P-buffer, week pull-up, and protection diode to VDD are
not implemented)
7. The PD1 pin is in input pull-up during the reset phase and after reset release.
8. If this pin is configured as interrupt pin, it will trigger the TLI.
5$0
.E\WH
5$0HQG
VWDFN
5HVHUYHG
[
XSWR.E\WHGDWD((3520
[
5HVHUYHG
[
2SWLRQE\WHV
[
5HVHUYHG
[
+DUGZDUHUHJLVWHUV
['
5HVHUYHG
[
.E\WHRI%RRW520
[
5HVHUYHG
[)
&386:,0GHEXJ,7&
UHJLVWHUV
[
,QWHUUXSWYHFWRUV
[
8SWR.E\WHRI)ODVK
SURJUDPPHPRU\
)ODVKSURJUDPPHPRU\HQG
069
0x00 53E0 ADC _DB0RH ADC data buffer register 0 high 0x00
0x00 53E1 ADC _DB0RL ADC data buffer register 0 low 0x00
0x00 53E2 ADC _DB1RH ADC data buffer register 1 high 0x00
0x00 53E3 ADC _DB1RL ADC data buffer register 1 low 0x00
0x00 53E4 ADC _DB2RH ADC data buffer register 2 high 0x00
0x00 53E5 ADC _DB2RL ADC data buffer register 2 low 0x00
0x00 53E6 ADC _DB3RH ADC data buffer register 3 high 0x00
0x00 53E7 ADC _DB3RL ADC data buffer register 3 low 0x00
0x00 53E8 ADC _DB4RH ADC data buffer register 4 high 0x00
0x00 53E9 ADC _DB4RL ADC data buffer register 4 low 0x00
ADC
0x00 53EA ADC _DB5RH ADC data buffer register 5 high 0x00
0x00 53EB ADC _DB5RL ADC data buffer register 5 low 0x00
0x00 53EC ADC _DB6RH ADC data buffer register 6 high 0x00
0x00 53ED ADC _DB6RL ADC data buffer register 6 low 0x00
0x00 53EE ADC _DB7RH ADC data buffer register 7 high 0x00
0x00 53EF ADC _DB7RL ADC data buffer register 7 low 0x00
0x00 53F0 ADC _DB8RH ADC data buffer register 8 high 0x00
0x00 53F1 ADC _DB8RL ADC data buffer register 8 low 0x00
0x00 53F2 ADC _DB9RH ADC data buffer register 9 high 0x00
0x00 53F3 ADC _DB9RL ADC data buffer register 9 low 0x00
0x00 53F4 to
Reserved area (12 bytes)
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
ADC
ADC Schmitt trigger disable register
0x00 5406 ADC_TDRH 0x00
high
ADC Schmitt trigger disable register
0x00 5407 ADC_TDRL 0x00
low
0x00 5408 ADC _HTRH ADC high threshold register high 0xFF
0x00 5409 ADC_HTRL ADC high threshold register low 0x03
0x00 540A ADC _LTRH ADC low threshold register high 0x00
0x00 7F81 to
Reserved area (15 bytes)
0x00 7F8F
0x00 7F90 DM_BK1RE DM breakpoint 1 register extended byte 0xFF
0x00 7F91 DM_BK1RH DM breakpoint 1 register high byte 0xFF
0x00 7F92 DM_BK1RL DM breakpoint 1 register low byte 0xFF
0x00 7F93 DM_BK2RE DM breakpoint 2 register extended byte 0xFF
0x00 7F94 DM_BK2RH DM breakpoint 2 register high byte 0xFF
0x00 7F95 DM DM_BK2RL DM breakpoint 2 register low byte 0xFF
0x00 7F96 DM_CR1 DM debug module control register 1 0x00
0x00 7F97 DM_CR2 DM debug module control register 2 0x00
0x00 7F98 DM_CSR1 DM debug module control/status register 1 0x10
0x00 7F99 DM_CSR2 DM debug module control/status register 2 0x00
0x00 7F9A DM_ENFCTR DM enable function register 0xFF
0x00 7F9B to
Reserved area (5 bytes)
0x00 7F9F
1. Accessible by debug module only
2. Product dependent value, see Figure 5: Register and memory map of STM8A products.
8 Interrupt table
9 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. Each option
byte has to be stored twice, for redundancy, in a regular form (OPTx) and a complemented
one (NOPTx), except for the ROP (read-out protection) option byte and option bytes 8 to 16.
Option bytes can be modified in ICP mode (via SWIM) by accessing the EEPROM address
shown in Table 15: Option bytes below.
Option bytes can also be modified ‘on the fly’ by the application in IAP mode, except the
ROP and UBC options that can only be toggled in ICP mode (via SWIM).
Refer to the STM8 Flash programming manual (PM0051) and STM8 SWIM communication
protocol and debug module user manual (UM0470) for information on SWIM programming
procedures.
Read-out
0x00
protection OPT0 ROP[7:0] 0x00
4800
(ROP)
0x00
User boot OPT1 Reserved UBC[5:0] 0x00
4801
code
0x00 (UBC) NOPT1 Reserved NUBC[5:0] 0xFF
4802
0x00 Alternate OPT2 AFR7 AFR6 AFR5 AFR4 AFR3 AFR2 AFR1 AFR0 0x00
4803 function
0x00 remapping NAFR NAFR NAFR NAFR NAFR NAFR NAFR NAFR
(AFR) NOPT2 0xFF
4804 7 6 5 4 3 2 1 0
0x00 16MHZ LSI IWDG WWDG WWDG
OPT3 Reserved 0x00
4805 Watchdog TRIM0 _EN _HW _HW _HALT
0x00 option N16MHZ NLSI NIWDG NWWD NWWG
NOPT3 Reserved 0xFF
4806 TRIM0 _EN _HW G_HW _HALT
0x00 EXT CKAWU PRS PRS
OPT4 Reserved 0x00
4807 Clock CLK SEL C1 C0
0x00 option NEXT NCKAW NPR NPR
NOPT4 Reserved 0xFF
4808 CLK USEL SC1 SC0
0x00
OPT5 HSECNT[7:0] 0x00
4809 HSE clock
0x00 startup
NOPT5 NHSECNT[7:0] 0xFF
480A
0x00
OPT6 TMU[3:0] 0x00
480B
TMU
0x00
NOPT6 NTMU[3:0] 0xFF
480C
0x00 WAIT
OPT7 Reserved 0x00
480D Flash wait STATE
0x00 states NWAIT
NOPT7 Reserved 0xFF
480E STATE
0x00
Reserved
480F
0x00
OPT8 TMU_KEY 1 [7:0] 0x00
4810
0x00
OPT9 TMU_KEY 2 [7:0] 0x00
4811
0x00
OPT10 TMU_KEY 3 [7:0] 0x00
4812
0x00
OPT11 TMU_KEY 4 [7:0] 0x00
4813
0x00
TMU OPT12 TMU_KEY 5 [7:0] 0x00
4814
0x00
OPT13 TMU_KEY 6 [7:0] 0x00
4815
0x00
OPT14 TMU_KEY 7 [7:0] 0x00
4816
0x00
OPT15 TMU_KEY 8 [7:0] 0x00
4817
0x00
OPT16 TMU_MAXATT [7:0] 0xC7
4818
0x00
4819
Reserved
to
487D
0x00
OPT17 BL [7:0] 0x00
487E Boot-
0x00 loader(1)
NOPT17 NBL[7:0] 0xFF
487F
1. This option consists of two bytes that must have a complementary value in order to be valid. If the option is invalid, it has no
effect on EMC reset.
10 Electrical characteristics
670$3,1
S)
06Y9
670$3,1
9,1
06Y9
VDDx - VSS Supply voltage (including VDDA and VDDIO)(1) -0.3 6.5 V
Input voltage on true open drain pins (PE1, PE2)(2) VSS - 0.3 6.5
VIN V
Input voltage on any other pin(2) VSS - 0.3 VDD + 0.3
I&380+]
)XQFWLRQDOLW\
QRW
JXDUDQWHHGLQ
WKLVDUHD
ϭϲ
ϭϮ )XQFWLRQDOLW\JXDUDQWHHG
#7$WR&
ϴ
ϰ
Ϭ
6XSSO\YROWDJH9
06Y9
& (6/
(65
5/HDN
06Y9
1. Legend: ESR is the equivalent series resistance and ESL is the equivalent inductance.
Table 23. Total current consumption in Run, Wait and Slow mode.
General conditions for VDD apply, TA = −40 to 150 °C
Symbol Parameter Conditions Typ Max Unit
Figure 10. Typ. IDD(RUN)HSE vs. VDD Figure 11. Typ. IDD(RUN)HSE vs. fCPU
@fCPU = 16 MHz, peripheral = on @ VDD = 5.0 V, peripheral = on
10 10
9
25°C 25°C
9
IDD(RUN)HSE [mA]
85°C 85°C
IDD(RUN)HSE [mA]
8 8
7 125°C 7 125°C
6 6
5 5
4 4
3 3
2 2
1 1
0 0
2.5 3 3.5 4 4.5 5 5.5 6 0 5 10 15 20 25 30
Figure 12. Typ. IDD(RUN)HSI vs. VDD Figure 13. Typ. IDD(WFI)HSE vs. VDD
@ fCPU = 16 MHz, peripheral = off @ fCPU = 16 MHz, peripheral = on
4 6
IDD(WFI)HSE [mA]
IDD(RUN)HSI [mA]
5
3 4
2 3
25°C 25°C
2
1 85°C 85°C
1 125°C
125°C
0 0
2.5 3.5 4.5 5.5 6.5 2.5 3.5 4.5 5.5 6.5
VDD [V] VDD [V]
Figure 14. Typ. IDD(WFI)HSE vs. fCPU Figure 15. Typ. IDD(WFI)HSI vs. VDD
@ VDD = 5.0 V, peripheral = on @ fCPU = 16 MHz, peripheral = off
2.5
6
IDD(WFI)HSI [mA]
5
IDD(WFI)HSE [mA]
4 1.5
3
1
25°C
2 25°C
0.5 85°C
85°C
1
125°C
125°C 0
0
2.5 3 3.5 4 4.5 5 5.5 6
0 5 10 15 20 25 30
VDD [V]
fcpu [MHz]
9
+6(+
9 +6(/
I+6(
([WHUQDOFORFN
VRXUFH
26&,1
670
069
5P
I+6(WRFRUH
&2 5)
/P
&/
&P 26&,1 JP
5HVRQDWRU
&XUUHQWFRQWURO
5HVRQDWRU
26&287
&/
670
06Y9
g m » g mcrit
f 2 2
g mcrit = ( 2 × Π × HSE ) × R m ( 2Co + C )
3%
-40°C
2% 25°C
HSI frequency variation [%]
85°C
1%
125°C
0%
-1%
-2%
-3%
2.5 3 3.5 4 4.5 5 5.5 6
VDD [V]
3%
2%
LSI frequency variation [%]
1% 25°C
0%
-1%
-2%
-3%
2.5 3 3.5 4 4.5 5 5.5 6
VDD [V]
2. Guaranteed by design.
3. Data based on characterization results, not tested in production.
0
2.5 3 3.5 4 4.5 5 5.5 6
VDD [V]
55
Pull-Up resistance [k ohm]
50
45
40 -40°C
25°C
35 85°C
125°C
30
2.5 3 3.5 4 4.5 5 5.5 6
VDD [V]
120
100
20
125°C
0
0 1 2 3 4 5 6
VDD [V]
Note: The pull-up is a pure resistor (slope goes through 0).
Figure 23. Typ. VOL @ VDD = 3.3 V (standard Figure 24. Typ. VOL @ VDD = 5.0 V (standard
ports) ports)
-40°C -40°C
1.5 1.5
25°C 25°C
1.25 85°C 1.25 85°C
125°C 125°C
1 1
VOL [V]
VOL [V]
0.75 0.75
0.5 0.5
0.25 0.25
0 0
0 1 2 3 4 5 6 7 0 2 4 6 8 10 12
IOL [mA] IOL [mA]
Figure 25. Typ. VOL @ VDD = 3.3 V (true open Figure 26. Typ. VOL @ VDD = 5.0 V (true open
drain ports) drain ports)
-40°C -40°C
2 2
25°C 25°C
1.75 1.75
85°C 85°C
1.5 125°C 1.5 125°C
1.25 1.25
VOL [V]
VOL [V]
1 1
0.75 0.75
0.5 0.5
0.25 0.25
0 0
0 2 4 6 8 10 12 14 0 5 10 15 20 25
IOL [mA] IOL [mA]
Figure 27. Typ. VOL @ VDD = 3.3 V (high sink Figure 28. Typ. VOL @ VDD = 5.0 V (high sink
ports) ports)
-40°C -40°C
1.5 1.5
25°C 25°C
1.25 85°C 1.25 85°C
125°C 125°C
1 1
VOL [V]
VOL [V]
0.75 0.75
0.5 0.5
0.25 0.25
0 0
0 2 4 6 8 10 12 14 0 5 10 15 20 25
IOL [mA] IOL [mA]
Figure 29. Typ. VDD - VOH @ VDD = 3.3 V Figure 30. Typ. VDD - VOH @ VDD = 5.0 V
(standard ports) (standard ports)
-40°C -40°C
2 2
25°C 25°C
1.75 1.75
85°C 85°C
1.5 125°C 1.5 125°C
1.25
VDD - V OH [V]
1.25
VDD - V OH [V]
1 1
0.75 0.75
0.5 0.5
0.25 0.25
0 0
0 1 2 3 4 5 6 7 0 2 4 6 8 10 12
IOH [mA] IOH [mA]
Figure 31. Typ. VDD - VOH @ VDD = 3.3 V (high Figure 32. Typ. VDD - VOH @ VDD = 5.0 V (high
sink ports) sink ports)
-40°C -40°C
2 2
25°C 25°C
1.75 1.75
85°C 85°C
1.5 125°C 1.5 125°C
1.25
VDD - V OH [V]
1.25
VDD - V OH [V]
1 1
0.75 0.75
0.5 0.5
0.25 0.25
0 0
0 2 4 6 8 10 12 14 0 5 10 15 20 25
IOH [mA] IOH [mA]
Figure 33. Typical NRST VIL and VIH vs VDD @ four temperatures
-40°C
6
25°C
5 85°C
125°C
4
VIL / V IH [V]
0
2.5 3 3.5 4 4.5 5 5.5 6
VDD [V]
60 -40°C
25°C
45
40
35
30
2.5 3 3.5 4 4.5 5 5.5 6
VDD [V]
120
NRST Pull-Up current [µA]
100
80
60 -40°C
25°C
40
85°C
20 125°C
0
0 1 2 3 4 5 6
VDD [V]
The reset network shown in Figure 36 protects the device against parasitic resets. The user
must ensure that the level on the NRST pin can go below VIL(NRST) max (see Table 36:
NRST pin characteristics), otherwise the reset is not taken into account internally.
9'' 670$
538
([WHUQDO
UHVHW 1567 )LOWHU ,QWHUQDOUHVHW
FLUFXLW
ȝ)
2SWLRQDO
06Y9
Master mode 0 10
fSCK
SPI clock frequency VDD < 4.5 V 0 6(1) MHz
1/tc(SCK) Slave mode
VDD = 4.5 V to 5.5 V 0 8(1)
tr(SCK)
SPI clock rise and fall time Capacitive load: C = 30 pF - 25(2)
tf(SCK)
tsu(NSS)(3) NSS setup time Slave mode 4 * tMASTER -
(3)
th(NSS) NSS hold time Slave mode 70 -
tw(SCKH)(3)
SCK high and low time Master mode tSCK/2 - 15 tSCK/2 + 15
tw(SCKL)(3)
tv(MO)(3) Data output valid time Master mode (after enable edge) - 30
th(SO)(3) Slave mode (after enable edge) 31 -
Data output hold time
th(MO)(3) Master mode (after enable edge) 12 -
1. fSCK < fMASTER/2.
2. The pad has to be configured accordingly (fast mode).
3. Values based on design simulation and/or characterization results, and not tested in production.
4. Min time is for the minimum time to drive the output and the max time is for the maximum time to validate the data.
5. 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 37. SPI timing diagram where slave mode and CPHA = 0
166LQSXW
W68166 WF6&. WK166
&3+$
6&.,QSXW
&32/
WZ6&.+
&3+$ WZ6&./
&32/
W962 WK62 WU6&. WGLV62
WD62 WI6&.
WK6,
DLF
1. Measurement points are at CMOS levels: 0.3 VDD and 0.7 VDD.
Figure 38. SPI timing diagram where slave mode and CPHA = 1
166LQSXW
&3+$
&32/ WZ6&.+
&3+$ WZ6&./
&32/
WU6&.
WY62 WK62 WGLV62
WD62 WI6&.
0,62
06%287 %,7287 /6%287
287387
WVX6, WK6,
026,
,1387 06%,1 %,7,1 /6%,1
DLE
1. Measurement points are at CMOS levels: 0.3 VDD and 0.7 VDD.
+LJK
166LQSXW
WF6&.
6&.2XWSXW
&3+$
&32/
&3+$
&32/
6&.2XWSXW
&3+$
&32/
&3+$
&32/
WZ6&.+ WU6&.
WVX0, WZ6&./ WI6&.
0,62
,13 87 06%,1 %,7,1 /6%,1
WK0,
026,
06%287 % , 7287 /6%287
287387
WY02 WK02
DLF
1. Measurement points are at CMOS levels: 0.3 VDD and 0.7 VDD.
s ^dDϴ
97
5VZLWFK
9$,1 5$,1 9
/Edž ELW$'
7V FRQYHUVLRQ
97
&$,1 ,/ &VDPS
9
06Y9
1. Legend: RAIN = external resistance, CAIN = capacitors, Csamp = internal sample and hold capacitor.
0 1 2 3 4 5 6 7 1021102210231024
VSSA VDDA
Max fCPU(1)
Symbol Parameter Unit
Monitored
General conditions
frequency band 8 16
MHz 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) and
• A current injection (applied to each input, output and configurable I/O pin) are
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
TA = 85 °C
LU Static latch-up class A
TA = 125 °C
TA = 150 °C
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).
11 Package information
&
GGG &
$
$ $
'
H
( E (
/
3LQ,'
5 '
/
%RWWRPYLHZ
?-%?!-+/2?6
Table 46. VFQFPN32 - 32-pin, 5x5 mm, 0.5 mm pitch very thin profile fine pitch quad
flat package mechanical data
millimeters inches(1)
Symbol
Min Typ Max Min Typ Max
Figure 43. VFQFPN32 - 32-pin, 5x5 mm, 0.5 mm pitch very thin profile fine pitch quad
flat package recommended footprint
9DU$
9DU%
9DU$
9DU%
?&0?!-+/2?6
Device marking
The following figure gives an example of topside marking orientation versus pin 1 identifier
location.
3URGXFW
LGHQWLILFDWLRQ 999999
'DWHFRGH
: 88
6WDQGDUG67ORJR 5HYLVLRQFRGH
3LQLGHQWLILHU
069
3%!4).'
0,!.%
#
!
!
!
C
MM
'!5'% 0,!.%
CCC #
$ +
!
,
$ ,
$
%
%
%
0).
)$%.4)&)#!4)/.
E "?-%?6
A - - 1.600 - - 0.0630
A1 0.050 - 0.150 0.0020 - 0.0059
A2 1.350 1.400 1.450 0.0531 0.0551 0.0571
b 0.170 0.220 0.270 0.0067 0.0087 0.0106
c 0.090 - 0.200 0.0035 - 0.0079
D 8.800 9.000 9.200 0.3465 0.3543 0.3622
D1 6.800 7.000 7.200 0.2677 0.2756 0.2835
D3 - 5.500 - - 0.2165 -
E 8.800 9.000 9.200 0.3465 0.3543 0.3622
E1 6.800 7.000 7.200 0.2677 0.2756 0.2835
E3 - 5.500 - - 0.2165 -
e - 0.500 - - 0.0197 -
L 0.450 0.600 0.750 0.0177 0.0236 0.0295
L1 - 1.000 - - 0.0394 -
k 0° 3.5° 7° 0° 3.5° 7°
ccc - - 0.080 - - 0.0031
1. Values in inches are converted from mm and rounded to 4 decimal digits.
AID
Device marking
The following figure gives an example of topside marking orientation versus pin 1 identifier
location.
3URGXFW
LGHQWLILFDWLRQ 999999
999999
'DWHFRGH
6WDQGDUG67ORJR
: 88
5HYLVLRQFRGH
3LQLGHQWLILHU
069
3%!4).'
0,!.%
#
!
!
C
!
MM
'!5'% 0,!.%
CCC #
+
$
,
!
$
,
$
B
%
%
0).
)$%.4)&)#!4)/.
E 7@.&@7
A - - 1.600 - - 0.0630
A1 0.050 - 0.150 0.0020 - 0.0059
A2 1.350 1.400 1.450 0.0531 0.0551 0.0571
b 0.300 0.370 0.450 0.0118 0.0146 0.0177
c 0.090 - 0.200 0.0035 - 0.0079
D 8.800 9.000 9.200 0.3465 0.3543 0.3622
D1 6.800 7.000 7.200 0.2677 0.2756 0.2835
D3 - 5.600 - - 0.2205 -
E 8.800 9.000 9.200 0.3465 0.3543 0.3622
E1 6.800 7.000 7.200 0.2677 0.2756 0.2835
E3 - 5.600 - - 0.2205 -
e - 0.800 - - 0.0315 -
L 0.450 0.600 0.750 0.0177 0.0236 0.0295
L1 - 1.000 - - 0.0394 -
k 0° 3.5° 7° 0° 3.5° 7°
ccc - - 0.100 - - 0.0039
1. Values in inches are converted from mm and rounded to 4 decimal digits.
6?&0?6
Device marking
The following figure gives an example of topside marking orientation versus pin 1 identifier
location.
3URGXFW
LGHQWLILFDWLRQ 999999
999999
'DWHFRGH
6WDQGDUG67ORJR
: 88
5HYLVLRQFRGH
3LQLGHQWLILHU
069
12 Ordering information
Device family
62 = Silicon rev X and rev W, LIN only
Pin count
6 = 32 pins
8 = 48 pins
HSI accuracy
Blank = ± 5 %
I = ± 2.5 %
Package type
T = LQFP
U = VFQFPN
Temperature range
A = -40 to 85 °C
C = -40 to 125 °C
D = -40 to 150 °C
Packing
Y = Tray
U = Tube
X = Tape and reel compliant with EIA 481-C
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.
2. Parts marked as “ES”, “E” or accompanied by an Engineering Sample notification letter, are not yet
qualified and therefore not yet ready to be used in production and any consequences deriving from such
usage will not be at ST charge. In no event, ST will be liable for any customer usage of these engineering
samples in production. ST Quality has to be contacted prior to any decision to use these Engineering
Samples to run qualification activity.
3. Customer specific FASTROM code or custom device configuration. This field shows ‘SSS’ if the device
contains a super set silicon, usually equipped with bigger memory and more I/Os. This silicon is supposed
to be replaced later by the target silicon.
ST visual develop
Full-featured integrated development environment from STMicroelectronics, featuring:
• Seamless integration of C and ASM toolsets
• Full-featured debugger
• Project management
• Syntax highlighting editor
• Integrated programming interface
• Support of advanced emulation features for STice such as code profiling and coverage
14 Revision history
Updated:
– the product naming in the document headers and captions,
– LIN version in Features and Section 5.9.3: Universal
asynchronous receiver/transmitter with LIN support (LINUART).
Added:
– the third table footnote to Table 22: Operating conditions at power-
up/power-down,
– Figure 44: VFQFPN32 marking example (package top view),
09-Jun-2015 10 – Figure 47: LQFP48 marking example (package top view),
– Figure 50: LQFP32 marking example (package top view),
– the note about the parts marked “E” and “ES” below Figure 51:
STM8AF6246/48/66/68 ordering information scheme(1) (2),
– the standard for EMI characteristics in Table 43: EMI data.
Removed the references to STM8AF61xx and STM8AH61xx
obsolete products.
Moved Section 11.4: Thermal characteristics to Section 11: Package
information.
Update Table 46: VFQFPN32 - 32-pin, 5x5 mm, 0.5 mm pitch very
14-Jun-2016 11
thin profile fine pitch quad flat package mechanical data
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
acknowledgement.
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. 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.