Shop OBEX P1 Docs P2 Docs Learn Events
1 minute heartbeat - best way to generate — Parallax Forums

1 minute heartbeat - best way to generate

Larry MolterLarry Molter Posts: 28
edited 2009-10-18 21:43 in General Discussion
Project:
PIR motion-controlled (trap, trail, ghost) camera. Night vision camera will take videos when motion is detected. This part works.

Problem:
Camera goes to sleep after 5 minutes of no activity. I'd like to send a heartbeat (wakeup) pulse every minute to keep the camera awake. Since I haven't been programming the SX is a long while, and I never did really understand interrupts, I am at a loss on how to implement this. First thought is to use an external timer to generate constant 1 minute pulses. I could set on of the RB port pins to generate an interrupt on rising edge change. Second thought is to use RTCC somehow, but I don't really know how that works, either.

The external signal seems the simplest solution, even though it adds a component to my layout. But... I don't know how to configure the INTERRUPT statement. If I just code INTERRUPT without any other options, I get a compile error.

Any thoughts out there on trapping a long-period signal? I'm just spinning in circles.

Larry

Comments

  • Larry MolterLarry Molter Posts: 28
    edited 2009-10-18 21:38
    Forget the external timer. If I set the interrupt for 100 calls/sec, I can use counters to determine when 2 minutes have elapsed. The problem is the code won't compile. I'm getting a 'Overwriting same program counter location.' error. It's simple code, and I have the interrupt statement before any other program labels. Can't figure this out.

    Larry
  • Larry MolterLarry Molter Posts: 28
    edited 2009-10-18 21:43
    Never mind. Had to put the SUB declarations after the interrupt statement.
Sign In or Register to comment.