I have two basic questions about interrupts,
1) Is there any way to tell if my interrupt service routine is running late? i.e the code in the routine is too slow and interrupt gets triggered while the code in it is still running due to the previous triggering of the interrupt.
2) Is there any way to run interrupts or periodic functions if there is an infinite while loop running in the main function?
For Q1. You should be able to profile your HWI ISR execution to determine if it is overflowing its HWI rate.
For Q2. Because they are HWIs, they have the highest priorities over anything else, and should come to life when their hardware event is posted, unless their corresponding interrupt enable is disabled, or the global CPU interrupt is disabled.
There is plenty of training material that will enlighten you on how to do that in your design.
Are you running an O/S?
Which DSP are you using?
If you go through one of our training classes (there are some archived online for self-paced use), you will be told to never do much processing in your ISR. You should do the minimum required at the ISR, such as capturing some input or sending some output and setting a control/signal flag or semaphore. Then you can do your processing outside of the ISR and be less susceptible to real-time concerns.
Not everyone follows that advice, and sometimes for a good reason. But it is usually the best choice and easiest to support in the long run.
Search for answers, Ask a question, click Verify when complete, Help others, Learn more.
Another trick worth knowing is, right before the ISR returns, check the appropriate peripheral device register to see if more input is ready, and if it is then instead of returning from the ISR just to immediately get interrupted again, go ahead and jump back to the part of the ISR where data is captured into the user buffer.
I am using the TMS320C6713 DSK with Code Composer Studio 3.1 that runs on a Win 7 PC in XP Mode. Can you please provide me a few links for the training material. I am currently only aware of the IW6000.
For the C6713, IW6000 is the training material I would recommend. See Chapters 8 & 9 for discussion on real-time processing.
From TI, http://processors.wiki.ti.com/index.php/TMS320C6000_DSP_Optimization_Workshop and http://focus.ti.com/docs/training/catalog/events/event.jhtml?sku=4DW102090
Spectrum Digital provide a good set of examples.
Third part books "DSP Applications Using C and the TMS320C6x DSK" and Digital Signal Processing and Applications with the C6713 and C6416 DSK" etc...
Ome thing to check is that your "infinite while loop" contains sufficient non-branch instructions so that interrupts aren't perpetually blocked by the 5 delay slots in each branch. If you code just "while(1) ;" then interrupts cannot be serviced, because the generated assembly code is the equivalent of "HERE: BR HERE" which continually executes the next branch within 5 cycles of the previous branch, so execution is always within the delay slots of a branch, which is a condition during which pending interrupts are held up.
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.