View Single Post
Old 05-25-2009, 09:10 PM   #1409 (permalink)
dlaing
EcoModding Lurker
 
Join Date: Aug 2008
Location: Calgary, AB
Posts: 21

Corolla bandit - '05 Toyota Corolla CE
Thanks: 1
Thanked 1 Time in 1 Post
Paul, if you take out your spin loop in the ISR you'll have a lot more time for everything else. You should have your ISR that triggers in the middle of the pwm (TIMER1_OVF_vect) start the ADC, then have the ADC trigger an ISR on completion (Bit 4 – ADIF: ADC Interrupt Flag). The ADIF then makes the current available to the main loop.
  Reply With Quote