Go to Post mama always said better safe than sorry - Brandon Holley [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 20-01-2006, 21:14
Joohoo's Avatar
Joohoo Joohoo is offline
Registered User
FRC #0340 (G.R.R.)
Team Role: Mentor
 
Join Date: Jun 2005
Rookie Year: 2005
Location: Rochester
Posts: 241
Joohoo is just really niceJoohoo is just really niceJoohoo is just really niceJoohoo is just really niceJoohoo is just really nice
Send a message via AIM to Joohoo Send a message via Yahoo to Joohoo
System time

Right now I have worked a long time on customizing a timer found in Kevin's interrupt code to run indefinatly. I was wondering if anyone was able to get a system timer that runs fast enough to use for speed but slow enough so I can get and it doesn't get too big to handle?
/*I used a 1:1 pre-scalar for an interrupt and the controller freaked out, overflowing a 16 bit value every 26.6 ms*/

Last edited by Joohoo : 20-01-2006 at 21:17.
  #2   Spotlight this post!  
Unread 20-01-2006, 22:48
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,078
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: System time

Use a 32 bit timer :-)

In other words, when your 16 bit timer gets to big, add it to a 32 bit variable and reset it.

If 16 bits overflows in 26.6ms, 17 bits will overflow in 53.2ms, and so on.

32 bits shouldn't overflow for 29 minutes.
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
Students, what is your fantasy education system? Ken Leung General Forum 28 04-01-2006 09:20
PID control loops - closed loop feedback KenWittlief Technical Discussion 56 26-04-2004 21:27
How long should production time be??? archiver 1999 4 23-06-2002 23:16
need help with time zone! Ken Leung General Forum 6 25-06-2001 12:44


All times are GMT -5. The time now is 03: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