Description:
We have already discussed about the Interrupt function of 8051 microcontroller in our page - Introduction to 8051. You can still go back revise before starting working on this as it is one of the most important topic of 8-bit microcontroller and you should know deep concept of interrupt before start coding.Interrupt is a sub routine program which jumps the microcontroller to process the sub program, leaving the main program whenever interrupt is called. You can say it is like diverting the path of someone due to an obstacle. You will find the implementation of interrupt program in most of the embedded project while working. So, you need to clear the concept on interrupts and all its module like why we need it and how interrupt works
Code:
#include"REG52.h" int count=0; void intrr() interrupt 1 { TF0=0; TH0=0x77; TL0=0x47; if(count!=255) count++; else count=0; } void main() { TMOD=0x01; IE=0x82; TH0=0x77; TL0=0x47; TR0=1; while(1) { P2=count; } }
Comments
Post a Comment