Mizar32/GPIO

= Introduction = GPIO means General Purporse Input/Output and is the generic name for all the pins of the AVR32UC3A microcontroller. Every pin of the microcontroller is a GPIO pin except for the power supply pins, the pin that resets the processor and the USB JTAG signal connections. This includes the connections to the SDRAM and every other input or output signal.

Each of the GPIO pins can be programmed to have one of three functions, and the three functions are different for every pin. When the Mizar32 is turned on, it is deaf and blind and the first thing that the on-board software must do is to program the correct function for each of the GPIO pins that are necessary for it to be able to talk to the rest of the world.

For example, eLua does the following when it starts up:
 * it programs the pins that are connected to the oscillator crystals to function as oscillator inputs. This increases its processing speed from 115kHz (its internal oscillator) to 66MHz (the external oscillator). It also programs the pins connected to the 32768Hz crystal as oscillator inputs so that it can measure time accurately;
 * it programs the pins connected to the SDRAM memory to work as SDRAM memory pins so that, as well as the 64Kbyte (Models A and B) or 32Kbyte (Model C) internal RAM, it can also access the 32Mbyte SDRAM memory chip;
 * if you have configured the eLua console to be on the serial port, it programs UART0's RX and TX pins to talk RS232;
 * if your eLua firmware includes MMC/SD card support, the pins of the second SPI port,, are programmed to talk the MMC/SD card.

The GPIO pins for all other devices are programmed to perform their function the first time you call them from Lua. If you are not using some device you are free to use its GPIO pins as simple input/output pins: see the PIO section for further details on how to do this.

= Pin functions = On the Mizar32, the following functions are assigned to the GPIO pins:

Legend:
 * X = Pin is not connected to anything
 * Foo/Bar = signal is used for more than one thing


 * ) On circuit pads C47 before Mizar32 v1.3.2

Bus renaming: In Mizar32 v1.3.2, the bus connectors were renamed

= Further reading =
 * The PIO section explains further how these pins are used.
 * There is a summary table of the possible functions that can be assigned to each GPIO pin in the Atmel AVR32UC3A Datasheet, section 12.7 "Peripherals: Peripheral Multiplexing on I/O lines", table 12-9.
 * The last part of the file in the AVR32 GNU toolchain  gives a complete definition of what functions can be assigned to each pin.