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.

help needed in intrrupts for AT89C4051

Status
Not open for further replies.

vinash

Member level 2
Joined
Nov 3, 2005
Messages
45
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,999
Hi,
> I am new comer to the field of microcontrollers,now i am practising
> on how to use external interrupt. I am using an AT89C4051
> microcontroller. I have connected 2 leds. One Led is connected to P1_7
> and the other is connected to P3_2 (INT0 pin). The LED that is
> connected to P1_7 is always on and the led connected to P3_2 every
> 50ms. Could someone help me with the code.I have wriiten some code and
> it is of as follows (which does not use the interrupt ).I would be very
> grateful if someone were to help me in this. (As to how to use the
> interrupt). Thank you.
>
very sorry forgot to add the code. The code is of as follows:
#include<AT89x051.h>
void delay(void);
void main(void){

while(1){

P1_7=0;
P3_2=0;
delay();
P3_2=1;
delay();

}
}

void delay (void)
{
TMOD &=0xF0;
TMOD |=0x01;
ET0 =0;
TH0 =0x3C;
TL0 =0xB0;
TF0 =0;
TR0 =1;
while(TF0==0);
TR0=0;

}
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top