Gast
#749251
Hallo,
Habe zwei externe Interrupt zu bedienen (INT0 und INT1)
Irgendwie verhaltesn sich diese selbst in der Simulation total
unterschiedlich. Mit dem INT0 springe ich bei mit P3.2 ohne Probleme in
die ISR und beim INT1 komm ich einfach nicht hinein.
Hier mein Code...
#include <REG52.H>
unsigned char ex0_isr_counter = 0;
int i;
sbit P1_6 = P1^6;
sbit P1_5 = P1^5;
void ex1_isr (void) interrupt 1
{
ex0_isr_counter++; // Increment the count
P1_6=0;
for(i=0;i<10000;i++) {}
P1_6=1;
for(i=0;i<10000;i++) {}
}
void ex0_isr (void) interrupt 0
{
ex0_isr_counter++; // Increment the count
P1_5=0;
for(i=0;i<10000;i++) {}
P1_5=1;
for(i=0;i<10000;i++) {}
}
void main (void)
{
IT0 = 1;
EX0 = 1;
IT1 = 1; // Configure interrupt 0 for falling edge on /INT0 (P3.2)
EX1 = 1; // Enable EX0 Interrupt
EA = 1; // Enable Global Interrupt Flag
while (1)
{
}
}
Bitte um Hilfe
lg josef