Go to Post Most teachers are not in it for the income, But they are definitely in it for the outcome. - Bob Steele [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 04-02-2004, 00:21
roberthan roberthan is offline
Registered User
None #0702 (Bagel Bytes)
Team Role: Programmer
 
Join Date: Feb 2004
Location: Culver City
Posts: 15
roberthan is an unknown quantity at this point
Send a message via AIM to roberthan
Question How do you program timers?

Newbie here. I need some help on how to program timers for the Frc.
  #2   Spotlight this post!  
Unread 04-02-2004, 00:33
rdsideresistanc's Avatar
rdsideresistanc rdsideresistanc is offline
Registered User
AKA: Joel F
#0825 (SWVGS Maximus)
Team Role: Programmer
 
Join Date: Feb 2004
Location: nowhere
Posts: 11
rdsideresistanc is an unknown quantity at this point
Re: How do you program timers?

Quote:
Originally Posted by roberthan
Newbie here. I need some help on how to program timers for the Frc.
well, you know that the program loop is approximately 26.2ms, so just start a counter of the program loops and use a conditional to decide when to execute your commands.

so if we use 26ms as our reference,
10 sec = approx. .026s * 385 or 385 program loops....

If you need code examples just ask

Cheers,
Joel
  #3   Spotlight this post!  
Unread 04-02-2004, 00:46
roberthan roberthan is offline
Registered User
None #0702 (Bagel Bytes)
Team Role: Programmer
 
Join Date: Feb 2004
Location: Culver City
Posts: 15
roberthan is an unknown quantity at this point
Send a message via AIM to roberthan
Re: How do you program timers?

Thanks alot, I could use some examples and does it work for the autonomus mode?
  #4   Spotlight this post!  
Unread 04-02-2004, 00:51
FotoPlasma FotoPlasma is offline
\: |
no team
 
Join Date: Jul 2001
Rookie Year: 2001
Location: San Jose
Posts: 1,900
FotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond repute
Send a message via AIM to FotoPlasma
Re: How do you program timers?

Quote:
Originally Posted by rdsideresistanc
well, you know that the program loop is approximately 26.2ms, so just start a counter of the program loops and use a conditional to decide when to execute your commands.

so if we use 26ms as our reference,
10 sec = approx. .026s * 385 or 385 program loops....

If you need code examples just ask

Cheers,
Joel
NO! PLEASE! FOR THE LOVE OF ALL THAT IS THE NEW CONTROL SYSTEM! DON'T DO THAT!

Read MPLAB C18 C COMPILER LIBRARIES, section 2.9 to learn about Microchip's provided libraries for initializing, reading, and writing any of the four available timers on the PIC18F8520. Timer0 is used by IFI for some stuff, I believe, but other than that, you can interact with Timers 1-4, two of which are 16 bits wide, and the other two of which are 8 bits wide. If you have any questions, please feel free to ask.
__________________
I played hacky sack with Andy Baker.

2001-2004: Team 258, The Sea Dawgs
2005: Team 1693, The Robo Lobos
  #5   Spotlight this post!  
Unread 04-02-2004, 02:01
rdsideresistanc's Avatar
rdsideresistanc rdsideresistanc is offline
Registered User
AKA: Joel F
#0825 (SWVGS Maximus)
Team Role: Programmer
 
Join Date: Feb 2004
Location: nowhere
Posts: 11
rdsideresistanc is an unknown quantity at this point
Re: How do you program timers?

what exactly is the problem with this method?
  #6   Spotlight this post!  
Unread 04-02-2004, 02:18
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: How do you program timers?

Quote:
Originally Posted by roberthan
Newbie here. I need some help on how to program timers for the Frc.
There is example code here: http://www.kevin.org/frc/. The interrupt and timer template code is pretty well documented. The clock demonstration code shows how to setup a timer to create a very accurate clock.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
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
2-week FIRST summer program @ WPI ColleenShaver General Forum 20 31-05-2009 03:02
Fried program slots? Jeff Waegelin Programming 18 19-03-2003 18:08
Ahh! Program trick confusing! archiver 2001 9 24-06-2002 02:26
Credits for FIRST program. archiver 2000 6 24-06-2002 00:16
An invitation for HS Juniors archiver 2000 0 23-06-2002 22:51


All times are GMT -5. The time now is 00:01.

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