View Single Post
  #22   Spotlight this post!  
Unread 21-03-2010, 19:43
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
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,919
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: switching between Teleoperated enabled and Wathcdog notfed

I'm playing catchup with crossing posts, but yes I think you've got it.

The only change I'd make to your thinking is the line:
- the CPU comes back and starts executing the 1ms "task", and finishes it.
Think of both the 5ms Timer and the 1ms Task as starting simultaneously.
There is no rule that says one must start before the other, or which starts first.

Quote:
Originally Posted by Ether View Post
I've been reading and re-reading the above post and I think I may have had an epiphany.

Is this any closer to the truth:

- the 5ms periodic vi has two parallel "tasks" in it: a 5ms timer, and some code that takes 1ms to execute

- this 5ms periodic vi gets called once to kick-start it

- the first time the 5ms periodic vi gets called, the CPU encounters the 5ms timer task and executes that... which basically just sets a timer interrupt to occur 5ms in the future.

- the CPU comes back and starts executing the 1ms "task", and finishes it.

- since the 5ms timer task hasn't finished yet, the 5ms periodic vi can't "finish". The CPU goes and does something else.

- when the 5ms interrupt occurs, this basically completes the 5ms timer "task", so the periodic vi is now "finished"

- in this scenario, it is required to make the periodic vi loop back and start again

Is the above even remotely correct?


~
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 21-03-2010 at 19:49.
Reply With Quote