Hi all,
I'm using pic16f84 for some simple projects and next thing I want to do is a device that should have a TMR0 interrupt and an external interrupt on RB0. The timer is supposed to count, and interrupt, each second and on RB0 there will be fast external interrupts, about 20+ times a second. The device will count the interrupts on RB0 for a duration of 60 seconds.
The problem here is what happens when I get a timer interrupt and while proccessing that interrupt I get an external interrupt. Or the other way around. Normaly after the first interrupt, global interrupts will be disabled so the second interrupt won't be detected. The service routines for each interrupt will be about 20-30 instructions max.
My question is can I just reenable global interrupts immideately after I get the first interrupt, and then if a second interrupt occurs it will proccess the second interrupt and then return to complete the first interrupt. Or should I just put a faster osscilator and hope that this happens once in a 100 or so years.
Thanks.
I'm using pic16f84 for some simple projects and next thing I want to do is a device that should have a TMR0 interrupt and an external interrupt on RB0. The timer is supposed to count, and interrupt, each second and on RB0 there will be fast external interrupts, about 20+ times a second. The device will count the interrupts on RB0 for a duration of 60 seconds.
The problem here is what happens when I get a timer interrupt and while proccessing that interrupt I get an external interrupt. Or the other way around. Normaly after the first interrupt, global interrupts will be disabled so the second interrupt won't be detected. The service routines for each interrupt will be about 20-30 instructions max.
My question is can I just reenable global interrupts immideately after I get the first interrupt, and then if a second interrupt occurs it will proccess the second interrupt and then return to complete the first interrupt. Or should I just put a faster osscilator and hope that this happens once in a 100 or so years.
Thanks.