Digital I/Os are arranged into ports with up-to-eight pins per port.
Some of the I/O pins are multiplexed with special functions (USB, debug port, crystal oscillator). Special functions are enabled using control registers associated with the specific functions. The test goal is to ensure that I/O pins are not shorted to GND or Vcc.
In normal operating conditions, the pin-to-ground and pin-to-VCC resistances are very high. To detect any shorts, resistance values are compared with the internal pull-up resistors. To detect a pin-to-ground short, the pin is configured in the resistive pull-up Drive mode. Under normal conditions, the CPU reads a logical 1 because of the pull-up resistor. If the pin is connected to ground through a small resistance, the input level is recognized as a logical 0. To detect a sensor-to-VCC short, the sensor pin is configured in the resistive pull-down drive mode. The input level is zero under normal conditions. If the pin is connected to VCC through a small resistance, the input level is recognized as a logical one.
Some I/O pins are multiplexed with analog blocks such as PPCA. Some of those pins can be mapped to GPIO and tested like other GPIO pins; others cannot. Refer to the device datasheet to verify pin mapping and testability.
API Reference | |
| Macros | |
| Functions | |