MCU 74LS138 extended interrupt

Publisher:大伊山人Latest update time:2022-01-13 Source: eefocusKeywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Hardware Connection:

Code:


#include

#include

#define uchar unsigned char

#define uint unsigned int


sbit LED = P1^0;

void EX_INT0() interrupt 0

{

  fly bi = P2 & 0x07;

P0 = _cror_(0x7f,bi);

}


void main()

{

  uint i;

IE  = 0x81;

IT0 = 0;

while(1)

{

LED = !LED;

for(i=0;i<30000;i++);

if(INT0 == 1)

P0 = 0xff;

}


Keywords:MCU Reference address:MCU 74LS138 extended interrupt

Previous article:Introduction to single chip microcomputer - flashing LED light
Next article:74HC595 serial-in parallel-out chip application

Recommended ReadingLatest update time:2024-11-15 07:26

Design of intelligent cleaning and nursing machine using PIC microcontroller
Introduction: This article uses the PIC18F87K22 microcontroller as the main controller of the nursing machine and the Siemens GSM module TC35i to send the alarm information of the nursing machine to the mobile phone of the designated bedridden patient's guardian in real time in the form of "mobile phone text messages"
[Microcontroller]
Design of intelligent cleaning and nursing machine using PIC microcontroller
Some re-addresses of 51 MCU ROM
Some re-addresses of 51 MCU ROM   0000H    MCU entry address after reset                            (3 bytes in total) 00003H  External interrupt 0 interrupt service entry address                  (  8 bytes in total) 000BH    Timer/Counter 0 overflow interrupt service entry address    (8 bytes in total) 0013H
[Microcontroller]
The single chip microcomputer lights up the digital tube in static mode
The circuit only drives one digital tube, which is a common cathode tube, with the common end grounded, and the segment tube directly connected to the P2 port of the microcontroller. The microcontroller used is AT89C52. The circuit diagram is shown below: Through yesterday’s explanation of digital tubes, we know
[Microcontroller]
The single chip microcomputer lights up the digital tube in static mode
How to avoid detours in the anti-interference design of single-chip microcomputer
  Friends who have worked on products all have experienced this: a design may seem simple, and the hardware design and code writing can be completed quickly, but there are more or less unexpected events during the debugging process. These are all manifestations of insufficient anti-interference capabilities.   Let’s
[Microcontroller]
51 MCU ordinary timer clock reference program
/* 1. Press the button to adjust the current time 2. Press the button to adjust the timing time *8-digit digital tube displays time in the format of 12-08-00, indicating 12:08:00 S1 is used for hour plus 1 operation   S2 is used for hour minus 1 operation S3 is used for minute plus 1 operation S4 is used for m
[Microcontroller]
Using LED to realize the running light--Single-chip microcomputer simulation experiment
Assignment title: Implement a marquee in assembly language Assignment requirements: Use light-emitting diodes to achieve a marquee effect. Eight light-emitting diodes run from top to bottom twice and flash twice.                   Then run from bottom to top twice and dodge twice. Program flow chart: Appl
[Microcontroller]
Summary of MCU interrupts
1. TMOD: Timer counter mode register M1M0: There are four working modes for the timer/counter, which are controlled by M1M0. 2 bits are exactly four combinations. 1. Working mode 1  Working mode 1 is a 16-bit timer/counter mode. Set M1M0 to 01. Other characteristics are the same as working mode 0. Worki
[Microcontroller]
Design of real-time temperature monitoring system based on single-chip microcomputer and computer serial port
    Temperature monitoring systems are widely used in agriculture, industry and life. However, with the expansion of the monitoring area, the increase of monitoring points and the emergence of new application requirements such as intelligent control processing, traditional temperature control systems have gradually bec
[Microcontroller]
Design of real-time temperature monitoring system based on single-chip microcomputer and computer serial port
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号