
UM10800
All information provided in this document is subject to legal disclaimers.
© NXP Semiconductors N.V. 2016. All rights reserved.
User manual
Rev. 1.2 — 5 October 2016
77 of 487
NXP Semiconductors
UM10800
Chapter 7: LPC82x Switch matrix (SWM)
•
If you want to assign a GPIO pin to a pin on any LPC800 package, disable any special
function available on this pin in the PINENABLE0 register and do not assign any
movable function to it.
By default, all pins except pins PIO0_2, PIO0_3, and PIO0_5 are assigned to GPIO.
•
For all other functions that are not in the table of movable functions, do the following:
a. Locate the function in the pin description table in the data sheet. This shows the
package pin for this function.
b. Enable the function in the PINENABLE0 register. All other possible functions on
this pins are now disabled.
7.3.3 Changing the pin function assignment
Pin function assignments can be changed “on-the-fly” from one peripheral to another
while the part is running. To disconnect a peripheral from the pins and change the pin
function assignment, follow these steps:
1. Enable the clock to the switch matrix.
2. Find the pin assign register for the current pin function. For example, register
PINASSIGN0 for pin function U0_RXD.
3. Set the corresponding bits in the PINASSIGN register to their default value 0xFF.
4. Clear all pending interrupts for the disconnected peripheral and ensure that the
peripheral is in a defined state.
5. In the pin assign register for the new pin function, program the pin number.
6. Disable the clock to the switch matrix.
7.4 General description
The switch matrix connects internal signals (functions) to external pins. Functions are
signals coming from or going to a single pin on the package and coming from or going to
an on-chip peripheral block. Examples of functions are the GPIOs, the UART transmit
output (TXD), or the clock output CLKOUT. Many peripherals have several functions that
must be connected to external pins.
The switch matrix also enables the output driver for digital functions that are outputs. The
electrical pin characteristics for both inputs and outputs (internal pull-up/down resistors,
inverter, digital filter, open-drain mode) are configured by the IOCON block for each pin.
Most functions can be assigned through the switch matrix to any external pin that is not a
power or ground pin. These functions are called movable functions.
A few functions like the crystal oscillator pins (XTALIN/XTALOUT) or the analog
comparator inputs can only be assigned to one particular external pin with the appropriate
electrical characteristics. These functions are called fixed-pin functions. If a fixed-pin
function is not used, it can be replaced by any other movable function.
For fixed-pin analog functions, the switch matrix enables the analog input or output and
disables the digital pad.