Pinout and pin description
STM8S003K3 STM8S003F3
Pin no.
Pin name
TSSOP20 UFQFPN20
Input
Output
Type
floating
wpu
Ext.
interr.
High
sink
(1)
Speed OD
PP
Main
function
(after
reset)
Default
alternate
function
Alternate
function after
remap [option
bit]
16
13
PC6/
I/O X
X X HS
O3 X X Port SPI master Timer 1 -
SPI_MOSI
C6
out/slave in channel 1
[TIM1_ CH1]
[AFR0]
17
14
PC7/
I/O X
X X HS
O3 X X Port SPI master Timer 1 -
SPI_MISO
C7
in/ slave channel 2
[TIM1_ CH2]
out
[AFR0]
18
15
PD1/
I/O X
X X HS
O4 X X Port SWIM data
SWIM(4)
D1
interface
19
16
PD2/AIN3/[TIM2_ I/O X
X X HS O3 X X Port Analog
Timer 2 -
CH3]
D2
input 3
channel 3
[AFR1]
20
17
PD3/ AIN4/ I/O X
X X HS
O3 X X Port Analog
TIM2_ CH2/
D3
input 4/
ADC_ ETR
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 VDD are
not implemented).
(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/100
DocID018576 Rev 3