Summary of doubts about STM32 serial communication

Publisher:自由思考Latest update time:2016-03-29 Source: eefocusKeywords:STM32 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
figure 1
As shown in the figure above, in line 1420, USART1_BASE is the base address of USART1. The function of (USART_TypeDef*) USART1_BASE is to convert USART1_BASE into a pointer of type USART_TypeDef*. The overall function of this statement is to convert USART1_BASE into a pointer of type USART_TypeDef*, and then name this pointer USART1. (Personal understanding: USART1 is a pointer to the USART_Typedef structure type, which is equivalent to USART1 being the address (first address) of a space. In this space, the members of this structure are arranged in sequence according to the order of the USART1 register address of STM32. The address (order) of each structure member corresponds to the corresponding register address on the STM32 hardware, and then the registers can be used at will through USART1.
 
 
As shown in Figure 2 and Figure 3, it is easy to see that the order of members in USART_TypeDef corresponds to the order of register addresses on the STM32 hardware.
figure 2
 

)
 
image 3
 
As shown in line 156 of Figure 4,  the USART_DR register can be accessed through the pointer USART1.
Figure 4


 
Keywords:STM32 Reference address:Summary of doubts about STM32 serial communication

Previous article:Notes on stm32 free control of io ports
Next article:ARM Assembly

Recommended ReadingLatest update time:2024-11-17 00:40

Comparative Analysis of STM32 and ARM Startup Code
From ARM to STM development, the development tools also changed from ADS to Keil. With the help of STM firmware library, the development efficiency is more efficient. For example, you don't need to care about the specific implementation of the startup code, you only need to focus on the specific application code, and
[Microcontroller]
STM32 SPI debugging HAL library debugging
uint8_t aTxBuffer __attribute__((at(0x20000200))) = {0xaa, 0x00, 0x00}; When there is no __attribute__((at(0x20000200)) above, the program will enter Hardfault because the program cannot read data from an odd address. This reason is very difficult to find, and I am speechless.   The API should not be used in the inter
[Microcontroller]
STM32 IO analog IIC I2C
#define I2C_Speed        100000 #define I2C_EE I2C1       #define uStatus 0x80 #define dTime 5     #define I2C_EE_GPIO    GPIOB #define I2C_EE_SCL         GPIO_Pin_5 #define I2C_EE_SDA GPIO_Pin_4 #define I2C_EE_CLK         RCC_APB1Periph_I2C1         #define SCL_H         GPIOB- BSRR = GPIO_Pin_5 #define SCL_L       
[Microcontroller]
STM32---IWDG watchdog and Debug
Today's problem: After adding a watchdog, the program can reach the breakpoint during online debugging, but it will continue to run automatically and cannot be stopped. Reason: Watchdog Main features of the independent watchdog (IWDG) 1. Free-running down counter 2. The clock is provided by an independent RC oscilla
[Microcontroller]
STM32 Notes: Using SysTick to measure program running time
This experiment is used to measure the running time of the delay function (as shown below) void Delay(__IO u32 nCount)   { for(; nCount != 0; nCount--); }  //SysTick.c #include "SysTick.h"   __IO u32 TimingDelay = 0;   void SysTick_Init(void) { /* SystemFrequency / 1000 1ms interrupt once * SystemFrequency / 1
[Microcontroller]
Using DMA to generate and capture square waves in STM32 microcontrollers
   1 Introduction to STM32 Microcontrollers   The STM32 series microcontrollers are highly integrated microcontrollers based on the Cortex-M3 core from ST. It sets a new benchmark in terms of performance, price, power consumption and real-time performance. It integrates the Cortex-M3 core, as well as a rich set of p
[Microcontroller]
Using DMA to generate and capture square waves in STM32 microcontrollers
STM32 TIM1 output pulse example
TIM module timer overflow & output comparison First of all, we must affirm the strength of ST company and admit that STM32 is indeed a very good Cortex-M3 core microcontroller. However, its manual is really incomprehensible, especially the TIM module, which is disorganized. After reading it for two days, I still don’t
[Microcontroller]
Voice guidance system based on STM32 control
Abstract: A sound guidance system based on STM32 control is designed. The system consists of a movable sound source S and three sound receivers A, B, and C. A slave STM32 microcontroller controls the wireless transmission module to send the sound guidance signal. The master microcontroller determines the start and s
[Microcontroller]
Voice guidance system based on STM32 control
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号