View Single Post
  #2   Spotlight this post!  
Unread 13-01-2008, 14:13
Kevin Sevcik's Avatar
Kevin Sevcik Kevin Sevcik is offline
(Insert witty comment here)
FRC #0057 (The Leopards)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Houston, Texas
Posts: 3,622
Kevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond repute
Send a message via AIM to Kevin Sevcik Send a message via Yahoo to Kevin Sevcik
Re: Tracking Elapsed Time

The PIC has several onboard hardware timers you could use for this, but I think just counting passes through the main loop would be much simpler for this application.

If you really want to use a hardware timer for this, look at this IFI whitepaper. A polled timer should be good enough for your purposes, so you'd setup the timer in your initialization, then you'd start it and pre-load the correct values when you saw a pulse. as long as the interrupt flag is 0, it hasn't timed out and you should ignore pulses.
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.

Lone Star Regional Troubleshooter