51 microcontroller-STC89C52 series learning Part 3: Interrupt learning

Publisher:Jinyu521Latest update time:2022-11-04 Source: csdn Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Eight interrupt request sources:

1. External interrupt 0

2. External interrupt 1

3. External interrupt 2

4. External interrupt 3

5. Timer 0 interrupt

6. Timer 1 interrupt

7. Timer 2 interrupt

8. Serial port interruption


All interrupts have four interrupt priority levels:

Priority 0: 0,0 (lowest)

Priority 1: 0,1

Priority 2: 1,0

Priority 3: 1,1 (highest)

Interrupt triggering method:

External interrupts 0, 1, 2, and 3 can be triggered by either low level or falling edge.

Timer interrupt 0, 1: overflow

Serial port interrupt: sending or receiving completed


C language programming, the interrupt query sequence number is the interrupt number:

void Int0_ISR(void) interrupt 0;

void timer0_ISR(void) interrupt 1;

void Int1_ISR(void) interrupt 2;

void timer1_ISR(void) interrupt 3;

void uart_ISR(void) interrupt 4;

void timer2_ISR(void) interrupt 5;

void Int2_ISR(void) interrupt 6;

void Int3_ISR(void) interrupt 7;

Interrupt register:

image.png

Reference address:51 microcontroller-STC89C52 series learning Part 3: Interrupt learning

Previous article:STC89C52 microcontroller experiment 1-light up a light-emitting diode
Next article:Summary of problems with STC89C52 driving SH1106 chip to light up OLED

Recommended ReadingLatest update time:2024-11-16 12:50

51 single chip microcomputer STC89C52 matrix keyboard scanning method detection
Program source code /*-----------------------Include header file area-------------------------*/ #include reg52.h   //MCU header file  /*-----------------------Data type definition area-----------------------*/ typedef unsigned char u8; //define type unsigned char alias u8 typedef unsigned int u16; //define type u
[Microcontroller]
51 single chip microcomputer STC89C52 matrix keyboard scanning method detection
Control stepper motor based on stc89c52 microcontroller
The 51 microcontroller is an entry-level development board for many microcontroller beginners. Today I will make a stc89c52 board based on the 51 core to control the stepper motor, which can realize the forward and reverse rotation, acceleration and deceleration of the stepper motor. In addition, the Ds18b20 module th
[Microcontroller]
Control stepper motor based on stc89c52 microcontroller
Temperature-measurable electronic calendar based on STC89C52 single-chip microcomputer
     With the development of science and technology, electronic perpetual calendars are becoming more and more common in life, and their functions are becoming more and more. According to people's daily basic needs, an electronic perpetual calendar is designed, which can realize functions such as temperature measureme
[Microcontroller]
Temperature-measurable electronic calendar based on STC89C52 single-chip microcomputer
51 single chip microcomputer (STC89C52RC) lcd1602 experiment summary
  LCD1602 is a liquid crystal display module with its own controller, which can display two lines of dot matrix data. Please google its pin parameters.      Phenomena encountered during actual use:   The black block on the first line and the blank on the second line are the signs that the 1602 itself has successfull
[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号