Eight analog inputs can be programmed as GPIO functions (GPIO through GPIO). The GPIO function is a digital input/output with a logic value that is read and written by the GPIODAT data register. The GPIO voltage levels are referenced to the ADC analog power supply voltages, VAVDD and VAVSS. The GPIO input voltage threshold for logic 1 is (VAVDD + VAVSS) / 2. As shown in Figure 9-27, analog inputs, AIN3 through AINCOM, can be programmed for GPIO function. Register GPIOCON programs the GPIO connection for each pin (1 = connect). Register GPIODIR programs the direction of each pin, either as input or output (0 = output). Register GPIODAT is the GPIO data value register. Note if a GPIO pin is programmed as an output, the readback data value of the corresponding GPIODAT register bit is zero.