Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/25/08 07:04
Read: times


 
#157717 - pls help....8051 external interrupts
i have used both the external interrupts ex0 and ex1 in the low level triggered mode. whenever either interrupt occurs, the LED on the output port is switched on, depending upon the input at pin P3.2.if that is high the led should switch on,when it is low it should switch off.

but the problem i am facing is, the led switches on fine, but it switches off only 6-7 out of 10 times, and the phenomenon is absolutely random,no fixed pattern.(switching on is perfect,switching off is erratic)

please help how to solve the problem of switching the led on and off at all interrupts(depending on the input value 'a' at that instant.)

void ex0_isr (void) interrupt 0
{ if(a==1) //a is input bit at P3.2

{ sfwd=1;//led outputs at P1.0 and P1.1 srev=0;

} else { sfwd=0; srev=0; }

}

void main()
{ P3=0xFF; P1=0x00;

while(1) {

EA=1; // Configure interrupt 0 for falling edge on /INT0 (P3.2)

EX0 = 1; // Enable EX0 Interrupt

EX1 = 1; }
}

List of 24 messages in thread
TopicAuthorDate
pls help....8051 external interrupts            01/01/70 00:00      
   show definition of "a" variable            01/01/70 00:00      
      definiton : sbit a=P3^2;            01/01/70 00:00      
   Need more information            01/01/70 00:00      
      the entire code            01/01/70 00:00      
         keyscan            01/01/70 00:00      
         How the LED are connected?            01/01/70 00:00      
         One tip            01/01/70 00:00      
   P3.2= iNT0            01/01/70 00:00      
      P3.2= INT0            01/01/70 00:00      
         pin 3.2            01/01/70 00:00      
            P3.2= INT0..1            01/01/70 00:00      
   Obvious Reason            01/01/70 00:00      
      time duration            01/01/70 00:00      
         mistake            01/01/70 00:00      
            ok thanks alot            01/01/70 00:00      
               ?            01/01/70 00:00      
   GATE0/1 ?            01/01/70 00:00      
      no            01/01/70 00:00      
      try            01/01/70 00:00      
         Debounce maybe?            01/01/70 00:00      
      Solution            01/01/70 00:00      
   interrupt flag bit clear            01/01/70 00:00      
      Detecting Both Edges - A very old trick            01/01/70 00:00      

Back to Subject List