This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Using External Interruts of 89C51

Hi ,
I'm want to use external interrupt 0 to generate clock on port P1.I am applying a clock on INT0 pin to generate External interrupt zero.I should get similar clock on P1 but nothing I'm getting .P1 remains high for all the time.
What is the problem with my code .

Keil Compiler C code:


#include <reg51.h>

void INT0_Initialize(void);
void INT1_Initialize(void);

static void INT0_ISR (void) interrupt 0 using 1
{
IE0=0; //disable int0
P1=0X00;
IE0=1; //enable int0

}

/*Main function*/

void main()
{
INT0_Initialize();
while(1)
{
P1=0xff;
}

}


void INT0_Initialize(void)
{
EA=0;
IE0=1;
IT0=1; //transition sensitive
EA=1;

}

0