Pinout and pin description
STM8S003K3 STM8S003F3
Pin no.
Input
Output
High
Main
Alternate
function after
remap [option
bit]
Default
alternate
function
function
(after
Speed OD PP
Pin name
Type
Ext.
interr.
TSSOP20 UFQFPN20
floating wpu
sink
(1)
reset)
16
17
13
14
PC6/
SPI_MOSI
[TIM1_ CH1]
I/O
X
X
X
X
X
X
HS
HS
O3
O3
X
X
X
X
Port
C6
SPI master Timer 1 -
out/slave in channel 1
[AFR0]
PC7/
SPI_MISO
[TIM1_ CH2]
I/O
I/O
Port
C7
SPI master Timer 1 -
in/ slave
out
channel 2
[AFR0]
18
19
15
16
PD1/
SWIM
X
X
X
X
X
X
HS
HS
O4
O3
X
X
X
X
Port
D1
SWIM data
interface
(4)
PD2/AIN3/[TIM2_ I/O
CH3]
Port
D2
Analog
input 3
Timer 2 -
channel 3
[AFR1]
20
17
PD3/ AIN4/
TIM2_ CH2/
ADC_ ETR
I/O
X
X
X
HS
O3
X
X
Port
D3
Analog
input 4/
Timer 2 -
channel
2/ADC
external
trigger
(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)
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 to use PA1 only in input mode if halt/active-halt
is used in the application.
(3)
In the open-drain output column, "T" defines a true open-drain I/O (P-buffer, weak pull-up, and protection diode to V
not implemented).
are
DD
(4)
The PD1 pin is in input pull-up during the reset phase and after internal reset release.
5.3
Alternate function remapping
As shown in the rightmost column of the pin description table, some alternate functions can
be remapped at different I/O ports by programming one of eight AFR (alternate function
remap) option bits. When the remapping option is active, the default alternate function is no
longer available.
To use an alternate function, the corresponding peripheral must be enabled in the peripheral
registers.
Alternate function remapping does not effect GPIO capabilities of the I/O ports (see the GPIO
section of the family reference manual, RM0016).
24/99
DocID018576 Rev 2