STM32 character sending function notes

Publisher:电子设计艺术家Latest update time:2017-10-30 Source: eefocusKeywords:stm32 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1. Sending function

void UART2_Put_Char(u8 data)

{

USART_SendData(USART2, (uint16_t) data);

  while(USART_GetFlagStatus(USART2, USART_FLAG_TC)!= SET)  

  delay_10us(1);

}

II. Description

1. The while loop function in the above code is to check whether the sending is completed. If not, it will delay;

2. That is to say, when sending a string, you must pay attention to whether the first character is sent when sending the second character. I didn't have this awareness before. Although there has been no problem, I will pay attention to it in the future.


Keywords:stm32 Reference address:STM32 character sending function notes

Previous article:stm32 online upgrade jump function
Next article:Introduction to stm32 external interrupt knowledge

Recommended ReadingLatest update time:2024-11-16 13:31

How to see the program occupying STM32 flash and SRAM from the Keil compilation result
Program Size: Code=114956 RO-data=20528 RW-data=808 ZI-data=702360   FromELF: creating hex file... "..\OBJ\MALLOC.axf" - 0 Error(s), 0 Warning(s). Build Time Elapsed:  00:00:05 From the compilation information above, we can see that the FLASH size occupied by our code is: 135484 bytes (114956 +20528), and the SRAM s
[Microcontroller]
STM32: Flash erase and read and write operations
Application platform: STM32F030F4P6 ST official library: STM32Cube_FW_F0_V1.9.0 background knowledge For most MCUs and microcontrollers (ARM, x86), the address space is in bytes, which means that one address is one byte. Flash memory has a characteristic that it can only write 0, not 1. So if there is data at the
[Microcontroller]
STM32 multiplexing and remapping (USART Remap)
Hello everyone, starting from today, I will share and discuss the problems I encountered in my work and my learning experience with you. Let me tell you about the port remapping of the STM32 microcontroller, because I use myself as an example. Here is the remapping of USART1 as an example.          Because I want a TF
[Microcontroller]
STM32 multiplexing and remapping (USART Remap)
STM32 DS18B20 code detailed study summary
DS18B20 is the most commonly used to learn a new development tool. The programs are similar. The main thing is to pay attention to the delay in the timing and the correct instructions. Record them here! ------------------The first part is--------ds18b20.h---------------------- #ifndef __DS18B20_H #define __DS18B20_H
[Microcontroller]
STM32 DS18B20 code detailed study summary
Create a C++ STM32 development project on MDK
        Recently, I was surprised to find that C++ can be used for embedded program development, even bare system program development. Before, when developing microcontrollers and programs on STM32, I only thought of C language and assembly language, and never considered that C++ language could be used for development.
[Microcontroller]
stm32-GPIO operation (library function)
It's rare to have time, so I want to write about the basics of stm32 recently. 8 ways of GPIO  1. Floating input GPIO_IN_FLOATING ——Floating input, can be used for KEY recognition, RX1        2. GPIO_IPU with pull-up input——IO internal pull-up resistor input        3. GPIO_IPD with pull-down input——IO internal pul
[Microcontroller]
STM32 learning notes: use of external interrupts
The status of interrupts in developing embedded systems is absolutely unquestionable. In the era of C51 microcontrollers, there were only 5 interrupts, including 2 external interrupts, 2 timer/counter interrupts and one serial port interrupt. However, in STM32, the number of interrupts has greatly increased, and the i
[Microcontroller]
STM32 motor control synchronous electrical angle test description
Preface When using the ST   FOC motor library , when using the Hall signal as the position signal, it is necessary to input the synchronous electrical angle data. This data is input according to the characteristics of the current motor in use, and the electrical angle will be synchronized every time the Hall signal ch
[Microcontroller]
STM32 motor control synchronous electrical angle test description
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号