Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

Mizar32/GPIO

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

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, 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 PIN SIGNAL Description Bus pinPA00UART0_RX Right bus serial port BUS4 pin 3PA01UART0_TX BUS4 pin 4PA02GPIO2 Bus GPIO, 4mA max, VGA SRAM /HOLD pin BUS5 pin 11PA03UART0_RTS Right bus serial port BUS4 pin 5PA04UART0_CTS BUS4 pin 6PA05UART1_RX Left bus serial port BUS3 pin 3PA06UART1_TX BUS3 pin 4PA07GPIO7 Bus GPIO, 4mA max BUS5 pin 12PA08UART1_RTS Left bus serial port BUS3 pin 10PA09UART1_CTS BUS3 pin 9PA10SPI0_CS0 Left bus SPI BUS1 pin 12PA11SPI0_MISO BUS1 pin 13PA12SPI0_MOSI BUS1 pin 14PA13SPI0_SCK BUS1 pin 15PA14SPI1_CS0 SD card chip select NonePA15SPI1_SCK Right bus SPI/SD card clock BUS4 pin 9PA16SPI1_MOSI Right bus SPI/SD card data in (host->card) BUS4 pin 10PA17SPI1_MISO Right bus SPI/SD card data out (card->host) BUS4 pin 11PA18SPI1_CS1 "FREE" NonePA19SPI1_CS2 Right bus SPI chip select BUS4 pin 12PA20EXT_INT ? BUS5 pin 13PA21ADC0 ADC BUS5 pin 5PA22ADC1 BUS5 pin 6PA23ADC2 BUS5 pin 7PA24ETHERNET Ethernet interrupt BUS2 pin 3PA25ADC4 ADC BUS6 pin 4PA26ADC5 BUS6 pin 5PA27ADC6 BUS6 pin 6PA28ADC7 BUS6 pin 7PA29SDA I2C BUS2 pin 10PA30SCL BUS2 pin 11 +Port B PIN SIGNAL Description Bus pinPB00REF_CLK Ethernet BUS1 pin 3PB01TX_EN BUS1 pin 4PB02TX0 BUS1 pin 5PB03TX1 BUS1 pin 6PB04X NonePB05RX0 BUS2 pin 5PB06RX1 BUS2 pin 6PB07RX_ER BUS2 pin 7PB08MDC BUS2 pin 4PB09MDIO BUS2 pin 8PB10SDCK SDRAM NonePB11SDCKE NonePB12RASn NonePB13CASn NonePB14SDWEn NonePB15RX_DV Ethernet BUS1 pin 7PB16SDA10 SDRAM A10 NonePB17GPIO49 Bus GPIO, 4mA max BUS5 pin 8PB18GPIO50/PWM6 Bus GPIO, 4mA max/PWM channel 6 BUS5 pin 9PB19PWM0 PWM BUS4 pin 7PB20PWM1 BUS4 pin 8PB21PWM2 NonePB22PWM3 BUS6 pin 1PB23UART1_DCD Left bus serial port BUS3 pin 5PB24UART1_DSR BUS3 pin 6PB25UART1_DTR BUS3 pin 7PB26UART1_RI BUS3 pin 8PB27PWM4 PWM channel 4 BUS6 pin 2PB28PWM5 BUS6 pin 3PB29GPIO61/LED On-board LED (0=lit) NonePB30GPIO62 Bus GPIO, 4mA max BUS6 pin 9PB31GPIO63 BUS6 pin 10 +Port C PIN SIGNAL DescriptionPC00Xin32 32768Hz crystal "X2" (*)PC01Xout32PC02Xin0 12MHz crystal "X1"PC03Xout0PC04Xin1 Not usedPC05Xout1 ) On circuit pads C47 before Mizar32 v1.3.2 +Port X PIN SIGNAL Description Bus pinPX00D10 SDRAM NonePX01D9PX02D8PX03D7PX04D6PX05D5PX06D4PX07D3PX08D2PX09D1PX10D0PX11DQM1PX12XPX13XPX14CS1nPX15XPX16GPIO88/BUTTONBus GPIO/Push button on main board (low when pressed)BUS6 pin 13PX17A17SDRAM BA1 NonePX18A16SDRAM BA0PX19GPIO85Bus GPIO, 4mA max BUS6 pin 12PX20A14SDRAM A12 NonePX21A13SDRAM A11PX22GPIO82Bus GPIO, 4mA max (SDRAM A10 is on PB16) BUS6 pin 11PX23A11SDRAM A9 NonePX24A10SDRAM A8PX25A9 SDRAM A7PX26A8 SDRAM A6PX27A7 SDRAM A5PX28A6 SDRAM A4PX29A5 SDRAM A3PX30A4 SDRAM A2PX31A3 SDRAM A1PX32A2 SDRAM A0PX33GPIO71 Bus GPIO, 4mA max BUS5 pin 10PX34DQM0 SDRAM NonePX35D15PX36D14PX37D13PX38D12PX39D11 Bus renaming: In Mizar32 v1.3.2, the bus connectors were renamed Old New Also known as P3 BUS1 BUS_HALF_LEFT_UP P4 BUS2 BUS_HALF_LEFT_DOWN P2 BUS3 BUS_HALF_LEFT_EXT P5 BUS4 BUS_HALF_RIGHT_UP P6 BUS5 BUS_HALF_RIGHT_DOWN P7 BUS6 BUS_HALF_RIGHT_EXT 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 /usr/avr32/include/avr32/uc3a0128.h gives a complete definition of what functions can be assigned to each pin.