STM32F103: When is multiplexed IO (AFIO) needed?

Publisher:SparkCrafterLatest update time:2018-06-15 Source: eefocusKeywords:STM32F103 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Article Source:

I just came into contact with STM32F103. When I tried to write "button interrupt" and "PWM breathing light" programs, I found that the routines all used pin multiplexing AFIO:

//Open pin multiplexing AFIORCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO,ENABLE);12

When I wrote the "232USART serial communication" program, I wrote the above code very confidently, but found that there was no such sentence in the routine, which was very confusing... After checking a lot of information and adding my own understanding, I found that there is still some content worth summarizing about the use of AFIO.

When is RCC_APB2Periph_AFIO needed? - Use of multiplexed IO clocks - gtkknd

This is also a good point. It is easy for beginners to forget to turn on AFIO and the corresponding pins, but it is not clear when to turn it on. In fact, AFIO needs to be turned on when remapping.

Write the picture description here

Later, I found a great guy who called himself a rookie. In his article ( Learning STM32 (2) - IO-AFIO (multiplexing function IO and debugging configuration)  ), he explained this issue very clearly:

Write the picture description here

Conclusion:

Sometimes I find that what others say is a bit confusing and I can’t understand it at all. Only when I understand it thoroughly do I realize that what they say is so organized and accurate!


Keywords:STM32F103 Reference address:STM32F103: When is multiplexed IO (AFIO) needed?

Previous article:STM32 GPIO multiplexing and remapping functions
Next article:stm32 HAL remapping

Recommended ReadingLatest update time:2024-11-16 14:40

FreeRTOS+STM32F103 serial communication error solution
When debugging the FreeRTOS system, I use a queue to store data in the serial port interrupt, and then use the queue to receive data in the timer interrupt and print it out through the serial port. The compiler reports an error in the debugging code. …OBJLED.axf: Error: L6915E: Library reports error: __use_no_semiho
[Microcontroller]
FreeRTOS+STM32F103 serial communication error solution
Megatron 216M M3 core MCU, MH2103ACCT6 perfectly replaces STM32F103C8T6/CBT6
Zhaoxun Hengda's software and hardware perfectly replace F103/105 series, F103 series, etc. MH2103CCCT6/MH2103ACCT6 MH2103ARPT6 MH2103AVET6 MH2103AVGT6 MH2103AZET6 Main frequency 216 MHz Built-in memory includes: maximum 1024K Flash, 96K S This series has built-in up to 2 adva
[robot]
Design of digital adjustable resonance source based on low power consumption STM32F103C8 chip
1 System Structure According to the performance requirements of the system, the resonance source system is mainly composed of six parts: computer control software, USB communication, CPU module, signal generation module, signal filtering and amplification circuit module, display and keyboard control module, and
[Microcontroller]
Design of digital adjustable resonance source based on low power consumption STM32F103C8 chip
Voltage display based on STM32F103
Using STM32F103 and LCD1602 to realize the function of real-time voltage display The pin used by ADC is PA (0) Below is the ADC configuration #include "ADC.h" void ADC_Init_MY(void) { GPIO_InitTypeDef GPIO_InitStructure; ADC_InitTypeDef ADC_InitStructure; RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2
[Microcontroller]
Voltage display based on STM32F103
STM32F103: When is multiplexed IO (AFIO) needed?
Article Source: I just came into contact with STM32F103. When I tried to write "button interrupt" and "PWM breathing light" programs, I found that the routines all used pin multiplexing AFIO: //Open pin multiplexing AFIORCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO,ENABLE);12 When I wrote the "232USART serial communic
[Microcontroller]
STM32F103 uses internal Flash to save parameters
      When we develop applications, we often need to save some program running parameters, such as some correction coefficients. The characteristics of these data are: small in number and do not need to be modified frequently, but they cannot be defined as constants, because each device may be different and may be mod
[Microcontroller]
STM32F103 uses internal Flash to save parameters
STM32F103RE uses SPI3 as slave mode
Most of the STM32 SPI routines found on the Internet are used as master mode, and there are slave mode routines in the official routines.  However, I set SPI3 to slave mode according to the official routines, and found that the MISO pin had no data output, but the timing of the host was fine.  The problem lies in the
[Microcontroller]
Turning the AFIO clock on and off
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 inp
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号