English
Language : 

UPSD3422_06 Datasheet, PDF (74/293 Pages) STMicroelectronics – Turbo Plus Series Fast Turbo 8032 MCU with USB and Programmable Logic
I/O ports of mcu module
uPSD34xx
Table 29.
Bit 7
P4.7
P4: I/O Port 4 Register (SFR C0h, reset value FFh)
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
P4.6
P4.5
P4.4
P4.3
P4.2
Bit 1
P4.1
Bit 0
P4.0
Bit
Symbol
R/W
7
P4.7
R,W
6
P4.6
R,W
5
P4.5
R,W
4
P4.4
R,W
3
P4.3
R,W
2
P4.2
R,W
1
P4.1
R,W
0
P4.0
R,W
Function(1)
Port pin 4.7
Port pin 4.6
Port pin 4.5
Port pin 4.4
Port pin 4.3
Port pin 4.2
Port pin 4.1
Port pin 4.0
Note: 1 Write '1' or '0' for pin output. Read for pin input, but prior to READ, this bit must have been
set to '1' by firmware or by a reset event.
17.1.4
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 on page 71.
● Port 3 uses the SFR, P3SFS (Table 30 on page 75).
● Port 1 uses SFRs, P1SFS0 (Table 31 on page 75) and P1SFS1 (Table 32 on page 76).
● Port 4 uses SFRs, P4SFS0 (Table 34 on page 76) and P4SFS1 (Table 35 on page 76).
Since these SFRs are cleared by a reset, then by default all port pins function as GPIO (not
the alternate function) until firmware initializes these SFRs.
Each pin on each of the three ports can be independently 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 on page 71 through Figure 19 on page 72.
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 directly to the ADC unit. Only Port 1
supports analog functions (Figure 17 on page 71). 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-bidirectional mode but the high-side driver is not enabled for one cycle when
74/293