Application of 51 MCU serial port mode 0

Publisher:二进制心灵Latest update time:2016-07-15 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
        I will not introduce the application of the microcontroller serial port in detail here. Here I will only describe how to use serial port mode 0. When you look at the application of the microcontroller serial port, you will know how to set the working mode of the serial port. In fact, if you really only use serial port mode 0, you don’t need to set any registers. You only need to send the data you want to send to SBUF.

like:

/***********************************
Function name: HC_595_input()
Function description: Send data from HC595 to storage register
Parameter description: dat -> data input to 595
Return value: None
***********************************/
void HC_595_input(unsigned char dat)
{
        SBUF = dat; // Send data, low byte first

         while(!TI) // Waiting for sending to complete
         {
                    ;
         }

         TI = 0; // Allow next sending
}

Reference address:Application of 51 MCU serial port mode 0

Previous article:Using Keil C51 to develop serial port
Next article:Homemade 51 MCU common header files (interrupt)

Recommended ReadingLatest update time:2024-11-16 20:48

51 single chip microcomputer reads out the two-digit BCD dial program
Question: I made a small design using AT89C2051, where P1 is connected to a two-digit BCD dip switch, P3.2 is connected to a switch, and P3.3 is connected to a relay. The specific connection method of the two-digit BCD dip switch is that the common end is connected to P1.1 and P1.2, and 8421 is connected to P1.3~P1.6
[Microcontroller]
MCS-51 series microcontroller control register TCON (88H)
   The high 4 bits of the special function register TCON are the timer operation control bit and overflow flag bit, and the low 4 bits are the external interrupt trigger mode control bit and latch external interrupt request source. The TCON format is as follows: D7 D6 D5 D4 D3 D2 D1 D0  TF1 TR1 TF0 TR0 IE1 IT1 IE0 IT0
[Microcontroller]
51 microcontroller learning: LED flashing experiment
Experiment name: LED flashing experiment Wiring instructions: Experimental phenomenon: The D1 indicator light of the "LED module" flashes after downloading the program Notes: *********************** *************************************************** ****************/ #include "reg52.h" typedef unsigned int u16; //Red
[Microcontroller]
51 MCU's printf and other format output functions
When using the printf function and sprintf function on the 51 microcontroller, pay attention to the following points: 1. The format character of unsigned 16-bit data is %d or %u. Do not add the letter "l", otherwise an error will occur. 2. The format character of 32-bit data must be preceded by the letter "l", other
[Microcontroller]
Why does the MCS-51 microcontroller need to interrupt the system expansion? How does the timer serve as an external interrupt source?
Why does the MCS-51 microcontroller need to use interrupt system expansion? Answer: Although MCS-51 has provided two external interrupt request input terminals INT0 and INT1, when there is still a large demand for external interrupt request sources, interrupt system expansion is required. When the timer is used as
[Microcontroller]
Design of 8 LED running lights based on 51 single chip microcomputer
This design aims to realize the design of 8 LED flowing water lights. Schematic diagram: Reference Code: #include reg52.h #include intrins.h #define uint unsigned int  uint temp;   void Delay500ms() //Delay 0.5 seconds function //@11.0592MHz { unsigned char i, j, k;   _nop_(); i = 4; j = 129; k = 119; do
[Microcontroller]
Design of 8 LED running lights based on 51 single chip microcomputer
51 MCU executes independent key scanning program in the timer interrupt function
1. Use proteus to draw a simple circuit diagram for subsequent simulation 2. Programming /******************************************************************************************************************** ---- @Project: Independent-KEY ---- @File: main.c ---- @Edit: ZHQ ---- @Version: V1.0 ---- @Creatio
[Microcontroller]
51 MCU executes independent key scanning program in the timer interrupt function
Design of digital optical power meter based on STC89C516 microcontroller
0 Introduction The application of single-chip microcomputer in sensor control technology makes industrial production more modernized, and in the communication process, the control of sensors is particularly important. The detection and judgment of communication quality requires better data processing. The d
[Microcontroller]
Design of digital optical power meter based on STC89C516 microcontroller
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号