< Hempl

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, Hempl 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 LCDpins 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 Hempl console to be on the serial port, it programs UART0's RX and TX pins to talk RS232;
  • if your Hempl firmware includes MMC/SD card support, the pins of the second SPI port, SPI1, 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
Port A
PINSIGNALDescriptionBus pin
PA00UART0_RXRight bus serial portBUS4 pin 3
PA01UART0_TXBUS4 pin 4
PA02GPIO2Bus GPIO, 4mA max, VGA SRAM /HOLD pinBUS5 pin 11
PA03UART0_RTSRight bus serial portBUS4 pin 5
PA04UART0_CTSBUS4 pin 6
PA05UART1_RXLeft bus serial portBUS3 pin 3
PA06UART1_TXBUS3 pin 4
PA07GPIO7Bus GPIO, 4mA maxBUS5 pin 12
PA08UART1_RTSLeft bus serial portBUS3 pin 10
PA09UART1_CTSBUS3 pin 9
PA10SPI0_CS0Left bus SPIBUS1 pin 12
PA11SPI0_MISOBUS1 pin 13
PA12SPI0_MOSIBUS1 pin 14
PA13SPI0_SCKBUS1 pin 15
PA14SPI1_CS0SD card chip selectNone
PA15SPI1_SCKRight bus SPI/SD card clockBUS4 pin 9
PA16SPI1_MOSIRight bus SPI/SD card data in (host->card)BUS4 pin 10
PA17SPI1_MISORight bus SPI/SD card data out (card->host)BUS4 pin 11
PA18SPI1_CS1"FREE"None
PA19SPI1_CS2Right bus SPI chip selectBUS4 pin 12
PA20EXT_INT?BUS5 pin 13
PA21ADC0ADCBUS5 pin 5
PA22ADC1BUS5 pin 6
PA23ADC2BUS5 pin 7
PA24ETHERNETEthernet interruptBUS2 pin 3
PA25ADC4ADCBUS6 pin 4
PA26ADC5BUS6 pin 5
PA27ADC6BUS6 pin 6
PA28ADC7BUS6 pin 7
PA29SDAI2CBUS2 pin 10
PA30SCLBUS2 pin 11
Port B
PINSIGNALDescriptionBus pin
PB00REF_CLKEthernetBUS1 pin 3
PB01TX_ENBUS1 pin 4
PB02TX0BUS1 pin 5
PB03TX1BUS1 pin 6
PB04XNone
PB05RX0BUS2 pin 5
PB06RX1BUS2 pin 6
PB07RX_ERBUS2 pin 7
PB08MDCBUS2 pin 4
PB09MDIOBUS2 pin 8
PB10SDCKSDRAMNone
PB11SDCKENone
PB12RASnNone
PB13CASnNone
PB14SDWEnNone
PB15RX_DVEthernetBUS1 pin 7
PB16SDA10SDRAM A10None
PB17GPIO49Bus GPIO, 4mA maxBUS5 pin 8
PB18GPIO50/PWM6Bus GPIO, 4mA max/PWM channel 6BUS5 pin 9
PB19PWM0PWMBUS4 pin 7
PB20PWM1BUS4 pin 8
PB21PWM2None
PB22PWM3BUS6 pin 1
PB23UART1_DCDLeft bus serial portBUS3 pin 5
PB24UART1_DSRBUS3 pin 6
PB25UART1_DTRBUS3 pin 7
PB26UART1_RIBUS3 pin 8
PB27PWM4PWM channel 4BUS6 pin 2
PB28PWM5BUS6 pin 3
PB29GPIO61/LEDOn-board LED (0=lit)None
PB30GPIO62Bus GPIO, 4mA maxBUS6 pin 9
PB31GPIO63BUS6 pin 10
Port C
PINSIGNALDescription
PC00Xin3232768Hz crystal "X2" (*)
PC01Xout32
PC02Xin012MHz crystal "X1"
PC03Xout0
PC04Xin1Not used
PC05Xout1
  • ) On circuit pads C47 before Mizar32 v1.3.2
Port X
PINSIGNALDescriptionBus pin
PX00D10SDRAMNone
PX01D9
PX02D8
PX03D7
PX04D6
PX05D5
PX06D4
PX07D3
PX08D2
PX09D1
PX10D0
PX11DQM1
PX12X
PX13X
PX14CS1n
PX15X
PX16GPIO88/BUTTONBus GPIO/Push button on main board (low when pressed)BUS6 pin 13
PX17A17SDRAM BA1None
PX18A16SDRAM BA0
PX19GPIO85Bus GPIO, 4mA maxBUS6 pin 12
PX20A14SDRAM A12None
PX21A13SDRAM A11
PX22GPIO82Bus GPIO, 4mA max (SDRAM A10 is on PB16)BUS6 pin 11
PX23A11SDRAM A9None
PX24A10SDRAM A8
PX25A9SDRAM A7
PX26A8SDRAM A6
PX27A7SDRAM A5
PX28A6SDRAM A4
PX29A5SDRAM A3
PX30A4SDRAM A2
PX31A3SDRAM A1
PX32A2SDRAM A0
PX33GPIO71Bus GPIO, 4mA maxBUS5 pin 10
PX34DQM0SDRAMNone
PX35D15
PX36D14
PX37D13
PX38D12
PX39D11

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

OldNewAlso known as
P3BUS1BUS_HALF_LEFT_UP
P4BUS2BUS_HALF_LEFT_DOWN
P2BUS3BUS_HALF_LEFT_EXT
P5BUS4BUS_HALF_RIGHT_UP
P6BUS5BUS_HALF_RIGHT_DOWN
P7BUS6BUS_HALF_RIGHT_EXT

Further reading

This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.