Go to Post What makes a team great is not what they do during the 6 weeks, but what they do the rest of the year. - davidthefat [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Spotlight this post!  
Unread 07-02-2008, 10:55
dcbrown dcbrown is offline
Registered User
AKA: Bud
no team
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Hollis,NH
Posts: 236
dcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud of
Re: How many interrupts is too many interrupts?

At 20,000 interrupts per second, you would need a interrupt code path length of 500 instruction cycles or less (processor is capable of 10,000,000 instruction cycles/second). In almost all cases with the robot, the interrupt code path should be well under 500 cycles leaving upwards of half of the cycles for non-interrupt code.

Typically in MPLAB/IFI default code the interrupt code paths I've measured are <250 cycles total as long as context save/restore is managed well and closer to 500 for WPILib based projects - mostly due to the larger context save/restores needed for accepting anyone's service routine. Probably the longest code path I've seen is in adc interrupt handlers becuase of array indexing and averaging which isn't needed for most other device interrupt routines, but still the average is <300 instructions (~110 cyles per sample and a max of about 1800 cycles for processing 16 channels at sample set boundaries for an average around 215-220 cycles).

Which means, with tuning you'd be easily able to process in excess of 40,000 interrupts per second before you'd start max'ing out the processor.

The down side is, as the process runs more and more at interrupt level there is less and less time at user level and you can get the red light of death because the user code isn't exchanging data in a timely manner with the master processor. You can get around this issue by doing the Getdata/Putdata at interrupt level tied to the system clock for example.

Last edited by dcbrown : 07-02-2008 at 10:58.
 


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
Too many R/C commands in a loop? ManicMechanic VEX 1 02-07-2007 00:52
3 Teams Per Side Too Many? ben281 FRC Game Design 65 15-05-2005 18:24
pic: TOO MANY TETRAS!!!! Ali Ahmed Extra Discussion 12 22-01-2005 10:06


All times are GMT -5. The time now is 19:10.

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