|
Re: Code violation using Hall effect sensor
Quote:
|
Originally Posted by pickle
...But I will try the digital thing, the thing is, I need both an accurate timer, and the counter, thats not too tolling on the processor is it? And what happens if an interrupt is raised while you're in an interrupt handler? I figure its possible, do I miss that tooth, or does it interrupt the interrupt handler?...
|
Jeremy,
Interrupts are nested. While you are servicing one, the next will wait for you to be done unless you are doing prioritized interrupts. In that case, the higher priority will interrupt the lower priority. This is why Kevin's code disables interrupts within the handler. Bottom line, you will not miss an interrupt unless you try doing too much within the interrupt OR try servicing too many interrupts.
As to your question on "tolling". This is very implementation specific. How often does the timer interrupt? how many teeth and how fast does the gear tooth sensor need to service? And lastly, how much code is implemented within the interrupt? We can not answer this for you. It needs to be derived numerically or verified experimentally.
If you have a competent mentor, ask him or her. I'm sure they will be glad to help (depending on how busy they are).
__________________
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...
|