Page 1
AT32F421 GPIO user guide AN0069 Application Note AT32F421 GPIO user guide Introduction AT32F421xx general-purpose I/Os provide a wide range of interfaces to achieve digital or analog communications between MCU and other embedded devices. Besides, AT32F421 series GPIOs feature rich I/O alternate functions to enable multiple peripherals to work at the same time, and make sure that each pin is connected to only one peripheral at a certain time so as to avoid conflicts among peripherals.
AT32F421 GPIO user guide Contents GPIO features ......................5 GPIO ........................6 GPIO toggle ......................8 5V-tolerant or 3V-tolerant IO ..................8 Standard 3.3V-tolerant pins (TC) ................. 8 5V-tolerant pin with analog function (FTa) ..............8 5V-tolerant pin (FT) ...................... 9 AFIO ........................
Page 3
AT32F421 GPIO user guide List of tables Table 1. I/O port bit configuration table ....................7 Table 2. TC pin example ........................8 Table 3. FTa pin example ........................9 Table 4. FT pin example........................9 Table 5. Configure port A alternate function by GPIOA_AFR register..........10 Table 6.
Page 4
AT32F421 GPIO user guide List of figures Figure 1. Basic structure of I/O port bit ....................6 Figure 2. I/O toggle speed ........................8 2020.07.30 Rev.1.0.0 www.arterytek.com...
AT32F421 GPIO user guide GPIO features 48-pin package (largest) has 39 multi-function bidirectional I/O ports All I/O ports can be mapped to 16 external interrupt vectors Almost all I/O ports are 5V tolerant (except for 4x OSC/OSC32 pins) ...
AT32F421 GPIO user guide GPIO During and just after reset, the alternate functions are not active and most I/O ports are configured in input floating mode. When configured as output, the value written to the output data register (GPIOx_OPTDT) is output on the I/O pin.
AT32F421 GPIO user guide Table 1. I/O port bit configuration table MODER[1:0] OTYPER ODRVR[1:0] PUPDR[1:0] I/O configuration GP output GP output GP output Reserved GP output GP output GP output Reserved (GP output OD) ODRV[1:0] AF output AF output AF output...
AT32F421 GPIO user guide GPIO toggle All I/O ports of AT32F421 series are fast I/Os with control registers accessible at f speed so that the GPIO toggle frequency can reach 60 MHz with ease. Figure 2. I/O toggle speed 5V-tolerant or 3V-tolerant IO Standard 3.3V-tolerant pins (TC)
AT32F421 GPIO user guide Table 3. FTa pin example Pin name Pin name IO structure Alternate function Additional function TMR1_ETR / ADC_IN0COMP_INP2 USART2_CTS / COMP_INM6 / /I2C2_SCL / WKUP1 COMP_OUT 5V-tolerant pin (FT) Other GPIOs are all 5V tolerant. Table 4. FT pin example...
AT32F421 GPIO user guide AFIO I/O alternate function input/output Most peripherals share the same GPIO pin (For example, PA0 can be used as TMR1_ETR / USART2_CTS /I2C2_SCL / COMP_OUT) A GPIO pin is connected to only one peripheral at any time.
AT32F421 GPIO user guide PA13: SWDIO, AF pull-up PA14: SWCLK, AF pull-down Oscillator alternate function pin When the oscillator is OFF (default state after reset), related pins can be used as GPIO When the oscillator is enabled, the GPIO configuration of the related pins is invalid ...
AT32F421 GPIO user guide GPIO firmware driver API Artery’s firmware driver contains a series of firmware functions to manage the following GPIO functions: Initialization configuration Read input ports or certain input pin Read output ports or certain output pin ...
AT32F421 GPIO user guide Analog mode When the user needs to use ADC or COMP channel as input, it is necessary to configure the corresponding pins as analog mode. Refer to the following configuration example of analog mode. GPIO_InitStructure.GPIO_Pins = GPIO_Pins_x;...
AT32F421 GPIO user guide Revision history Document revision history Table 8. Date Revision Changes 2020.07.30 1.0.0 Initial release 2020.07.30 Rev.1.0.0 www.arterytek.com...
Page 18
Purchasers hereby agrees that Artery’s products are not authorized for use as, and purchasers shall not integrate, promote, sell or otherwise transfer any Artery’s product to any customer or end user for use as critical components in (a) any medical, life saving or life support device...
Need help?
Do you have a question about the AT32F421 GPIO and is the answer not in the manual?
Questions and answers