ARTERY AT32F421 GPIO User Manual Download Page 1

  AT32F421  GPIO  user  guide

 

2020.07.30 

Rev.1.0.0 

www.arterytek.com 

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. 
 
Reference materials: 

 

AT32F4xx_StdPeriph_Lib_V1.x.x\Project\AT_START_F421\Examples\GPIO 

 

GPIO section in the reference manual of AT32F421 

 

Applicable products: 

Part number

 

AT32F421xx

 

 

Summary of Contents for AT32F421 GPIO

Page 1: ...nd 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 on...

Page 2: ...pin FT 9 AFIO 10 I O alternate function input output 10 Special I Os 11 Debug alternate function pin 11 Oscillator alternate function pin 12 Backup domain pin 12 GPIO firmware driver API 13 Output mo...

Page 3: ...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 Configure port B alternate function by GPIOB_...

Page 4: ...AT32F421 GPIO user guide 2020 07 30 4 Rev 1 0 0 www arterytek com List of figures Figure 1 Basic structure of I O port bit 6 Figure 2 I O toggle speed 8...

Page 5: ...rs accessible with fAHB speed The peripheral function of the I O pin can be locked through a specific operation to avoid unwanted writing to I O registers Each GPIO pin can be individually configured...

Page 6: ...IOx_OPTDT is output on the I O pin It is possible to use the output driver in push pull mode or open drain mode only low level is activated while the high level shows high impedance The input data reg...

Page 7: ...ut PP 0 1 1 Reserved 1 0 0 GP output OD 1 0 1 GP output OD 1 1 0 GP output OD 1 1 1 Reserved GP output OD 10 0 0 0 AF output PP 0 0 1 AF output PP 0 1 0 AF output PP 0 1 1 Reserved 1 0 0 AF output OD...

Page 8: ...V tolerant pins PC14 PC15 OSC32_IN OUT PF0 PF1 OSC_IN OUT Table 2 TC pin example Pin name Pin name IO structure Alternate function Additional function PF0 OSC_IN PF0 I O TC I2C1_SDA OSC_IN 5V tolerant...

Page 9: ...rnate function Additional function PA0 I O FTa TMR1_ETR USART2_CTS I2C2_SCL COMP_OUT ADC_IN0COMP_INP2 COMP_INM6 WKUP1 5V tolerant pin FT Other GPIOs are all 5V tolerant Table 4 FT pin example Pin name...

Page 10: ...ts Table 5 Configure port A alternate function by GPIOA_AFR register Pin name AF0 AF1 AF2 AF3 AF4 AF5 AF6 AF7 PA0 USART2_CTS I2C2_SCL TMR1_ETR COMP_OUT PA1 EVENTOUT USART2_RTS I2C2_SDA TMR15_CH1N PA2...

Page 11: ...I2C1_SCL TMR16_CH1N I2S1_MCK PB7 USART1_RX I2C1_SDA TMR17_CH1N PB8 I2C1_SCL TMR16_CH1 PB9 IR_OUT I2C1_SDA TMR17_CH1 EVENTOUT I2S1_MCK SPI2_NSS I2S2_WS PB10 I2C2_SCL SPI2_SCK I2S2_CK PB11 EVENTOUT I2C...

Page 12: ...C_OUT OSC32_OUT can be used as GPIO Backup domain pin When 1 2V domain is powered off when the device enters standby mode PC13 PC14 PC15 lost their GPIO functions In this case if GPIO is not configure...

Page 13: ...Output mode GPIO provides two different types of output modes push pull and open drain Refer to the following configuration example of output mode GPIO_InitStructure GPIO_Pins GPIO_Pins_x GPIO_InitStr...

Page 14: ...GPIO_PinAFConfig function After reset all I Os are connected to the system alternate function 0 AF0 Configure AF1 to AF7 to map peripherals alternate functions 3 In addition to these flexible I O alte...

Page 15: ...ration Enable AHB interface clock of GPIOA RCC_AHBPeriphClockCmd RCC_AHBPERIPH_GPIOA ENABLE Connect PA6 to TMR1_BKIN GPIO_PinAFConfig GPIOA GPIO_PinsSource6 GPIO_AF_2 Connect PA8 to TMR1_CH1 GPIO_PinA...

Page 16: ...sSource7 GPIO_AF_1 Configure I2C1_SCL and I2C1_SDA as alternate functions Note that I2C pin should be open drain output GPIO_InitStructure GPIO_Pins GPIO_Pins_6 GPIO_Pins_7 GPIO_InitStructure GPIO_Mod...

Page 17: ...AT32F421 GPIO user guide 2020 07 30 17 Rev 1 0 0 www arterytek com Revision history Table 8 Document revision history Date Revision Changes 2020 07 30 1 0 0 Initial release...

Page 18: ...otherwise a license to use third party s products and services or b licensing the third parties intellectual property rights or c warranting the third party s products and services and its intellectu...

Reviews: