Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

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::cool:
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top