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

Interrupt Problem

A.E
Thank you so much for your generous help.

I have a wired problem with the following code when I was using emulator to debug them:

#include <reg52.h>
#include <absacc.h>


unsigned char Check;
sbit INTE_ON = P3^2;
void Turn_On ( );

void main()
{

EX0 = 1;
EA = 1;
for ( ; ; ) {
if ( Check >= 5 ) {
Turn_On ( );
Check = 0;
}
}
}

void Turn_On ( ){
TURN_ON = 1;
}

void Status ( ) interrupt 0{
Check++;
}

Why I can keep receiving interrupts when P3.2 was high?

Any one can find any clues about this?

Thank you in advance.

Parents Reply Children
No data