STNRG 388 A
STNRG 388 A
STNRG 388 A
Contents
1 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3 Introducing SMED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4 System architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5 Product overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.1 SMED (state machine event driven): configurable PWM generator . . . . . 16
5.1.1 SMED coupling schemes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.1.2 Connection matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
5.1.3 Architecture and registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
5.1.4 Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
5.1.5 Instruction set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
5.1.6 Single wire interface module (SWIM) . . . . . . . . . . . . . . . . . . . . . . . . . . 20
5.1.7 Debug module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
5.2 Basic peripherals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
5.2.1 Vectored interrupt controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
5.2.2 Timers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
5.2.3 Flash program and data E2PROM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
5.2.4 Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
5.2.5 Write protection (WP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
5.2.6 Protection of user boot code (UBC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
5.2.7 Read-out protection (ROP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
5.3 Clock controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
5.3.1 Internal 16 MHz RC oscillator (HSI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
5.3.2 Internal 153.6 kHz RC oscillator (LSI) . . . . . . . . . . . . . . . . . . . . . . . . . . 25
5.3.3 Internal 96 MHz PLL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
5.3.4 External clock input/crystal oscillator (HSE) . . . . . . . . . . . . . . . . . . . . . 25
5.4 Power management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
5.5 Communication interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
9 Interrupt table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
10 Option bytes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
10.1 Option byte register overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
10.2 Option byte register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
10.2.1 ROP (memory read-out protection register) . . . . . . . . . . . . . . . . . . . . . 66
10.2.2 UBC (UBC user boot code register) . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
10.2.3 nUBC (UBC user boot code register protection) . . . . . . . . . . . . . . . . . . 67
10.2.4 GENCFG (general configuration register) . . . . . . . . . . . . . . . . . . . . . . . 67
10.2.5 nGENCFG (general configuration register protection) . . . . . . . . . . . . . . 68
11 Device identification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
11.1 Unique ID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
11.2 Device ID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
12 Electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
12.1 Parameter conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
12.1.1 Minimum and maximum values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
12.1.2 Typical values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
12.1.3 Typical curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
12.1.4 Typical current consumption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
12.1.5 Loading capacitors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
12.1.6 Pin output voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
12.2 Absolute maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
12.3 Operating conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
12.3.1 VOUT external capacitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
12.3.2 Supply current characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
List of tables
List of figures
1 Description
STNRG devices are a part of the STNRG family of STMicroelectronics® digital devices
designed for advanced power conversion applications.
The STNRG improves the design of the successful STLUX™ family, now integrated in
a wide range of LED driver architectures, to support industrial power conversion
applications such as PFC+LLC, interleaved LC DC/DC, interleaved PFC for smart power
supplies as well as the full bridge for pilot line drivers for electric vehicles.
Package TSSOP38
Pin count 38
SMED numbers 6
SMED PWM output pins 6
Fast digital inputs pins 6
Positive comparator input pin 4
Negative comparator input pins 3(1)
Comparator hysteresis Yes
Internal DACs 4
ADC input pins 8
ADC gain x1 - x4
ADC hardware trigger Yes
GPIO Port 0 pins 6
UART peripheral Yes
2C
Communication I peripheral Yes
DALI peripheral Yes
HSE function Yes
System timer 1
Timers Auxiliary timer 1
Basic timer 2
Auto-wakeup timer 1
Window watchdog timer 1
Watchdog
Independent watchdog timer 1
Flash program memory 32 Kbytes
EEPROM data memory 1 Kbytes
RAM 6 Kbytes
SWIM pin Mixed
1. Some CPM pin is shared with other signals.
3 Introducing SMED
The heart of the STNRG controller family is the SMED (state machine event driven)
technology which allows the device to pilot six independently configurable PWM clocks with
a maximum resolution of 1.3 ns. A SMED is a powerful autonomous state machine, which is
programmed to react to both external and internal events and may evolve without any
software intervention. The SMED reaction time can be as low as 10.4 ns, giving the STNRG
the ability of operating in time critical applications. The SMEDs offer superior performances
when compared to traditional, timer based, PWM generators.
Each SMED is configured via the STNRG internal microcontroller. The integrated controller
extends the STNRG reliability and guarantees more than 15 years of both operating lifetime
and memory data retention for program and data memory after cycling.
A set of dedicated peripherals complete the STNRG device:
4 analog comparators with configurable references and 50 ns max. propagation delay.
It is ideal to implement zero current detection algorithms or detect current peaks.
10-bit ADC with configurable op amp and 8-channel sequencer.
96 MHz PLL for high output signal resolution.
Documentation
This datasheet contains the description of features, pinout, pin assignment, electrical
characteristics, mechanical data and ordering information.
For information on programming, erasing and protection of the internal Flash memory,
please refer to the STM8S reference in the programming manual “How to program
STM8S and STM8A Flash program memory and data EEPROM” (PM0051).
For information on the debug and SWIM (single wire interface module) interface 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).
4 System architecture
The STNRG device generates and controls PWM signals by means of a state machine,
called SMED (state machine event driven). Figure 1 gives an overview of the internal
architecture.
The core of the device is the SMED unit: a hardware state machine driven by system
events. The SMED includes 4 states (S0, S1, S2 and S3) available during running
operations. A special HOLD state is provided as well. The SMED allows the user to
configure, for every state, which system events will trigger a transaction to a new state.
During a transaction from one state to the other, the PWM output signal level can be
updated.
Once a SMED is configured and running, it becomes an autonomous unit, so no interaction
is required since the SMED automatically reacts to system events.
Thanks to the SMED's 96 MHz operating frequency and their automatic dithering function,
the PWM maximum resolution is 1.3 ns.
The STNRG family has 6 SMEDs available. Multiple SMEDs can operate independently
from each other or they can be grouped together to form a more powerful state machine.
The STNRG also integrates a low power STM8 microcontroller which is used to configure
and monitor the SMED activity and to supply external communication such as the UART, I2C
or DALI. The STM8 controller has full access to all the STNRG subsystems, including the
SMEDs. The STNRG family also features a sequential ADC, which can be configured to
continuously sample up to 8 channels.
Section : Block diagram illustrates the overall system block and shows how SMEDs have
been implemented in the STNRG architecture.
Block diagram
Figure 2. Internal block diagram
-73 %-7%
)4&FYUPTDJMMBUPS $MPDLDPOUSPMMFS 3FTFUDPOUSPM
QPXFS NBOBHFNFOU VOJU
,#'MBTI
%"-*
QSPHSBNNFNPSZ
1
,#&¢130. 6"35
EBUBNFNP SZ
,#3". (1*0 *
0
,#30.
CPPUMPBEFS *$
.4$ 1
.JTDSFHJTUFST
*OUFSOBM *
"EESFTTBOE EBUB CVT
DPOUSPMMFS O
*
U %JHJUBMJOQVUMJOFT
0
$PNQBSBUPS%"$
# $POOFDUJPO#PY
48*.%.
EFCVHNPEVMF
V
T
(1*0
5*.&34
4ZTUFNUJNFS
"VYUJNFS "%$XJUI01".1
#BTJDUJNFS
#BTJDUJNFS
".W
5 Product overview
1. The PWM4 and PWM5 output pins are not present on all STNRG devices.
1. The CPP2 and CMP3 inputs are connected together in some STNRG devices.
(x) (y) 00 01 10 11
execution context), 20 addressing modes including indexed indirect and relative addressing
and 80 instructions.
5.1.4 Addressing
20 addressing modes
Indexed indirect addressing mode for lookup tables located in the entire address space
Stack pointer relative addressing mode for efficient implementation of local variables
and parameter passing
5.2.2 Timers
The STNRG family provides several timers which are used by software and do not interact
directly with the SMED and the PWM generation.
System timers
The system timer consists of a 16-bit autoreload counter driven by a programmable
prescaled clock and operating in one shoot or free running operating mode. The timer is
used to provide the IC time base system clock, with an interrupt generation on timer
overflow events.
Basic timers
The IC device includes two independent 6-bit timers programmable through the
miscellaneous indirect register area. The time base frequency is configurable with different
source clocks.
The timers have the following functionalities:
Free running mode
Timer prescaler 8-bits
Counter register 6-bits
Programmable time base clock (HSI, HSE, LSI, PLL)
Interrupt timer capability:
– Vectored interrupt
– Interrupt IRQ/NMI or polling mode
Auxiliary timer
The auxiliary timer is a light timer with elementary functionality. The time base frequency is
provided by the CCO clock logic (configurable with a different source clock and prescale
division factors), while the interrupt functionality is supplied by an interrupt edge detection
logic similarly to the solution adopted for the Port P0/P2.
The timer has the following main features:
Free running mode
Up counter
Timer prescaler 8-bit
Interrupt timer capability:
– Vectored interrupt
– Interrupt IRQ/NMI or Polling mode
Timer pulse configurable as a clock output signal via the CCO primary pin
Thanks to the great configurability of the CCO frequency, the timer can cover a wide range
of interval time to fit better the target application requirements.
Auto-wakeup timer
The AWU timer is used to cyclically wake-up the IC device from the active halt state. The
AWU frequency time base fAWU can be selected between the following clock sources: LSI
(153.6 kHz) and the external clock HSE scaled down to 128 kHz clock.
By default the fAWU clock is provided by the LSI internal source clock.
Watchdog timers
The watchdog system is based on two independent timers providing a high level of
robustness to the applications. The watchdog timer activity is controlled by the application
program or by suitable option bytes. Once the watchdog is activated, it cannot be disabled
by the user program without going through reset.
5.2.4 Architecture
The UBC memory area contains the reset and interrupt vectors and its size can be adjusted
in increments of 512 bytes by programming the UBC and nUBC option bytes.
Note: If users choose to update the boot code in the application programming (IAP), this has to be
protected so to prevent unwanted modification.
Status flags:
– Transmitter/receiver mode flag
– End-of-byte transmission flag
– I2C busy flag
Error flags:
– Arbitration lost condition for master mode
– Acknowledgment failure after address/ data transmission
– Detection of misplaced start or stop condition
– Overrun/underrun if clock stretching is disabled
Interrupt sources:
– Communication interrupt
– Error condition interrupt
– Wakeup from Halt interrupt
Wakeup capability:
– MCU wakes up from low power mode on address detection in slave mode.
6.1 Pinout
Figure 6. STNRG388A - TSSOP38 pinout
Output crystal
GPIO0 [2]/I2C_sda/ General purpose UART data
20 I/O I2C data oscillator
HseOscout/Uart_TX I/O 02 transmit
signal
Input crystal
GPIO0[3]/I2C_scl/ General purpose oscillator UART data
21 I/O I2C clock
HseOscin/Uart_RX I/O 03 signal /input receive
clock signal
Negative
GPIO0[0]/Uart_TX/ General purpose UART data analog
22 I/O I2C data
I2C_sda/CPM0 I/O 00 transmit comparator
input 0
Negative
GPIO0[1]/Uart_RX/ General purpose UART data analog
23 I/O I2C clock
I2C_scl/CPM1 I/O 01 receive comparator
input 1
Positive analog
24 I CPP [3] comparator input - - -
3
Positive analog
25 I CPP [2] comparator input - - -
2
Negative analog
26 I CPM32 comparator input - - -
3, 2
Negative analog
- I CPM3 comparator input - - -
3
Positive analog
comparator input
2 - Negative
- I CPP2_CPM3 - - -
analog
comparator input
3
Positive analog
27 I CPP [1] comparator input - - -
1
Positive analog
28 I CPP [0] comparator input - - -
0
Analog power
29 PS VDDA - - -
supply
30 PS VSSA Analog ground - - -
Several I/Os have multiple functionalities selectable through the configuration mechanism
described from Section 7.1 to Section 7.5 on page 41. The STNRG I/Os are grouped into
four different configurable ports: P0, P1, P2 and P3.
The warm configuration is volatile, thus not maintained after a device reset.
Table 6 summarizes the Port P0 configuration scheme. Both registers MSC_IOMXP0 and
AFR_IOMXP0 use the same register fields Sel_p054, Sel_p032 and Sel_p010 which
respectively control the bits [5, 4], [3, 2] and [1, 0] of the Port P0.
MUX SEL
Port pins Multifunction signal
Selection fields Value (binary)
simultaneously on the same port bits. The SMED trace configuration is forbidden on the Port
P [2:0] when the external comparator reference voltage is programmed on the Port P0 [1, 0].
Port 0 I/O signal availability depends on the STNRG device.
0651 65
1 @0%3
1
"' T
PVU
"'065
.4$@*0.91
"'3@*0.91
".
1. Where “A/F(s) in” and “A/F(s) out” signals are defined in Section 5.2 on page 28.
Verify pinout availability in device pin table X?
The P0 [6] is a multifunction signal configurable through the MSC_IOMXP2 [7] and AFR_IOMXP2 [7]
register bits. For further details refer to Section-6.4.
The Port P0 [6] signal is controlled by P0_ODR [6] and P0_IDR [6] GPIO0 registers.
MUX selection
Output signal Multi- function signal
Selection bits Value (binary)
PWM [0] 1
P1 [0] Sel_p10
GPIO1 [0] 0
PWM [1] 1
P1 [1] Sel_p11
GPIO1 [1] 0
PWM [2] 1
P1 [2] Sel_p12
GPIO1 [2] 0
PWM [3] 1
P1 [3] Sel_p13
GPIO1 [3] 0
PWM [4] 1
P1 [4] Sel_p14
GPIO1 [4] 0
PWM [5] 1
P1 [5] Sel_p15
GPIO1 [5] 0
1. The Sel_p15…Sel_p10 are common register fields of both registers MSC_IOMXP1 and AFR_IOMXP1.
In cold configuration the P1x are configured as defined by the AFR_IOMXP1 option byte.
The PWM default polarity level is configured by the register option byte GENCFG.
Verify pin out availability in Table 4: Pin description on page 32.
1@*%3 */165
1@0%3 065165
1
18.PVU
18.
.4$@*0.91
"'3@*0.91
".
1. The P1 [5:0] output signals may be read back from the P1_IDR register only when the pins are configured
as GPIO out or PWM signals.
The PWM internal signal is read- back also by its own SMED through the SMD<n>_FSM_STS register.
P1_ODR [7:6] and P1_IDR [7:6] registers control the GPIO1 [7:6] alternate function signals, for further
details refer toSection 7.4.
Check device feature availability.
(when available) is controlled by the Sel_SWIM bit field provided by registers AFR_IOMXP2
[7] and MSC_IOMXP2 [7].
MUX SEL
Output signal Multi-function signal
Selection bits Value (binary)
The interrupt functionality is available on the port P2 [5:4] also in case these signals are
configured as GPIO1 [7:6].
The interrupt request may be configured to wake-up the IC device from the WFI (wait for
interrupt), AHalt (active Halt) and Halt power saving state.
7 6 5 4 3 2 1 0
RFU Sel_P054 [1:0] Sel_P032 [1:0] Sel_P010 [1:0]
r r/w r/w r/w
The Port0 I/O multifunction signal configurations register (for functionality description refer
to Section 7.2 on page 35).
Check device feature availability.
Bit 1 - 0:
Sel_P010 [1:0] Port0 [1:0] I/O multiplexing scheme:
00: Port0 [1:0] the bit port may be configured individually as GPIO [1:0] or as CPM [1:0]
(comparator [1:0] external reference voltage):
GPIO0 [1:0] signals are controlled by the GPIO0 internal registers.
CPM [1, 0]: comparator external reference voltage requires that following
configurations:
GPIO0 [x] configured as input Hiz (where x = 1,0)
DAC<x>_EN = '0' and CP<x>_EN_ERef = '1 of MSC_DACCTR available only
on the STNRG388A register.
01: Port0 [1:0] are interconnected to UART_rx and UART_tx signals
10: Port0 [1:0] are interconnected to I2C_scl and I2C_sda signals
11: RFU
Bit 3 - 2:
Sel_P032 [1:0] Port0 [3:2] I/O multiplexing scheme:
00: Port0 [3:2] are interconnected to GPIO0 [3:2] signals
01: Port0 [3:2] are interconnected to I2C_scl and I2C_sda signals
10: Port0 [3:2] are interconnected to HseOscin and HseOscout analog signals
11: Port0 [3:2] are interconnected to UART_rx and UART_tx signals
Bit 5 - 4:
Sel_P054 [1:0] Port0 [5:4] I/O multiplexing scheme:
00: Port0 [5:4] are interconnected to GPIO0 [5:4] signals
01: Port0 [5:4] are interconnected to DALI_rx and DALI_tx signals
10: Port0 [5:4] are interconnected to I2C_scl and I2C_sda signals
11: Port0 [5:4] are interconnected to UART_rx and UART_tx signals
Bit 7 - 6:
RFU reserved; in order to guarantee future compatibility, the bits are kept or set to 0
during register write operations.
7 6 5 4 3 2 1 0
RFU Sel_P15 Sel_P14 Sel_P13 Sel_P12 Sel_P11 Sel_P10
r r/w
The Port1 I/O multifunction signal configuration register (for functionality description refer to
Section 7.3 on page 38).
Check device feature availability.
Bit 0:
Sel_P10 Port1 [0] I/O multiplexing scheme:
0: Port1 [0] is interconnected to GPIO1 [0] signal
1: Port1 [0] is interconnected to PWM [0] signal
Bit 1:
Sel_P11 Port1 [1] I/O multiplexing scheme:
0: Port1 [1] is interconnected to GPIO1 [1] signal
1: Port1 [1] is interconnected to PWM [1] signal
Bit 2:
Sel_P12 Port1 [2] I/O multiplexing scheme:
0: Port1 [2] is interconnected to GPIO1 [2] signal
1: Port1 [2] is interconnected to PWM [2] signal
Bit 3:
Sel_P13 Port1 [3] I/O multiplexing scheme:
0: Port1 [3] is interconnected to GPIO1 [3] signal
1: Port1 [3] is interconnected to PWM [3] signal
Bit 4:
Sel_P14 Port1 [4] I/O multiplexing scheme:
0: Port1 [4] is interconnected to GPIO1 [4] signal
1: Port1 [4] is interconnected to PWM [4] signal
Bit 5:
Sel_P15 Port1 [5] I/O multiplexing scheme:
0: Port1 [5] is interconnected to GPIO1 [5] signal
1: Port1 [5] is interconnected to PWM [5] signal
Bit 7 - 6:
RFU reserved; in order to guarantee future compatibility, the bits are kept or set to 0
during register write operations.
7 6 5 4 3 2 1 0
Sel_SWIM RFU Sel_P25 Sel_P24 Sel_P23 RFU Sel_P21 RFU
r/w r r/w r/w r/w r r/w r
The Port1 I/O multifunction signal configurations register (for functionality description refer
to Section 7.4 on page 39).
Check device feature availability.
Bit 0:
RFU reserved; must be kept 0 during register writing for future compatibility
Bit 1:
Sel_P21 Port2 [1] I/O multiplexing scheme:
0: Port2 [1] is interconnected to GPIO1 [6].
1: Port2 [1] is interconnected to DIGIN [1] signals.
Bit 2:
RFU reserved; must be kept 0 during register writing for future compatibility
Bit 3:
Sel_P23 Port2 [3] I/O multiplexing scheme:
0: Port2 [3] is interconnected to GPIO0 [7].
1: Port2 [3] is interconnected to DIGIN [3] signals.
Bit 5-4:
00: Port2 [5:4] are interconnected to GPIO1 [7:6] signals.
01: Selects the following signal assignment:
Port2 [5] is interconnected to the GPIO1 [7] signal.
Port2 [4] is interconnected to the DIGIN [4] signal.
10: Port2 [5:4] are interconnected to I2C_Scl and I2C_Sda signals.
11: Port2 [5:4] are interconnected to DIGIN [5:4] signals.
Note: The AFR_IOMXP2 [4] register field is capable only to configure the coding value 00 and 01:
00: Port2 [5:4] are interconnected to GPIO1 [7:6] signals.
01: Following signal assignment selection:
Port2 [5] is interconnected to the GPIO1 [7] signal.
Port2 [4] is interconnected to the DIGIN [4] signal.
Bit 6:
RFU reserved; in order to guarantee future compatibility, the bits are kept or set to 0
during register write operations.
Bit 7:
Sel_SWIM SWIM alternate function signal enable; this feature is active when the SWD
field of the register CFG_GCR is set.
0: SWIM pin is configured with the GPIO0 [6] signal.
1: SWIM functionality is preserved.
7 6 5 4 3 2 1 0
ADCTRG_EN RFU INPP2_PULCTR [5:0]
r/w r r/w
Note: Due to DIGINs interconnections, the pull-up functionality must be configured in the same
way if the two pins are connected together:
DIGIN10 is controlled by the register field INPP2_PULCTR [1:0]
DIGIN32 is controlled by the register field INPP2_PULCTR [3:2]
DIGIN54 is controlled by the register field INPP2_PULCTR [5:4].
When the DIGIN1 signal is selected on the SWIM pin the pull-up is always enabled.
00.0000h
6 kB RAM [data and stack area(1)]
00.17FFh
00.1800h
Reserved
00.3FFFh
00.4000h
1 kB data E2PROM
00.43FFh
00.4400h
Reserved
00.47FFh
00.4800h
128 option bytes
00.487Fh
00.4880h
Reserved
00.4FFFh
00.5000h
Peripheral register region
00.57FFh
00.5800h
Reserved
00.5FFFh
00.6000h
2 kB boot ROM
00.67FFh
00.6800h
Reserved
00.7EFFh
00.7F00h
Core register region
00.7FFFh
00.8000h 32 interrupt vectors
00.8080h
32 kB program Flash
00.FFFFh
01.0000h
Reserved
FF.FFFFh
1. By default, the stack address is initialized at 0x07FF and rolls over when it reaches the address value of
0x0400. The stack address value may be modified by the user at runtime.
0x00.7F00 A Accumulator
0x00.7F01 PCE Program counter extended
0x00.7F02 PCH Program counter high
0x00.7F03 PCL Program counter low
0x00.7F04 XH X - index high
0x00.7F05 CPU XL X - index low
0x00.7F06 YH Y - index high
0x00.7F07 YL Y - index low
0x00.7F08 SPH Stack pointer high
0x00.7F09 SPL Stack pointer low
0x00.7F0A CC Code condition
9 Interrupt table
10 Option bytes
The user option byte is a memory E²PROM area allowing users to customize the IC device
major functionalities:
ROP: read-out protection control field
UBC: user boot code protection
PWM: configurable reset output value
WDG: internal watchdog HW configuration
AFR: alternate multifunction signals configuration
CKC: clock controller functionalities (PLL, HSE enable, AWU clock selection, etc.)
HSE: clock stabilization counter
WAIT: Flash and E²PROM wait state access time has to be configured with value 0x00
BOOT: configurable internal boot sources
BL: bootloader control sequences
Except the ROP byte all the other option bytes are stored twice in a regular (OPT) and
complemented format (NOPT) for redundancy. The option byte can be programmed in ICP
mode through the SWIM interface or in IAP mode by the application with the exception of
the ROP byte that can be only configured via the SWIM interface.
For further information about Flash programming refer to the programming manual “How to
program STM8S and STM8A Flash program memory and data EEPROM” (PM0051).
For information on SWIM programming procedures refer to the “STM8 SWIM
communication protocol and debug module” user manual (UM0470).
Option bytes
Table 39. Option byte register overview - STNRG388A
Option bits
Add- Default
Option name
ress settings
7 6 5 4 3 2 1 0
STNRGxxxA
4813h AFR_IOMXP2 Sel_SWIM ADC_HWtrg 1 Sel_P24 Sel_P23 - Sel_P21 - 7Ah
4814h nAFR_IOMXP2 nSel_SWIM nADC_HWtrg 0 nSel_P24 nSel_P23 - nSel_P21 - 85h
Table 39. Option byte register overview - STNRG388A (continued)
65/122
Option bytes
Option bits
Add- Default
Option name
ress settings
7 6 5 4 3 2 1 0
Note: The default setting values refer to the factory configuration. The factory configuration can be overwritten by the user in accordance
with the target application requirements.
DocID027799 Rev 3
The factory configuration values are loosed after user programming fields or in case of the ROP unprotecting attempt causing
a “Global Flash Erase”.
The predefined initialized bit-values (1 or 0) must be preserved during memory writing.
An undefined option bit must be keep 0 and the complement value at 1 during the memory writing sequence.
STNRGxxxA
Option bytes STNRGxxxA
7 6 5 4 3 2 1 0
ROP [7:0]
r/w
Bit 7 - 0:
ROP [7:0] memory read-out protection:
0xAA: enable read-out protection. When read-out protection is enabled, reading or
modifying the Flash program memory and DATA area in ICP mode (using the SWIM
interface) is forbidden, whatever the write protection settings are.
7 6 5 4 3 2 1 0
UBC [7:0]
r/w
Bit 7 - 0:
UBC [7:0] user boot code write protection memory size: 0x00: no UBC, no Flash
memory write-protection
0x01: pages 0 to 1 defined as UBC; 1 Kbyte memory write-protected (0x00.8000-
0x00.83FF)
0x02: pages 0 to 3 defined as UBC; 2 Kbyte memory write-protected (0x00.8000-
0x00.87FF)
0x03: pages 0 to 4 defined as UBC; 2.5 Kbyte memory write-protected (0x00.8000-
0x00.89FF)
... (512 byte every page)
0x3E: pages 0 to 63 defined as UBC; 32 Kbyte memory write-protected (0x00.8000-
0x00.FFFF)
Other values: reserved.
7 6 5 4 3 2 1 0
nUBC [7:0]
r/w
7 6 5 4 3 2 1 0
Rst_PWM [5:0] RFU EN_COLD_CFG
r/w r r/w
Bit 0:
The EN_COLD_CFG enables IC cold configuration through the option byte register
AFR_IOMXP0, P1 and P2:
0: default case, the IC multifunction signal configuration is performed by the
miscellaneous registers MSC_IOMXP0, MSC_IOMXP1 and MSC_IOMXP2 (warm
configuration).
1: enables the multifunction signal configuration through the option byte registers
AFR_IOMXP0, AFR_IOMXP1 and AFR_IOMXP2 (cold configuration).
Bit 1:
RFU reserved; must be kept 0 during register writing for future compatibility
Bit 7:2:
Rst_PWM [5:0] configures the PWM [n] reset value after the NRST signal
0: PWM [n] output low level (native default value)
1: PWM [n] output high level.
Note: The PWM signal programmed reset value is configured during the option byte loader phase,
then before the NRST is released it assumes its proper initial values.
7 6 5 4 3 2 1 0
nRst_PWM [5:0] nRFU nEN_COLD_CFG
r/w r r/w
7 6 5 4 3 2 1 0
RFU RFU RFU LSI_EN lWdg_hw WWdg_hw WWdg_HALT
r r r r/w r/w r/w r/w
Bit 0:
WWdg_HALT window watchdog reset on Halt:
0: no reset generated on Halt if WWDG is active
1: reset generated on Halt if WWDG is active.
Bit 1:
WWdg_hw window watchdog hardware enable:
0: window watchdog activation by SW
1: window watchdog activation by HW.
Bit 2:
IWdg_hw independent watchdog hardware enable:
0: independent watchdog activation by SW
1: independent watchdog activation by HW.
Bit 3:
LSI_EN low speed internal RCOSC clock enable:
0: LSI clock is not available to CPU
1: LSI cock is enabled for CPU.
Bit 4:
RFU reserved; must be kept 0 during register writing for future compatibility.
Bit 5:
RFU reserved; must be kept 1 during register writing for future compatibility.
Bit 7 - 6:
RFU reserved; must be kept 0 during register writing for future compatibility.
7 6 5 4 3 2 1 0
nRFU nRFU nRFU nLSI_EN nlWdg_hw nWWdg_hw nWWdg_HALT
r r r r/w r/w r/w r/w
7 6 5 4 3 2 1 0
PWM_OD RFU SMD_HWtrg CKAWUSEL1 EXTCLK CKAWUSEL0 PRSC [1:0]
r/w r r/w r/w r/w r/w r/w
Bit 1 - 0:
PRSC [1:0] prescaler value for HSE to provide AWU unit with the low speed clock:
00: 24 MHz to 128 kHz prescaler
01: 16 MHz to 128 kHz prescaler
10: 8 MHz to 128 kHz prescaler
11: 4 MHz to 128 kHz prescaler.
Bit 3:
EXTCLK external clock selection:
0: external crystal oscillator clock connected to HseOscin and HseOscout signals
1: external direct drive clock connected to HseOscin.
Bit 4, 2:
CKAWUSEL [1:0] AWU clock selection:
00: low speed internal clock used for AWU module
01: HSE high speed external clock with prescaler used for AWU module
10: reserved encoding value
11: reserved encoding value.
Bit 5:
SMD_HWtrg enable SMED ADC HW trigger functionality:
0: disable SMED ADC HW trigger request
1: enable SMED ADC HW trigger request; this functionality requires that all SMEDs
must be configured with fSMED fMASTER and the ADC_HWtrg option bit of the
AFR_IOMXP2 register programmed at '0'.
Bit 6:
RFU reserved; must be kept 0 during register writing for future compatibility.
Bit 7:
PWM_OD PWM output pseudo- open drain features:
0: enable PWM output signal open drain. This functionality is configurable by GPIO1
internal registers.
1: disable PWM output signal open drain functionality.
7 6 5 4 3 2 1 0
nPWM_OD nRFU nSMD_HWtrg nCKAWUSEL1 nEXTCLK nCKAWUSEL0 nPRSC [1:0]
r/w r r/w r/w r/w r/w r/w
7 6 5 4 3 2 1 0
HSECNT [7:0]
r/w
Bit 7 - 0:
HSECNT [7:0] HSE crystal oscillator stabilization cycles:
0x00: 2048 clock cycles
0xB4: 128 clock cycles
0xD2: 8 clock cycles
0xE1: 0.5 clock cycles.
7 6 5 4 3 2 1 0
nHSECNT [7:0]
r/w
7 6 5 4 3 2 1 0
RFU BscTim1 ADC_MFlush BscTim0 RFU
r r/w r/w r/w r
Bit 0 - 3:
RFU reserved; must be kept 0 during register writing for future compatibility.
Bit 4:
BscTim0 enable basic Timer0:
0: enable basic Timer0
1: disable basic Timer0.
Bit 5:
ADC_MFlush enable ADC mode flush:
0: enable ADC mode flush
1: disable ADC mode flush.
Bit 6:
BscTim1 enable basic Timer1:
0:enable basic Timer0
1: disable basic Timer0.
Bit 7:
RFU reserved; must be kept 0 during register writing for future compatibility.
7 6 5 4 3 2 1 0
nRFU nBscTim1 nADC_MFlush nBscTim0 nRFU
r r/w r/w r/w r
7 6 5 4 3 2 1 0
RFU ADC_NAbt RFU ADC_AFlush RFU ADC_ARlod WaitStat[1:0]
r r/w r r/w r r/w r/w
Bit 1 - 0:
WaitStat [1:0] configures the E²PROM and Flash programmable delay read access
time:
00: 0 no delay cycle (default case fMASTER at 16 MHz)
01: 1 delay cycles
10: 2 delay cycles
11: 3 delay cycles.
Bit 2:
ADC_ARlodenable ADC auto-reload conversion command:
0: enable ADC auto-reload conversion command
1: disable ADC auto-reload conversion command
Bit 3:
RFU reserved; must be kept 0 during register writing for future compatibility.
Bit 4:
ADC_AFlush enable ADC auto-flush:
0: enable ADC auto-flush command
1: disable ADC auto-flush command
Bit 5:
RFU reserved; must be kept 0 during register writing for future compatibility.
Bit 6:
ADC_NAbt enable ADC new abort mode:
0: enable ADC new abort/flush mode
1: disable ADC new abort/flush mode (ADC abort/flush sequence compliant with the
STLUXxxxA family).
Bit 7:
RFU reserved; must be kept 0 during register writing for future compatibility.
7 6 5 4 3 2 1 0
nRFU nADC_NAbt nRFU nADC_AFlush nRFU nADC_ARlod nWaitStat [1:0]
r r/w r r/w r r/w r/w
7 6 5 4 3 2 1 0
RFU Sel_P054 [1:0] Sel_P032 [1:0] Sel_P010 [1:0] (1)
r r/w r/w r/w
1. Available only on the STNRG388A, otherwise keep 0.
Bit 5 - 0:
Refer to MSC_IOMXP0 miscellaneous register field description in Section 7.6 on page 42.
Bit 7 - 6:
RFU reserved; must be kept 0 during register writing for future compatibility.
7 6 5 4 3 2 1 0
nRFU nSel_P054 [1:0] nSel_P032 [1:0] nSel_P010 [1:0]
r r/w r/w r/w
7 6 5 4 3 2 1 0
AUXTIM RFU Sel_p15 Sel_p14 Sel_p13 Sel_p12 Sel_p11 Sel_p10
r/w r r/w r/w r/w r/w r/w r/w
Bit 5 - 0:
Refer to MSC_IOMXP1 miscellaneous register field description in Section 7.6 on page
42.
Bit 6:
RFU reserved; must be kept 0 during register writing for future product compatibility.
Bit 7:
AUXTIM CCO aux timer compatibility features
0: CCOaux timer enabled
1: CCOaux timer disabled.
7 6 5 4 3 2 1 0
nAUXTIM nRFU nSel_p15 nSel_p14 nSel_p13 nSel_p12 nSel_p11 nSel_p10
r/w r r/w r/w r/w r/w r/w r/w
7 6 5 4 3 2 1 0
SEL_SWIM ADC_HWtrg RFU Sel_P24 Sel_P23 RFU Sel_P21 RFU
r/w r/w r r/w r/w r r/w r
Bit 0:
RFU reserved; must be kept 0 during register writing for future product compatibility.
Bit 1:
Sel_P21; refer to MSC_IOMXP2 miscellaneous register field description in Section 7.6
on page 42.
Bit 2:
RFU reserved; must be kept 0 during register writing for future product compatibility.
Bit 3:
Sel_P23; refer to MSC_IOMXP2 miscellaneous register field description in Section 7.6.
Bit 4:
Sel_P24; refer to MSC_IOMXP2 miscellaneous register field description in Section 7.6.
Bit 5:
RFU1 reserved; must be kept 1 during register writing for future products compatibility.
Bit 6:
ADC_HWtrg: enable ADC HW trigger functionality.
0: enable ADC HW trigger.
1: disable ADC HW trigger.
Bit 7:
Sel_SWIM; refer to MSC_IOMXP2 miscellaneous register field description in
Section 7.4 on page 39.
7 6 5 4 3 2 1 0
nSEL_SWIM nADC_HWtrg nRFU nSel_P24 nSel_P23 nRFU nSel_P21 nRFU
r/w r/w r r/w r/w r r/w r
7 6 5 4 3 2 1 0
RFU UARTline [1:0] RFU BootSel [1:0]
r r/w r r/w
Bit 1 - 0:
BootSel [1:0] boot-ROM peripheral enables:
00: automatic scan boot sources; this selection enables the automatic scan
configuration sequence of all possible initializing peripheral devices: Periph0 (UART),
Periph1 (RFU).
01: enable boot source: Periph0
10: enable boot source: Periph1
11: enable boot sources: Periph1, Periph0
Bit 2 - 3:
RFU reserved; must be kept 0 during register writing for future compatibility.
Bit 5 - 4:
UARTline [1:0] selects the UART port configuration pins involved during the bootload
sequence in warm configuration mode; in case of cold configuration, this field is
ignored since the UART port is selected by the register AFR_IOXP0.
00: boot sequence with UART i/f configured in all possible UART multiplexed signal
schemes. This sequence is used when the UART i/f position is not specified.
01: boot sequence with UART i/f configured on P0 (1, 0) available only on the
STNRG388A.
10: boot sequence with UART i/f configured on P0 (3, 2)
11: boot sequence with UART i/f configured on P0 (5, 4).
Bit 7 - 6:
RFU reserved; must be kept 0 during register writing for future compatibility.
7 6 5 4 3 2 1 0
nRFU nUARTline [1:0] nRFU nBootSel [1:0]
r r/w r r/w
7 6 5 4 3 2 1 0
BL [7:0]
r/w
Bit 7 - 0:
BL [7:0] bootloader field checked by the internal BootROM code during the STNRG
initialization phase. The content of register locations 0x00487E, 0x00487F and
0x008000 determine the bootloader SW flow execution sequence.
7 6 5 4 3 2 1 0
nBL [7:0]
r/w
11 Device identification
11.1 Unique ID
The STNRG family provides a 56-bit unique identifier code usable as a device identification
number which can be used to increase the device security. The unique ID code is a frozen
signature not alterable by the user.
The unique device identifier is ideally used by the application software and is suited for:
Serial code
Security keys in conjunction with cryptographic software to increase the embedded
Flash code security
Activating the secure boot sequence.
11.2 Device ID
The STNRG device identification model is coded in the following register area and it cannot
be altered by the user.
The RFU and nRFU values are reserved and the value may be changed within devices.
Note: Mask the DVD1 and nDVD1 register with 0x1F when read the Rev_ID [4:0] field.
12 Electrical characteristics
VDD
VDDA
VSS
VSSA
c. ESR is the equivalent series resistance and ESL is the equivalent inductance.
Equation 1
IDD = IDD(Run2) + IDD(ADC2) + IDD(ACU) + IDD(PLL) + IDD(PWM)
where IDD(PWM) = IDD(PWM1) x NPWM
More generally, the PWM current consumption is given for each fSMED clock grouping, by
Equation 2:
Equation 2
NfSMED
I DD PWM = i = 1 XXXX I DD PWM i1 N i
where i = fSMED clock group index; Ni = PWM number of the i_th clock group;
NfSMED = fSMED clock group number.
PLL fSMED(2) fPWM(3) fADC(4) ADC(5) PWM(6), (7) ACU(8) Typ.(9) Max.(9)
Op. mode
Enb/dis MHz MHz MHz Enb/dis Num. Enb/dis mA mA
IDD(PLL) Enab 0 0 0 Disab 0 Disab 2.32 2.78
IDD(ACU) Disab 0 0 0 Disab 0 Enab 2.22 2.66
IDD(PWM1PLL96) 1 1.81 2.17
IDD(PWM4PLL96) 4 6.98 8.69
Enab 96 0.5 0 Disab Disab
IDD(PWM5PLL96) 5 9.0 10.8
IDD(PWM6PLL96) 6 10.49 12.52
IDD(PWM1PLL48) 1 1.18 1.42
IDD(PWM4PLL48) 4 4.58 5.65
Enab 48 0.5 0 Disab Disab
IDD(PWM5PLL48) 5 5.9 7.5
IDD(PWM6PLL48) 6 6.88 8.26
IDD(PWM1PLL24) 1 0.8 0.95
IDD(PWM4PLL24) 4 3.16 3.88
Enab 24 0.5 0 Disab Disab
IDD(PWM5PLL24) 5 4.2 5.2
IDD(PWM6PLL24) 6 4.73 5.68
IDD(PWM1PLL12) 1 0.6 0.7
IDD(PWM4PLL12) 4 2.46 3.01
Enab 12 0.5 0 Disab Disab
IDD(PWM5PLL12) 5 3.3 4.2
IDD(PWM6PLL12) 6 3.66 4.4
IDD(PWM1PLL6) 1 0.5 0.6
IDD(PWM4PLL6) 4 2.11 2.58
Enab 6 0.5 0 Disab Disab
IDD(PWM5PLL6) 5 2.9 3.6
IDD(PWM6PLL6) 6 3.11 3.75
IDD(PWM1HSI16) 1 0.6 0.7
IDD(PWM4HSI16) 4 2.04 2.49
Enab 16 0.5 0 Disab Disab
IDD(PWM5HSI16) 5 2.8 3.4
IDD(PWM6HSI16) 6 3.13 3.78
PLL fSMED(2) fPWM(3) fADC(4) ADC(5) PWM(6), (7) ACU(8) Typ.(9) Max.(9)
Op. mode
Enb/dis MHz MHz MHz Enb/dis Num. Enb/dis mA mA
IDD(PWM1HSI8) 1 0.5 0.6
IDD(PWM4HSI8) 4 1.64 2
Enab 8 0.5 0 Disab Disab
IDD(PWM5HSI8) 5 2.3 2.9
IDD(PWM6HSI8) 6 2.56 3.1
IDD(PWM1HSI4) 1 0.47 0.55
IDD(PWM4HSI4) 4 1.48 1.81
Enab 4 0.5 0 Disab Disab
IDD(PWM5HSI4) 5 2.2 2.7
IDD(PWM6HSI4) 6 2.33 2.78
IDD(PWM1HSI2) 1 0.4 0.54
IDD(PWM4HSI2) 4 1.31 1.6
Enab 2 0.5 0 Disab Disab
IDD(PWM5HSI2) 5 1.9 2.3
IDD(PWM6HSI2) 6 2.1 2.49
IDD(ADC1) Disab 0 0 1 Enab 0 Disab 2.11 2.54
IDD(ADC2) Disab 0 0 5.3 Enab 0 Disab 2.16 2.6
IDD(ADC3) Enab 0 0 6 Enab 0 Disab 2.17 2.61
1. Data based on characterization results not tested in production.|
2. SMED frequency:
- 96 MHz and 6 MHz frequencies require the PLL enabled.
- Current table shows only a subset value of possible SMED frequencies.
3. PWM frequency:
- PWM toggle frequency is considered fixed to 500 kHz, close to the maximum applicative value.
4. ADC frequency:
- 6 MHz frequency requires the PLL enabled.
- Current table shows only a subset value of possible ADC frequencies.
5. ADC configured in circular mode.
6. Number of active PWMs.
7. PWM pins are loaded with a CL (load capacitance) of 50 pF.
8. If enabled all DACs and comparator units are active.
9. Temperature operating: TA = 25 °C.
Figure 13. PWM current consumption with fSMED = PLL fPWM = 0.5 MHz
at VDD/VDDA = 3.3 V
Figure 14. PWM current consumption with fSMED = PLL fPWM = 0.5 MHz
at VDD/VDDA = 5 V
Figure 15. PWM current consumption with fSMED = HSI fPWM = 0.5 MHz
at VDD/VDDA = 3.3 V
Figure 16. PWM current consumption with fSMED = HSI fPWM = 0.5 MHz
at VDD/VDDA = 5 V
Equation 3
gm» gmCritic
where gmCritic is calculated with the crystal parameters as follows:
Equation 4
gmCritic = (2 x x fHSE)2 x Rm (2CO + C)2
and where:
Rm: motional resistance(d)
Lm: motional inductance(d)
Cm: motional capacitance(d)
CO: shunt capacitance(d)
CL1 = CL2 = C: grounded external capacitance
LSI RC oscillator
Subject to general operating conditions for VDD and TA.
3.3 V VDD 5 V
fIN Input frequency(2) 16
-40 ºC TA 105 ºC MHz
fOUT Output frequency 96
tlock PLL lock time 200 μs
1. Data based on characterization results, not tested in production.
2. PLL maximum input frequency 16 MHz.
IOL1 Standard output low level current at 3.3 V and VOL1(2), (3) 1.5
(2) (3)
IOL2 Standard output low level current at 5 V and VOL2 , 3
(2) (4) (5)
IOLhs1 High sink output low level current at 3.3 V and VOL3 , , 5
IOLhs2 High sink output low level current at 5 V and VOL3(2),(4), (5) 7.75
mA
(2) (3)
IOH1 Standard output high level current at 3.3 V and VOH1 , 1.5
IOH2 Standard output high level current at 5 V and VOLH2(2), (3) 3
(2) (4) (5)
IOHhs1 High sink output high level current at 3.3 V and VOH3 , , 5
IOHhs2 High sink output high level current at 5 V and VOH3(2), (4), (5) 7.75
ILKg Input leakage current digital - analog VSS VIN VDD(6) ±1 μA
I_Inj Injection current(7), (8) ±4
mA
I_Inj Total injection current (sum of all I/O and control pins)(7) ± 20
1. Data based on characterization result, not tested in production.
2. A high sink selectable by high speed configuration; the parameter applicable to signals: GPIO0 [5:0] (product depending).
3. The parameter applicable to signals: GPIO1 [5:0]/PWM [5:0] (product depending).
4. The parameter applicable to the signal: SWIM.
5. The parameter applicable to the signal: DIGIN [0]/CCO_clk.
6. Applicable to any digital inputs.
7. Maximum value must never be exceeded.
8. Negative injection current on the ADCIN [7:0] signals (product depending) have to avoid since impact the ADC conversion
accuracy.
Standard pad
This pad is associated to the following signals: DIGIN [5:1], SWIM and GPIO0 [5:0] when
available.
Fast pad
This pad is associated to the PWM [5:0] signals if the external pin is available.
N Resolution 10 bit
RADCIN ADC input impedance 1 M
(1)
fADC ADC Clock frequency 1 6 MHz
(2) (3)
VIN1 Conversion voltage range for gain x1 0 1.25 ,
VIN2 Conversion voltage range for gain x4(4) 0 0.3125(2), (3) V
Vref ADC main reference voltage(5) 1.250
tS Sampling time fADC = 6 MHz 0.50
tSTAB Wakeup time from ADC standby 30
μs
tCONV1 Single conversion time including sampling time fADC = 6 MHz 2.42
tCONV2 Continuous conversion time including sampling time fADC = 6 MHz 3
1. Frequency generated selecting the PLL source clock.
2. Maximum input analog voltage cannot exceed VDDA.
3. Exceeding the maximum voltage on the ADCIN [7:0] signals (product depending) for the related conversion scale must be
avoided since the ADC conversion accuracy can be impacted.
4. Product depending
5. ADC reference voltage at TA = 25 °C.
Note: The gain x1 ADC input analog voltage range is from 0 up to 1.25 V.
The gain x4 ADC input analog voltage range is from 0 up to 312.5 mV (check availability on
device).
Maximum input analog voltage cannot exceed VDDA.
ADC input impedance > 1 M.
The ADCIN [7:0] input pins are provided by the ESD protection diodes.
N Resolution 4 bit
Vfull scale DAC full scale 1.2 1.26 V
Voffset DAC offset 4 mV
-40 ºC TA 105 ºC
Vdac DAC out voltage Voffset Vfull scale mV
LSB 82 mV
INL Integral non linearity 0.12 LSB
1. Data based on characterization results, not tested in production.
Equation 5
V fullscale – V offset
n 0 15 vV
:
dac n = ---------------------------------------------------- n + V offset
15
Equation 6
V fullscale – V offset
n 1 14 vvV
:
dac n = ---------------------------------------------------- n + INL + V offset
15
where:
Vfullscale = Vfullscale(sample, T)
Voffset = Voffset (sample, T)
INL = INL (sample, n)
13 Thermal characteristics
The STNRG functionality cannot be guaranteed when the device operating exceeds the
maximum chip junction temperature (TJmax).
TJmax, in °C, may be calculated using Equation 7:
Equation 7
TJmax = TAmax + (PDmax x JA)
where:
TAmax is the maximum ambient temperature in °C
JA is the package junction to ambient thermal resistance in °C/W
PDmax is the sum of PINTmax and PI/Omax (PDmax = PINTmax + PI/Omax)
PINTmax is the product of IDD and VDD, expressed in watts. This is the maximum chip internal
power.
PI/Omax represents the maximum power dissipation on output pins where:
PI/Omax = (VOL x IOL) + [(VDD - VOH) x IOH],
taking into account the actual VOL/IOL and VOH/IOH of the I/Os at low and high level.
14 Package information
0117861_C
A 1.20
A1 0.05 0.15
A2 0.80 1.00 1.05
b 0.17 0.27
c 0.09 0.20
D(2) 9.60 9.70 9.80
E 6.20 6.40 6.60
(2)
E1 4.30 4.40 4.50
e 0.50
L 0.45 0.60 0.75
L1 1.00
k 0 8
aaa 0.10
1. “TSSOP stands for “Thin Shrink Small Outline Package”.
2. “Dimensions “D” and “E1”do not include mold flash or protrusions. Mold flash or protrusions shall not
exceed 0.15 mm per side.
The development tools for the STNRG microcontroller are provided by:
Raisonance with the C compiler and the integrated development environment (Ride7),
which provides start-to-finish control of application development including the code
editing, compilation, optimization and debugging.
The Ride7 supports the RLink in-circuit debugger/programmer using the SWIM
interface (USB/SWIM).
IAR Embedded Workbench® for STM8. The IAR Embedded Workbench IAR-EWSTM8
is a software development tool with the highly optimizing C and C++ compiler for the
STM8 CPU device.
The workbench supports the ST-LINK and STice debug probes using the SWIM
interface (USB/SWIM).
16 Order codes
STNRG388A Tube
TSSOP38
STNRG388ATR Tape and reel
17 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
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.