|
Re: Optical Encoders
Kevin, Great work on the interupt coding. You saved be a good deal of time looking for the names of the bits I needed to set. I think I noticed an error where the bits for timers 3 and 4 were polled in user_routines_fast.c:
else if (PIR1bits.TMR1IF) // timer 3 interrupt?
{
PIR2bits.TMR3IF = 0; // clear the timer 3 interrupt flag [93]
Timer_3_Int_Handler(); // call the timer 3 interrupt handler (in interrupts.c)
}
else if (PIR1bits.TMR2IF) // timer 4 interrupt?
{
PIR3bits.TMR4IF = 0; // clear the timer 4 interrupt flag [94]
Timer_4_Int_Handler(); // call the timer 4 interrupt handler (in interrupts.c)
}
Should it be "else if (PIR2bits.TMR3IF)" and "else if (PIR3bits.TMR4IF)"? I do things like that all the time after copying chunks of code. Thanks again.
__________________
Electrical & Programming Mentor ---Team #365 "The Miracle Workerz"
Programming Mentor ---Team #4342 "Demon Robotics"
Founding Mentor --- Team #1495 Avon Grove High School
2007 CMP Chairman's Award - Thanks to all MOE members (and others) past and present who made it a reality.
 Robot Inspector
"I don't think I'm ever more ''aware'' than I am right after I burn my thumb with a soldering iron"
|