Hi, is it advisable to use an interrupt to turn on another interrupt?
I'm trying to use 2 CCP (capture mode) interrupt, CCP1 and CCP2 to measure the time difference between 2 pulses on the PIC16f887 microcontroller. I'm trying to use CCP1 to turn on the interrupt for CCP2. Is this method advisable or will it cause error in the ISR?
with "turn on another interrupt" you mean "to enable another interrupt"...
But ( I may be mistaken) the capture registers get updated regardless of interrupt_enable.
The interrupt - when enabled - just causes the ISR to run.
In detail it depends on your signals timing .. and on your idea.
Thats a lot of potential stack push inside first interrupt which will limit min pulse width
measurement. Why not first edge set a flag, return and then turn on second ISR
outside first interrupt.