Tutorial Microcontroller MCS-51 ATMEL ISP

Microcontroller Kits
Programmer and Target 89s51

Simple Mikrokontroller 89s51 Trainer


Standart
Mikrokontroller 89s51 Trainer


Super Mikrokontroller Trainer 89s51

+

All Item Include

Programmer
Via USB

 

 

BACK

5.3. External Interrupt

 

In this experiment External Interrupt 0 is enabled and set up to respond to 1-to-0 transitions. When an Interrupt is received, Buzzer is on, and buzzer is off when no interrupt recived.

Microcontroller External Interrupt

Figure 5.3.1. External Interrupt Application

 

Step 1st
Build the circuit as shown in figure 5.3.1. As you seen on figure 5.3.1. P0 is connected to buzzer. Remember, that all we want to do with this lesson is get buzzer on when interrupt is received.

Step 2nd
In this step, you must tipe the assembly program to make your Interrupt get action, we assume that you have already known the editor, we used MIDE-51 to edit the program. ( Download File : exp53.zip )

          Org 0000h
Ljmp Start
Org 0003h
Ljmp ExtInterrupt
Start:call InitEkstInterrupt
;
Loop: setb P0.0
Sjmp Loop;
;
ExtInterrupt:
clr P0.0
reti
;
InitEkstInterrupt:
Setb IT0 ;negatif transition
Setb EX0 ;External Interrupt Enable
Setb EA ;Master Interrupt Enable
ret
;
End

Step 3rd
Safe your assembly program above, and name it with int4.asm (for example) Compile the program that you have been save by using MIDE-51, see the software instruction.

Step 4th
Download your hex file ( int4.hex ) into the microcontroller by using Microcontroller ATMEL ISP software, see the instruction.After download this hex file you'll see the action of Interruption( of course if your cable connection and your program are corrected ).

 

Comments, questions and discussion about this topic

BACK