vinash
Member level 2

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;
}
> 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;
}