Port Multiplexing and Port remapping

Source: Internet
Author: User

Port Multiplexing is the focus, as long as the use of stm32 is used to peripherals, peripherals are shared with the Gpio pin (multiplexing), that is, some pins can be purely as input and output, but also as a certain function of peripheral (such as ADC, serial port and so on) pin port.

This is an advantage of stm32, which saves the number of pins.

Port multiplexing and remap pin correspondence can be queried on the chip manual, the Stm32 Mini board corresponds to the STM32F103RCT6.

?

?

Re-use specific steps

Multiplexing port initialization has several steps:
1) GPIO port clock Enable. To use to port multiplexing, of course, make the clock of the port available.
Rcc_apb2periphclockcmd (Rcc_apb2periph_gpioa, ENABLE); "This function has been touched in the LED section, in the stm32f10x_rcc.c file."
2) multiplexed peripheral clock Enable. For example, you want to reuse port PA9,PA10 as a serial port, so you have to enable the serial clock.
Rcc_apb2periphclockcmd (Rcc_apb2periph_usart1, ENABLE); "Also in stm32f10x_rcc.c this file, just judge the first difference in validity"


3) port mode configuration. When the IO multiplexing bit is built into the peripheral function pin, the GPIO port mode must be set, as
The mode of GPIO under the Multiplexing function is how to correspond, this can view the manual "STM32 Chinese Reference Manual V10"
P110 table "GPIO Configuration for 8.1.11 peripherals".

Port remapping with less, generally understand, mainly for the convenience of PCB cabling, some ports mapped to other ports.

Port Multiplexing and Port remapping

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.