博文

目前显示的是标签为“STM32F105”的博文

STM32F105 Serial Port Configuration Method

图片
 The STM32F105 microcontroller features up to 5 USART peripherals (USART1–USART5) for serial communication. These USART peripherals can be configured for both asynchronous (UART) and synchronous communication. Below is a step-by-step guide to configure the serial ports on the STM32F105: 1. Clock Configuration The USART peripherals are connected to APB1 and APB2 buses: USART1 : Connected to APB2 bus (max clock: 72 MHz) USART2–USART5 : Connected to APB1 bus (max clock: 36 MHz) Steps to Enable the Clock : Enable the peripheral clock for USART and GPIO ports in the RCC (Reset and Clock Control) register. c RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1 | RCC_APB2Periph_GPIOA, ENABLE); // Enable clock for USART1 and GPIOA RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART2, ENABLE); // Enable clock for USART2 2. GPIO Configuration Each USART peripheral has dedicated Tx (Transmit) and Rx (Receive) pins, which need to be configured as Alternate Function Push-Pull ...