Rev. 1.00
70
September 11, 2018
Rev. 1.00
71
September 11, 2018
HT45F4050
A/D NFC Flash MCU
HT45F4050
A/D NFC Flash MCU
Pin-shared Functions
The flexibility of the microcontroller range is greatly enhanced by the use of pins that have more
than one function. Limited numbers of pins can force serious design constraints on designers but by
supplying pins with multi-functions, many of these difficulties can be overcome. For these pins, the
desired function of the multi-function I/O pins is selected by a series of registers via the application
program control.
Pin-shared Function Selection Registers
The limited number of supplied pins in a package can impose restrictions on the amount of functions
a certain device can contain. However by allowing the same pins to share several different functions
and providing a means of function selection, a wide range of different functions can be incorporated
into even relatively small package sizes. The device includes Port "x"
O
utput
F
unction Selection
register "n", labeled as PxSn, and Input Function Selection register
"
i
", labeled as IFS
i
, which can
select the desired functions of the multi-function pin-shared pins.
When the pin-shared input function is selected to be used, the corresponding input and output
functions selection should be properly managed. For example, if the I
2
C SDA line is used, the
corresponding output pin-shared function should be configured as the SDI/SDA function by
configuring the PxSn register and the SDA signal intput should be properly selected using the IFS
i
register. However, if the external interrupt function is selected to be used, the relevant output pin-
shared function should be selected as an I/O function and the interrupt input signal should be selected.
The most important point to note is to make sure that the desired pin-shared function is properly
selected and also deselected. For most pin-shared functions, to select the desired pin-shared function,
the pin-shared function should first be correctly selected using the corresponding pin-shared control
register. After that the corresponding peripheral functional setting should be configured and then the
peripheral function can be enabled. However, a special point must be noted for some digital input
pins, such as INTn, xTCKn, xTPnI, etc, which share the same pin-shared control configuration with
their corresponding general purpose I/O functions when setting the relevant pin-shared control bit
fields. To select these pin functions, in addition to the necessary pin-shared control and peripheral
functional setup aforementioned, they must also be setup as an input by setting the corresponding bit
in the I/O port control register. To correctly deselect the pin-shared function, the peripheral function
should first be disabled and then the corresponding pin-shared function control register can be
modified to select other pin-shared functions.
Register
Name
Bit
7
6
5
4
3
2
1
0
PAS0
PAS07
PAS06
PAS05
PAS04
PAS03
PAS02
PAS01
PAS00
PAS1
PAS17
PAS16
PAS15
PAS14
PAS13
PAS12
PAS11
PAS10
PBS0
PBS07
PBS06
PBS05
PBS04
PBS03
PBS02
PBS01
PBS00
PBS1
PBS17
PBS16
PBS15
PBS14
PBS13
PBS12
PBS11
PBS10
PCS0
PCS07
PCS06
PCS05
PCS04
PCS03
PCS02
PCS01
PCS00
PCS1
PCS17
PCS16
PCS15
PCS14
PCS13
PCS12
PCS11
PCS10
PDS0
PDS07
PDS06
PDS05
PDS04
PDS03
PDS02
PDS01
PDS00
PES0
PES07
PES06
PES05
PES04
PES03
PES02
PES01
PES00
PES1
—
—
—
—
—
—
PES11
PES10
PFS0
PFS07
PFS06
PFS05
PFS04
PFS03
PFS02
PFS01
PFS00
PFS1
PFS17
PFS16
PFS15
PFS14
PFS13
PFS12
PFS11
PFS10
IFS0
SCSBPS SDISDAPS SCKSCLPS STPIPS PTPIPS STCKPS CTCKPS PTCKPS
IFS1
—
—
—
—
—
—
INT1PS INT0PS
Pin-shared Function Selection Registers List