Disable periodic interrupts?
In an earlier post, I pondered how to produce 1-minute heartbeat pulses via interrupt. I managed to solve that problem, but it produced a common problem -- the 100 calls/sec interrupt screw up delicate timing loops that modulate an IR led. In my project, when motion is detected, I fire a digital camera via its IR remote trigger. The problem is that the IR led is modulated at either 38KHz for Nikon, or 32KHz for Canon, and although some slop is allowed in the timing, the amount of skew introduced by the interrupt calls is not tolerad. All this worked, btw, before I implemented the heartbeat pulse needed to keep one of the other Night Vision cameras awake.
So... the obvious question is if there is a way to disable periodic interrupts through code? I'm not familiar enough with the different registers to answer my own question. I do believe that if I used edge-detection interrupts that I could disable them, right? I can still build an outboard circuit that will produce a long period square wave that will cause an interrupt.
Any advice out there?
Larry
So... the obvious question is if there is a way to disable periodic interrupts through code? I'm not familiar enough with the different registers to answer my own question. I do believe that if I used edge-detection interrupts that I could disable them, right? I can still build an outboard circuit that will produce a long period square wave that will cause an interrupt.
Any advice out there?
Larry
Comments
www.parallax.com/Portals/0/Downloads/docs/cols/nv/vol8/col/nv154.pdf
Even though the camera·uses 38KHz or 32KHz on the IR signal it may be able to tolerate a wide frequency range.· The bandpass filters on IR receivers usually aren't very tight.· So the problem may be more in the disruption of the timing of the serial data by the interrupt.· Try minimizing the number of cycles in your interupt service routine and the IR timing may be OK with that.· If you currently send the heartbeat in your ISR, just set a flag instead and poll it outside of the ISR to determine when to send it.
If that doesn't work then you can disable interrupts by setting bit 6 in the OPTION register to 1.· Set it back to 0 after you are done sending the IR command.
Dave