Hey Adam, I might have to wait until tomorrow to reproduce it. We are having a big party, and all my "gCode" is on the backs of old credit card bills in the garage and in a couple different notebooks that can't find right now.
Matt, that's a good idea about lowering the frequency at which I check the current. Sampling at 4 KHz would allow for plenty of time during worst case to have everything inside a single interrupt. I could definitely move the temperature measurement outside, but I've never done multiple interrupts at different priorities. I need to look that up. I did a couple different timer interrupts once but that's about it. I didn't know what had what priority.
I haven't been sampling the throttle, because it was pretty clean, but there is a bit of a wiggle to the throttle signal too because the A/D conversions are happening pretty fast. So, maybe I could do the same thing with the throttle too, but maybe only 4 or 8 averages? If I had plenty of time, I could do
I guess the only thing I would lose would be the coveted current measure at the same point on the waveform each time. Maybe not though. I need to try some things. I'm pretty new to microcontroller interrupt handling.
EDIT: The general interrupt control register looks promising! I need to read more. Actually I should be doing other things! haha!
Last edited by MPaulHolmes; 05-25-2009 at 11:34 AM..
|