Port Mapping Controller Introduction
701
SLAU356I – March 2015 – Revised June 2019
Copyright © 2015–2019, Texas Instruments Incorporated
Port Mapping Controller (PMAP)
13.1 Port Mapping Controller Introduction
The port mapping controller allows the flexible and reconfigurable mapping of digital functions to port pins.
The port mapping controller features are:
•
Configuration protected by write access key.
•
Default mapping provided for each port pin (device-dependent, see the pinout in the device-specific
data sheet).
•
Mapping can be reconfigured during runtime.
•
Each output signal can be mapped to several output pins.
13.2 Port Mapping Controller Operation
The port mapping is configured with user software. The following sections describe the configuration.
13.2.1 Access
To enable write access to any of the port mapping controller registers, the correct key must be written into
the PMAPKEYID register. The PMAPKEYID register always reads 096A5h. Writing the key 02D52h grants
write access to all port mapping controller registers. Read access is always possible.
If an invalid key is written while write access is granted, any further write accesses are prevented. It is
recommended that the application completes mapping configuration by writing an invalid key.
Interrupts should be disabled during the configuration process or the application should take precautions
that the execution of an interrupt service routine does not accidentally cause a permanent lock of the port
mapping registers; for example, by using the reconfiguration capability (see
).
The access status is reflected in the PMAPLOCK bit.
By default, the port mapping controller allows only one configuration after each hard reset. A second
attempt to enable write access by writing the correct key is ignored, and the registers remain locked. A
hard reset is required to disable the permanent lock again. If it is necessary to reconfigure the mapping
during runtime, the PMAPRECFG bit must be set during the first write access timeslot. If PMAPRECFG is
cleared during later configuration sessions, no more configuration sessions are possible.
NOTE:
Port mapping functions should not be reconfigured while the respective peripheral functions
are active. For example, Timer PWM or eUSCI transmit and receive functions should not be
reconfigured while these functions are active.
13.2.2 Mapping
For each port pin, Px.y, on ports providing the mapping functionality, a mapping register, PxMAPy, is
available. Setting this register to a certain value maps a module's input and output signals to the
respective port pin Px.y. The port pin itself is switched from a general purpose I/O to the selected
peripheral (or secondary) function by setting the corresponding PxSEL.y bit to 1. If the input or the output
function of the module is used, it is typically defined by the setting the PxDIR.y bit. If PxDIR.y = 0, the pin
is an input, if PxDIR.y = 1, the pin is an output. There are also peripherals (for example, the eUSCI
module) that control the direction or even other functions of the pin (for example, open drain), and these
options are documented in the mapping table.
With the port mapping functionality, the output of a module can be mapped to multiple pins. Also the input
of a module can receive inputs from multiple pins. When mapping multiple inputs onto one function, the
input signals are logically ORed together without applying any priority; therefore, a logic one on any of the
inputs results in a logic one at the module. The external input at a device pin must be at a logic zero when
the pin configuration is changed from peripheral function to I/O function by changing PxSEL0.y and
PxSEL1.y bits to 0.