Key points of 89C51 microcontroller interrupt knowledge

Publisher:740322lwjLatest update time:2023-09-01 Source: elecfansKeywords:89C51 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

(The picture shows the 89C51 pin diagram)


1. There are 5 interrupt sources in the 89C51 microcontroller: two external interrupts, two timer/counter interrupts (overflow), and one serial port interrupt.

2. There are two different types of interrupts in the microcontroller interrupt system: one is called non-maskable interrupt, which cannot be disabled by the user through software; the other is called masked interrupt, which is the type described in this article.


2. Control words

1. External interrupt. Pins 12 and 13 (P3.2, P3.3) of the microcontroller are introduced and named INT0 and INT1. The above TCON register is used to control external interrupts.

IT0: Trigger mode of INT0. 0 means low level trigger; 1 means negative transition trigger.

IE0: This bit is set to 1 when an external interrupt enters. Automatically cleared to 0 after CPU responds.

2. Internal interrupt. TCON register, described in Timer.

3. The serial port is interrupted.

4. Interrupt enable register

Interrupt enable register








EA

X

ET2

ES

ET1

EX1

ET0

EX0

EA: master switch

ET2: Timer/counter 2 control bit, supported by 89C52.

Others: timer/counter 0, 1 and external interrupt 0, 1 control bits.

5. Interrupt entry address

² External interrupt 0 (INT0): 0003H

² Timer 0 (T0): 000BH

² External interrupt 1 (INT1): 0013H

² Timer 1 (T1): 001BH

² Serial port interrupt: 0023H


Keywords:89C51 Reference address:Key points of 89C51 microcontroller interrupt knowledge

Previous article:Design and production of clock circuit based on 89C51
Next article:Design of stepper motor control system using 89C51 microcontroller

Recommended ReadingLatest update time:2024-11-15 08:13

A simple alarm system based on 89C51
#include "reg52.h" #define   uchar unsigned char #define   uint  unsigned int sbit light = P1^0 sbit loud = P1^7; sbit alarm = P2^0; bit alarm_flag,flag_dec,flag_change; uint t0_count = 1; uint t0_set,second; void delay_1ms(unsigned int count) //1MS的延时×count {  unsigned int i,j;  for(i=0;i count;i++)  for(j=0;j 120
[Microcontroller]
A simple alarm system based on 89C51
Robotic arm intelligent grabbing system based on 89C51 microcontroller
Abstract: In the process of agricultural development, fruit picking is an extremely labor-intensive task. In order to reduce labor costs in the agricultural production process, applying artificial intelligence to the agricultural field will be an effective means. An intelligent grasping system is designed based on the
[Microcontroller]
Robotic arm intelligent grabbing system based on 89C51 microcontroller
89c51 assembly serial port receiving data
              ORG 00H START:               MOV    SCON,#50H            //Serial port mode 1, allow to receive               MOV    TMOD,#20H               MOV    TH1, #0F3H            //Baud rate is 2400B/s               MOV    TL1, #0F3H               SETB  TR1 WAIT:               JBC    RI,  DISPLAY  
[Microcontroller]
The latest version of KEIL5 does not have ATMEL (including 89C51 chip)
The latest version of KEIL5 does not put the 89C51 series chip in Atmel like the original KEIL4, but in Microchip:
[Microcontroller]
The latest version of KEIL5 does not have ATMEL (including 89C51 chip)
Programming Example of Data Acquisition System Composed of 89C51 Single-Chip Microcomputer and 1 ADC0809
In a data acquisition system composed of a 89C51 microcontroller and an ADC0809, the addresses of the eight input channels of ADC0809 are 7FF8H~7FFFH. Try to draw the relevant interface circuit diagram, and write a program to collect data from the eight channels in turn every minute, for a total of 50 samples. The sam
[Microcontroller]
Programming Example of Data Acquisition System Composed of 89C51 Single-Chip Microcomputer and 1 ADC0809
Latest Microcontroller Articles
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号