ST52T400/T440/E440/T441
6.4 Alternate Functions.
Port A and B pins in ST52x400/440/441 are con-
figurable to be used with different functions (Alter-
nate Functions) related to the use of peripherals.
To configure a pin in Alternate Function the related
configuration registers must be set according to
the values shown in Tables - Port A - REG_CONF
4, - Port A - REG_CONF 12 and Analog Inputs
REG_CONF 14.
For example: if pin PA5/TCLK has to be used as
an external PWM/Timer Clock, REG_CONF4[(5)]
bit must be set to ‘1’.
When the signal is an input of an on-chip
peripheral, the related I/O pin has to be config-
ured in Input Mode.
When a pin of Port B is used as an Analog Input,
the related I/O pin is automatically set in threes-
tate. The analog multiplexer (controlled by the
Analog Comparator Configuration Register)
switches the analog voltage present on the
selected pin to the common analog rail, which is
connected to the ADC input.
It is recommended that the voltage level or loading
on any port pin not be changed while conversion
is running. Furthermore, it is recommended not to
have clocking pins located close to a selected
analog pin.
Timer/PWM Alternate Functions
Pins of Port A can be configured to be I/Os of the
on-chip TIMER/PWM of ST52x400/440/441. The
configuration of these pins is performed by using
Configuration Registers REG_CONF4 and
REG_CONF12 (Tables - Port A - REG_CONF 4
and - Port A - REG_CONF 12).
If a pin has to be a TIMER Input (TSTRT, TCLK,
TRES) the related bit of REG_CONF4 must be set
to “1” and of REG_CONF12 must be set to “1”.
If, instead it must be a TIMER Output (TOUT,
TOUTN), REG_CONF12 related bit must be set to
“0” and the related bit of REG_CONF4 be set to
“0”.
TRIAC Driver Alternate Function
When using the on-chip TRIAC, to have the
TRIAC Output on pin PA0, bit REG_CONF12[0]
must be set to “0” and REG_CONF4[0] to “0”.
When a synchronization with the Mains voltage is
necessary, in case either the Phase Angle Partial-
ization or the Burst Modes is chosen, to have
MAIN1 and MAIN2 as Inputs on PortA, it is neces-
sary to set bits 1 and 2 of REG_CONF4 to “1”.
Table 6.4 - Port A - REG_CONF 4
6.5 I/O Port Configuration Registers
The I/O mode for each bit of the three ports are
selected by using Configuration Registers 4, 12,
13 and 11 (Table 6.1). The structure of these reg-
isters is illustrated in tables - Port A - REG_CONF
4, - Port A - REG_CONF 12, - Port B -
REG_CONF 13, Analog Inputs REG_CONF 14
and - Port C - REG_CONF 11. Each bit of the con-
figuration registers sets the I/O mode of the
related port pin.
Analog Comparator Inputs
Pins PB0-PB7 for ST52x440G/441G and PB0-
PB3 and PB7 in ST52x440F/441F can be config-
ured to be Analog Inputs by setting the related bit
in REG_CONF 14 to “1” (Table 6.7) and the
related bit in REG_CONF13 to “1” (Table 6.6).
These analog inputs are connected to the on chip
Analog Comparator.
If the BandGap Reference (BG) is needed as an
Output for ST52x440G/441G REG_CONF13[6]
must be set to “0” and REG_CONF14[6] to “1”.
Bit Name Value
Pin Description
0
D0
X
PA0
1
D1
X
PA1/MAIN1
2
D2
X
PA2/MAIN2
3
D3
X
PA3/ACSTRT(*)
4
D4
X
PA4/TSTRT
5
D5
X
PA5/TCLK
6
D6
X
PA6/TRES
7
D7
X
PA7/INT
X = 0 Pin set as Digital Output
X = 1 Pin set as Alternate Function Input
Reset Configuration ‘1111’
(*) Not available in ST52x400xx
48/94