View Single Post
  #4   Spotlight this post!  
Unread 22-12-2003, 03:41
The Lucas's Avatar
The Lucas The Lucas is offline
CaMOElot, it is a silly place
AKA: My First Name is really "The" (or Brian)
FRC #0365 (The Miracle Workerz); FRC#1495 (AGR); FRC#4342 (Demon)
Team Role: Mentor
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Dela-Where?
Posts: 1,564
The Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond repute
Send a message via AIM to The Lucas
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"