View Single Post
  #4   Spotlight this post!  
Unread 13-04-2014, 19:46
The Doctor's Avatar
The Doctor The Doctor is offline
Robotics is life
AKA: Hackson
FRC #3216 (MRT)
Team Role: Programmer
 
Join Date: Mar 2014
Rookie Year: 2013
Location: United States
Posts: 155
The Doctor is on a distinguished road
Re: using interrupts in FRC

Quote:
Originally Posted by Chris_Elston View Post
The timing of this thread is impeccable.
Haha... Ether must be an ISR.

Why cant you just thread?:

If you had a timed task that took as long as in scenario 1, you may want to consider making it into a separate thread (using the Task class in C++ or similar). If any task doesn't require much communication with the main control loop, you could put it in a separate Task.

Now, thoughts on Scenario 1:

If you offload these timed actions into ISRs, they would take up as much (or more) CPU time as if they were running in the main process. The main disadvantage to this is if it happens inside a time-critical operation (like sending data to the host), it could cause problems.

Scenario 2:

If the team in question had code that could respond within 1ms, ISRs are a good choice. A hardwired solution would be very difficult to make, debug, and change, compared to an ISR.