To toggle LEDs connected to two port pins (say P1.0 &P1.1) 5 times under the control of external interrupt (say External Interrupt 0)
Atmel 89C51 micro controller
8051 simulator win8051
Universal SP3 Programmer.
Software to load the code into Universal SP3 Programmer.
Computer System with Windows operating system and RS 232 Cable.
+5V D.C Power Supply
Write the assembly code in win8051 simulator , compile it and check for errors
Once the code is error free, run it and check the output.
After checking the code in the simulator, the code (in .hex format) was loaded into Atmel 89c51 microcontroller using Universal SP3 Programmer.
Now make the connections as shown in the circuit diagram.
After switching on the power supply, press the push button switch connected to P3.2(INT0) once and observe the toggling of both the LEDs connected to P1.0 & P1.1 by 5 times.
Repeat the step -5 once more and again observe the same output.
The external interrupt - 0 () is enabled. Whenever the switch connected to (P3.2) is pressed, an interrupt is generated and the program branches to the Interrupt Service Routine(ISR) located at 0003H. The ISR toggles the LED connected to P1.0 and P1.1 and returns to the main program.
The toggling frequency of the LEDs is measured in the CRO which was same as that of the delay loop time.
Two LEDs were toggled 5 times, each time when we press push buttion switch connected to P3.2 (INT0).
Fig 41.1 Circuit diagram of toggling LEDs experiment