Notes 03 of "8051 MCU C Language Innovation Tutorial"

Publisher:huanranLatest update time:2024-07-29 Source: cnblogs Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

GPIO

Timers, Counters and Interrupts

Definition and configuration of timer:

The counting register is composed of TH high 8 bits and TL low 8 bits-----------》T/C0 is TH0 and TL0--------------》T/C1 is TH1 and TL1

M1

M0

How it works

Functional Description

0

0

Method 0

13-bit timer/counter

0

1

Method 1

16-bit timer/counter

1

0

Method 2

Auto-reload 8-bit timer/counter

1

1

Method 3

T0 is divided into two 8-bit independent counters, T1 has no mode 3

Timer calculation initial value:

Serial Port:


Reference address:Notes 03 of "8051 MCU C Language Innovation Tutorial"

Previous article:CORE8051-APB bus
Next article:51 MCU internal EEPROM read and write

Recommended ReadingLatest update time:2024-11-16 09:23

Common local communication methods for 8051/2 microcontrollers: UART, RS485, I2C, SPI, I2C E2PROM 3
1. Description MCU IO simulation, using E2PROM 24C02C  1. Start signal holding time Thd:sta 4us 2. Start signal establishment time Tsu:sta 4.7us 3. SCL low level duration Tlow 4.7us 4. SCL high level duration Thigh 4us 5. Stop signal establishment time Tsu:sta 4us 2. Demonstration 3. Code /** * 805
[Microcontroller]
Common local communication methods for 8051/2 microcontrollers: UART, RS485, I2C, SPI, I2C E2PROM 3
Problems in Keil application
There are several common warnings in Keil. Of course, compared with errors, the degree of warning is not as serious as the error. Sometimes, if you ignore it, unexpected errors will occur. Let's take a look at several common errors and analyze the reasons for them. 1. Warning 280:’i’:unreferenced local vari
[Microcontroller]
Sorting out the various cycles in a microcontroller
Microcontroller clock cycle Clock period: The clock cycle is also called the oscillation cycle or the crystal oscillator cycle, which is the number of pulses emitted by the crystal oscillator per unit time. It is usually generated by an external oscillator. For example, 12MHZ=12×10 to the 6th power, that is, 12,000,
[Microcontroller]
Sorting out the various cycles in a microcontroller
C8051F Simulation Debugging Quick Start (Keil)
Note: Before downloading the program, you must first install the Keil software and the corresponding Silicon IDE driver software Keil installation:   Please go to Keil official website:  https://www.keil.com/c51/demo/eval/c51.htm to download and install. · Keil μVision Driver installation:   Please go to the Silabs of
[Microcontroller]
C8051F Simulation Debugging Quick Start (Keil)
8051 MCU Tutorial Lesson 11: Arithmetic Operation Instructions
Addition instruction without carry bit ADDA,#DATA;例:ADDA,#10H ADDA,direct;例:ADDA,10H ADDA,Rn;To: ADDA,R7 ADDA,@Ri;例:ADDA,@R0 Purpose: Add the value in A to the value after it, and the final result is returned to A. Example: MOVA, #30H ADDA,#10H After executing this instruction, the value in A is 40H.
[Microcontroller]
8051 MCU baud rate calculation formula (with C language routine)
The 8051 microcontroller uses timer 1 working in mode 2 as the serial port baud rate generator. Its baud rate = (2smod /32) × (timer T1 overflow rate), where smod is PCON 7 , indicating whether the baud rate is doubled, and Fsoc is the system crystal size.  In the baud rate formula: T1 overflow rate = the inverse of
[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号