|
Re: Code violation
Quote:
|
Originally Posted by pickle
Perhaps my problem is not having a good grasp on how to set up interrupts. I understand how they work, but I'm not entirely sure on setting them up.... I've read the innovationfirst documentation on them, and I've looked at kevin's code, but its still not very clear. Any places I can get help on them? This may help solve my problem
|
Jeremy,
Not an easy answer here... I have met quite a few degreed engineers who did not understand the intricacies of interrupt timing, latency, context saving, priorities, et cetera.
The important thing to remember is that an interrupt is like a separate program which runs on your processor. It can occur at any time, therefore it must have it's own variables, do its thing, come to completion quickly and give control back to your background process.
Any variables it uses which are shared with the background process must be treated very carefully. Read the timers white paper from the IFI site for a fairly good side by side comparison of implementing a timer with and without interrupts.
Meanwhile, feel free to post specific questions here and I (or other knowledgeable people) will try to help you.
__________________
Mike Betts
Alumnus, Team 3518, Panthrobots, 2011
Alumnus, Team 177, Bobcat Robotics, 1995 - 2010
LRI, Connecticut Regional, 2007-2010
LRI, WPI Regional, 2009 - 2010
RI, South Florida Regional, 2012 - 2013
As easy as 355/113...
|