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
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.
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);
Previous article:STM32 implements USART1 communication through interruption
Next article:When does the STM32 AFIO clock start?
- Popular Resources
- Popular amplifiers
- Learn ARM development(19)
- Learn ARM development(14)
- Learn ARM development(15)
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Learn ARM development(19)
- Learn ARM development(14)
- Learn ARM development(15)
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- [Prize Download] Infineon "Selection Guide for Power Devices for Fashionable Small Home Appliances"
- CC2640R2F: A must-read for beginners
- [Fudan Micro FM33LG0 Series Development Board Review] OPA Function Analysis
- DesignDRIVE Development Kit - Reference Design for Servo and AC Inverter Drives
- Radio beacon-guided drones can detect toxic gases
- Studying the Road to Electric Motor Driving-5: Vector Addition and Subtraction
- 【Perf-V Review】+ Design of simple functional programs (1)
- Detailed explanation of ZigBee networking principle
- Recommend and get a gift! Courses that you can't help but watch twice or three times
- ATK-HC05 Bluetooth Serial Port Module