Shop OBEX P1 Docs P2 Docs Learn Events
Disable periodic interrupts? — Parallax Forums

Disable periodic interrupts?

Larry MolterLarry Molter Posts: 28
edited 2009-10-27 18:17 in General Discussion
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

Comments

  • JonnyMacJonnyMac Posts: 9,212
    edited 2009-10-26 21:01
    I created a time-lapse controller for my Sony camera using the SX; the shutter command is sent to the camera using 20-bit SIRCS. The interrupt takes care of LED modulation and timing. I would suggest that route instead of attempting to enable/disable interrupts; I think your program will be simpler.

    www.parallax.com/Portals/0/Downloads/docs/cols/nv/vol8/col/nv154.pdf
  • Dave HeinDave Hein Posts: 6,347
    edited 2009-10-27 18:17
    Larry,

    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
Sign In or Register to comment.