Go to Post My calculations indicate that the game will involve pouring large areas of concrete and waiting for it to dry. Field reset should be interesting. - DampRobot [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 05-02-2004, 22:33
deltacoder1020's Avatar
deltacoder1020 deltacoder1020 is offline
Computer Guy
AKA: Dav
#1020 (The Indiana Prank Monkeys)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Muncie, Indiana
Posts: 340
deltacoder1020 has a spectacular aura aboutdeltacoder1020 has a spectacular aura about
Send a message via AIM to deltacoder1020
Re: Interrupt timer, executing code asap?

technically, even fork() only does one thing at a time it just interlaces the needs of multiple things, so that part of one function executes, then part of the next, et cetera.

solution? no function in your bot code should last 5 seconds
__________________
Team 1020, the Indiana Prank Monkeys (www.team1020.org)
  #2   Spotlight this post!  
Unread 05-02-2004, 22:41
KevinB's Avatar
KevinB KevinB is offline
Registered User
AKA: Alum
no team
Team Role: Alumni
 
Join Date: Dec 2002
Rookie Year: 2001
Location: AL
Posts: 188
KevinB will become famous soon enoughKevinB will become famous soon enough
Send a message via ICQ to KevinB
Re: Interrupt timer, executing code asap?

Quote:
Originally Posted by deltacoder1020
solution? no function in your bot code should last 5 seconds
No function in your bot code should last > 26.2 milliseconds.
  #3   Spotlight this post!  
Unread 05-02-2004, 23:42
deltacoder1020's Avatar
deltacoder1020 deltacoder1020 is offline
Computer Guy
AKA: Dav
#1020 (The Indiana Prank Monkeys)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Muncie, Indiana
Posts: 340
deltacoder1020 has a spectacular aura aboutdeltacoder1020 has a spectacular aura about
Send a message via AIM to deltacoder1020
Re: Interrupt timer, executing code asap?

that too heck, no individual function should last anywhere near 26ms
__________________
Team 1020, the Indiana Prank Monkeys (www.team1020.org)
  #4   Spotlight this post!  
Unread 06-02-2004, 15:22
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: Interrupt timer, executing code asap?

except sine Well, if you forgot the lookup table!
  #5   Spotlight this post!  
Unread 07-02-2004, 00:10
deltacoder1020's Avatar
deltacoder1020 deltacoder1020 is offline
Computer Guy
AKA: Dav
#1020 (The Indiana Prank Monkeys)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Muncie, Indiana
Posts: 340
deltacoder1020 has a spectacular aura aboutdeltacoder1020 has a spectacular aura about
Send a message via AIM to deltacoder1020
Re: Interrupt timer, executing code asap?

wouldn't be that useful a sine function if it took near 26ms - remember, you have do do something with it too
__________________
Team 1020, the Indiana Prank Monkeys (www.team1020.org)
  #6   Spotlight this post!  
Unread 07-03-2004, 00:07
Daniel Daniel is offline
Daniel Katanski
#0240
Team Role: Mentor
 
Join Date: Feb 2004
Location: Monroe, MI
Posts: 32
Daniel is on a distinguished road
Re: Interrupt timer, executing code asap?

Real time programming requires the use of a "state machine", which is a programming technique where one state starts the motors, for example, and the second state monitors for a certain amount of time to pass before proceeding to the third state.

The second state can be entered multiple times without causing any problems. So the second state checks the time, then reutrns to the code where the data packets can be handled. Then the same fuction is called to execute the seconds state which looks at the time again.

State machines are best implemented using the C "switch" statement, and some long hard thinking.
  #7   Spotlight this post!  
Unread 07-03-2004, 01:47
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: Interrupt timer, executing code asap?

Quote:
Originally Posted by Daniel
State machines are best implemented using the C "switch" statement, and some long hard thinking.
As Dan pointed out, software state machines are a very powerful concept (I cannot possibly over emphasize this). I wrote a serial transmitter example that uses a state machine to generate the waveforms. The code can be found here.

-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
Inserting Naviagation code into Default code? actorindp Programming 3 28-01-2004 18:12
Interrupts Questions mightywombat Programming 0 03-01-2004 14:50
EDU Demo Code: Serial Data Transmitter Using a State-Machine Kevin Watson Programming 3 28-12-2003 22:56
EDU Interrupt and Timer Template Code Kevin Watson Programming 8 22-12-2003 14:11
EDU Demo Code: Real-Time Clock Using a Timer Kevin Watson Programming 1 17-12-2003 15:14


All times are GMT -5. The time now is 07:47.

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