Turning the AFIO clock on and off

Publisher:忙中取乐Latest update time:2018-08-27 Source: eefocusKeywords:Open Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

The function of the pins of STM32F1 after power-on reset is called the main function. The main function of most pins is to serve as a general-purpose input and output pin (GPIO). In addition to the main function, the pins also have a backup function. When the backup function is selected, it is used as an alternate input and output (AFIO). This 
Write the picture description here 
can be found in the microcontroller data sheet (Table 5 Medium-capacity STM32F103xx pin definition). Some pins have two types of backup functions, one is the default multiplexing and the other is the redefined function. When using the default multiplexing function of the pin, AFIO does not need to be turned on; when using the redefined function, AFIO needs to be turned on. In another case, AFIO also needs to be turned on when using the EXTI external interrupt. 
For example, if we use PA7 as the second channel of TIM3, or configure PB10 and PB11 as USART3, there is no need to operate AFIO. 
Write the picture description here 
The main function of most pins is GPIO, but the main function of PB3 and PB4 is to serve as pins for program download and resetting the microcontroller. Therefore, it is necessary to turn on the redefined function of PB3 and PB4 to make them general-purpose input and output. The program is as follows:


RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO,ENABLE);

GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable,ENABLE);


Keywords:Open Reference address:Turning the AFIO clock on and off

Previous article:STM32 implements USART1 communication through interruption
Next article:When does the STM32 AFIO clock start?

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号