English
Language : 

UPSD33XX Datasheet, PDF (59/231 Pages) STMicroelectronics – Fast 8032 MCU with Programmable Logic
uPSD33xx
Alternate Functions. There are five SFRs used
to control the mapping of alternate functions onto
MCU port pins, and these SFRs are depicted as
switches in Figure 16., page 55.
■ Port 3 uses the SFR, P3SFS (Table
28., page 60).
■ Port 1 uses SFRs, P1SFS0 (Table
29., page 60) and P1SFS1 (Table
30., page 60).
■ Port 4 uses SFRs, P4SFS0 (Table
32., page 61) and P4SFS1 (Table
33., page 61).
Since these SFRs are cleared by a reset, then by
default all port pins function as GPIO (not the alter-
nate function) until firmware initializes these SFRs.
Each pin on each of the three ports can be inde-
pendently assigned a different function on a pin-
by-pin basis.
The peripheral functions Timer 2, UART1, and I2C
may be split independently between Port 1 and
Port 4 for additional flexibility by giving a wider
choice of peripheral usage on a limited number of
device pins.
When the selected alternate function is UART0,
UART1, or SPI, then the related pins are in quasi-
bidirectional mode, including the use of the high-
side driver for rapid 0-to-1 output transitions. The
high-side driver is enabled for just one MCU_CLK
period on 0-to-1 transitions by the delay function at
the “digital_alt_func_data_out” signal pictured in
Figure 17., page 56 through Figure 19., page 57.
If the alternate function is Timer 0, Timer 1, Timer
2, or PCA input, then the related pins are in quasi-
bidirectional mode, but input only.
If the alternate function is ADC, then for each pin
the pull-ups, the high-side driver, and the low-side
driver are disabled. The analog input is routed di-
rectly to the ADC unit. Only Port 1 supports analog
functions (Figure 17., page 56). Port 1 is not 5V
tolerant.
If the alternate function is I2C, the related pins will
be in open drain mode, which is just like quasi-bi-
directional mode but the high-side driver is not en-
abled for one cycle when outputting a 0-to-1
transition. Only the low-side driver and the internal
weak pull-ups are used. Only Port 3 supports
open-drain mode (Figure 18., page 56). I2C re-
quires the use of an external pull-up resistor on
each bus signal, typically 4.7KΩ to VCC.
If the alternate function is PCA output, then the re-
lated pins are in push-pull mode, meaning the pins
are actively driven and held to logic '1' by the high-
side driver, or actively driven and held to logic '0'
by the low-side driver. Only Port 4 supports push-
pull mode (Figure 19., page 57). Port 4 push-pull
pins can source IOH current when driving logic '1,'
and sink IOL current when driving logic '0.' This
current is significantly more than the capability of
pins on Port 1 or Port 3 (see Table
129., page 207).
For example, to assign these port functions:
■ Port 1: UART1, ADC[1:0], P1[7:4] are GPIO
■ Port 3: UART0, I2C, P3[5:2] are GPIO
■ Port 4: TCM0, SPI, P4[3:1] are GPIO
The following values need to be written to the
SFRs:
P1SFS0 = 00001111b, or 0Fh
P1SFS1 = 00000011b , or 03h
P3SFS = 11000011b, or C3h
P4SFS0 = 11110001b, or F1h
P4SFS1 = 11110000b, or F0h
59/231