Pinout and pin description
STM8S005K6 STM8S005C6
Pin number
LQFP48 LQFP32
Pin name Type Input
Output
Main function
(after reset)
floating wpu Ext.
High Speed OD PP
interrupt sink
Default alternate
function
Alternate
function after
remap [option
bit]
42
26
PD1/
I/O
X
SWIM(4)
XX
HS O4
X
X
Port D1
SWIM data interface
43
27
PD2/
I/O
X
TIM3_
CH1
[TIM2_
CH3]
XX
HS O3
X
X
Port D2
Timer 3 -
channel 1
TIM2_CH3
[AFR1]
44
28
PD3/
TIM2_
CH2
[ADC_
ETR]
I/O
X
XX
HS O3
X
X
Port D3
Timer 2 -
channel 2
ADC_ ETR
[AFR0]
45
29
PD4/
I/O
X
TIM2_
CH1
[BEEP]
XX
HS O3
X
X
Port D4
Timer 2 -
channel 1
BEEP output
[AFR7]
46
30
PD5/
I/O
X
UART2_
TX
XX
O1
X
X
Port D5
UART2 data transmit
47
31
PD6/
I/O
X
UART2_
RX
XX
O1
X
X
Port D6
UART2 data receive
48
32
PD7/ TLI I/O
X
[TIM1_
CH4]
XX
O1
X
X
Port D7
Top level interrupt
TIM1_ CH4
[AFR4]
(1) A pull-up is applied to PF4 during the reset phase. This pin is input floating after reset release.
(2)AIN12 is not selectable in ADC scan mode or with analog watchdog.
(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.1.1
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/103
DocID022186 Rev 3