Go to Post My teams robots have been good, bad and ugly BUT they were all beautiful because they were there. - JohnBoucher [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 02-05-2007, 18:31
tseres's Avatar
tseres tseres is offline
obsessed with FIRST...
FRC #1565 (Think Tank Tech)
Team Role: Leadership
 
Join Date: Apr 2007
Rookie Year: 2007
Location: Cambridge, ON
Posts: 305
tseres is a glorious beacon of lighttseres is a glorious beacon of lighttseres is a glorious beacon of lighttseres is a glorious beacon of lighttseres is a glorious beacon of lighttseres is a glorious beacon of light
quick/stupid question

hey, how often does the user_routined_fast get called? i know the user_routines gets called every 28.6ms/38 x/minute...but i was wondering about the "fast"...
__________________


  #2   Spotlight this post!  
Unread 02-05-2007, 19:16
BenThompson BenThompson is offline
Registered User
FRC #0237 (Sie-H20-Bots (See-Hoe-Bots) [T.R.I.B.E.])
Team Role: Programmer
 
Join Date: Sep 2006
Rookie Year: 2007
Location: Watertown, CT
Posts: 18
BenThompson is on a distinguished road
Send a message via AIM to BenThompson
Re: quick/stupid question

If you're trying to use a timer for autonomous code, I think it updates every 26.8 seconds, just like the normal loop.
  #3   Spotlight this post!  
Unread 02-05-2007, 19:19
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,825
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: quick/stupid question

As fast as your code will execute.
The more streamlined your code is, the faster it will loop.
The time of each pass through will vary as different decisions are made, different branches are taken, more complex calculations or indexing is performed, interrupts occur.
Each slow-loop will of course slow down the fast loop during which it happens to occur, because of the extra processing.
What we talk of as the "slow-loop" is only a different branch decision made inside the fast loop.

The streamlined default code probably loops roughly on the order of magnitude of 100,000 times per second.
The clock is 10MHz, so no faster than that
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 02-05-2007 at 19:47.
  #4   Spotlight this post!  
Unread 02-05-2007, 19:23
The Lucas's Avatar
The Lucas The Lucas is offline
CaMOElot, it is a silly place
AKA: My First Name is really "The" (or Brian)
FRC #0365 (The Miracle Workerz); FRC#1495 (AGR); FRC#4342 (Demon)
Team Role: Mentor
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Dela-Where?
Posts: 1,564
The Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond repute
Send a message via AIM to The Lucas
Re: quick/stupid question

Quote:
Originally Posted by tseres View Post
hey, how often does the user_routined_fast get called?
It gets called every loop so the timing depends on the code it runs. Use timers if you want reliable timer info in there and don't update PWMs (Generate_PWMs() for PWMs 13-16) every loop.
__________________
Electrical & Programming Mentor ---Team #365 "The Miracle Workerz"
Programming Mentor ---Team #4342 "Demon Robotics"
Founding Mentor --- Team #1495 Avon Grove High School
2007 CMP Chairman's Award - Thanks to all MOE members (and others) past and present who made it a reality.
Robot Inspector
"I don't think I'm ever more ''aware'' than I am right after I burn my thumb with a soldering iron"

Last edited by The Lucas : 02-05-2007 at 19:27.
  #5   Spotlight this post!  
Unread 02-05-2007, 21:26
Qbranch Qbranch is offline
wow college goes fast.
AKA: Alex
FRC #1024 (Kil-A-Bytes)
Team Role: Alumni
 
Join Date: Apr 2006
Rookie Year: 2006
Location: Indianapolis
Posts: 1,174
Qbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond repute
Re: quick/stupid question

Quick Side Note: One nice thing about the user_routines_fast() function is that it makes a great %load monitor on the processor while you are writing your code if you have an oscilloscope. Just set one of the digital IO pins as an output, and then not (!) it every time you go through the user_routines_fast() loop. any blocks of timing discrepancies in the frequency that gets outputted are places where the processor was busy, so by using your oscilloscope you can figure how much %load your processor has... the more stable high frequency, the lower %load, the less stable frequency, the higher %load.

this measurement can be made most accurately with a digital storage oscilloscope (use the cursors) but can also be done on a normal oscilloscope with a ruler or just an eyeball.

if you need any help on this methodology, just let me know.

-q
__________________
Electrical Engineer Illini
1024 | Programmer '06, '07, '08 | Driver '08
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
A stupid question about a switch Adam Y. Electrical 3 14-08-2006 13:10
Stupid Variable question.... BillyJ Programming 3 20-02-2006 19:49
Stupid question but... Adam Y. Math and Science 6 16-02-2004 19:29
Really stupid question psychoCHIPMUNKK Kit & Additional Hardware 3 15-02-2004 00:26
stupid question x10 Tom Bottiglieri CD Forum Support 1 04-02-2004 22:40


All times are GMT -5. The time now is 23:45.

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