What is this AT89C51 program for?

Status
Not open for further replies.

raaxi_91

Newbie level 2
Joined
Sep 12, 2010
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,292
Can anyone plz explain this program???


#include <reg51.h>
sbit pin=P2^0;
void external0(void) interrupt 0
{
while(1)
{
pin=1;
delay();
delay();
delay();
pin=0;
delay();
if (P2^0==1)
break;
}
}
void main()
{
EA=1;
EX0=1;
IT0=0;
while(1)
{
pin=~pin;
delay();
}
}
 

Re: interrupt

the device datasheet and the header file are really your best shot.
 

Re: interrupt

its AT89C51......on C language
 

Re: interrupt

The program is very simple, did you write this code?

This code detects external hardware interrupt 0 the code in the function "void external0(void) interrupt 0" is an interrupt routine,
and
the code in the function main "void main()" is for setting up the interrupt

Asimov
 
Re: interrupt

The code deals with external interrupt0 of 8051(ATMEL 89C51). The code in void main() function are the settings required in order to set the external interrupt & the interrupt sub routine deals with what happens if an external interrupt occurs.
Regards,
Jerin.:wink:
 
Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…