Go to Post Ask the right questions and you can get the right answers. - Chief Hedgehog [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 13-02-2005, 10:39
MarkVH's Avatar
MarkVH MarkVH is offline
Registered User
AKA: Mark VanHaitsma
FRC #0288 (RoboDawgs)
Team Role: College Student
 
Join Date: Dec 2004
Rookie Year: 2003
Location: Grandville
Posts: 30
MarkVH is on a distinguished road
Timers

How do you use timers and what is the smallest amount of time that they can measure?
  #2   Spotlight this post!  
Unread 13-02-2005, 11:30
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Timers

Quote:
Originally Posted by MarkVH
How do you use timers and what is the smallest amount of time that they can measure?
There are three different ways I can think of immediately to use timers. The appropriate answer depends on what you want to use them for.

If you want to make something happen at a specific time, and especially if you want to make something repeat every so often, you probably should consider using timer interrupts.

If you want to find out how long something takes, you can just read the value of the timer at the beginning and the end of the interval and subtract the values. If the time might be longer than the timer can deal with, you should account for overflows, which can be done either by watching the timer constantly or by using timer interrutps.

You can also reset the timer to zero at the beginning of the interval, and read the time directly at the end (again accounting for overflows if necessary).

I think the maximum rate the timers can run at is 40 MHz.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Timers ? Gal Longin Programming 5 12-02-2005 06:15
Securing interrupt-driven timers Orborde Programming 3 10-02-2005 15:52
Library timers Ryan M. Programming 3 13-02-2004 09:02
How do you program timers? roberthan Programming 5 04-02-2004 02:18
What type of timers for autonomous? thoughtful Programming 1 09-12-2003 02:28


All times are GMT -5. The time now is 09:26.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi