Re: Can I enable both TMR0 and RB change interrupts at the same time?
It's seems like I've put this post in a sector of the forum which does not suits most inadvertently.
Could the forum admin please move this thread to a section you deem most appropriate, say "Microcontrollers"?
My apologies.
---------- Post added at 02:32 ---------- Previous post was at 02:13 ----------
After a little rethinking of this issue. I'm reaching an understanding slightly different to what I used to have.
Yes, the 'single-threaded' nature of PIC16Fxxx (at the software side) is not changeable. And during the process of handling TMR0 interrupt, such interrupt as either RB change or CCP is not able to be handled. But this does not necessarily mean, at least for this case, both TMR0 and CCP(Capture) interrupt cannot be adequately processed.
The reason here is, even though while handling TMR0 the interrupt response mechanism will be blocked for a while, the Capture even can still be recorded with CCPIF beening set and timer register being stored, by hardware at _real-time_. As soon as the ISR is available again, as the CCPIF is already set, another CCP interrupt will immediately be triggered and the stored time register values retrieved and processed. This will make on one hand the TMR0 event be processed at real-time and on the other hand the CCP event also handled in time, as long as the time period of TMR0 ISR does not span longer than the shortest interval of any contiguous CCP triggers.
I hope I've made it clear, and look forward to any comments/thoughts.