|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: Anyone actually using hardware timers?
Thanks for all the help everyone! I've created the timer, wrote my autonomous code and I should be up and running fully in Waterloo
. It'll require a bit a tweaking, but I'm up for the challenge . |
|
#2
|
||||
|
||||
|
Re: Anyone actually using hardware timers?
Team 11 uses a timer to count 14.5 seconds, we drop our keeper last half second of autonomous mode.. it worked great for us and we never had any problems with it
|
|
#3
|
||||
|
||||
|
Re: Anyone actually using hardware timers?
We implemented Timers into our code this year, and they are great. We set ours to fire off every millisecond. Unfortunately, we didn't have the time, but we plan to write a wrapper around one timer so we can schedule "events" to happen at certain time intervals. But so far, the timers have been proven to be extremely useful and you should definitely implement them.
Some tips, your interrupt routine should be fast. In fact, you should really only be really incrementing a number in it. Remember that since your timer is firing every X milliseconds, your number is being increased very rapidly. So use a big type like a long, or a long short. These will last your for days. Also, always, always, always, disable your timer interrupts before trying to access your "tick" variable. Bad things will happen if you don't. |
|
#4
|
||||
|
||||
|
Re: Anyone actually using hardware timers?
We have a scheduler based on the hardware timers. It allows scheduling of events at regular intervals, or single shot events at some time in the future.
It uses function pointers to allow the scheduler code to avoid needning to know what functions it may be calling. |
|
#5
|
||||
|
||||
|
Re: Anyone actually using hardware timers?
Quote:
|
|
#6
|
||||
|
||||
|
Re: Anyone actually using hardware timers?
Anything that needs to be called on a regular basis. For example, a regular sensor reading that is faster than the 26ms loop, but not "as fast as possible".
|
|
#7
|
||||
|
||||
|
Re: Anyone actually using hardware timers?
It seems like timers are a problem for a lot of teams so I posted ours this morning on this thread in the wrong place... I didn't see the rest of the thread or that the issue was already solved.
http://www.chiefdelphi.com/forums/sh...d.php?p=605834 It sounds like you have taken a similar approach with event timers that call routines when they time out. After all when all your other sensors have failed or you should still at least have timers! The example shows one way to estimate processor loading which also seems to come up a lot. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Are you actually using bumpers? | Chriszuma | Technical Discussion | 28 | 16-02-2006 18:41 |
| Using Timers | psquared | Programming | 9 | 30-01-2006 10:29 |
| IS ANYONE USING PNUEMATICS | archiver | 2001 | 14 | 24-06-2002 00:18 |
| Does anyone know what actually happened...? | Adam Y. | Regional Competitions | 7 | 30-03-2002 01:48 |
| Does anyone actually plan on playing rough? | Joe Menassa | General Forum | 10 | 10-02-2002 05:09 |