View Single Post
Old 05-25-2009, 10:28 AM   #1396 (permalink)
MPaulHolmes
PaulH
 
MPaulHolmes's Avatar
 
Join Date: Feb 2008
Location: Maricopa, AZ (sort of. Actually outside of town)
Posts: 3,831

Michael's Electric Beetle - '71 Volkswagen Superbeetle 500000
Thanks: 1,367
Thanked 1,115 Times in 730 Posts
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!
__________________
kits and boards

Last edited by MPaulHolmes; 05-25-2009 at 10:34 AM..
  Reply With Quote