Hi, new poster here.
I'm learning to use the PIC32 with the assistance of a textbook, datasheets, and anything else I can get my hands on. I'm trying to do as much as possible directly with registers instead of peripheral libs, etc.
I needed an interrupt every 1/60 of a second, and I got it working with Timer1 following some instructions, however I don't understand why it works. What actually assigns the Timer1 interrupt to this particular ISR?
The ISR function:
#pragma interrupt InterruptHandler ipl1 vector 0
void InterruptHandler(void)
{
// Do stuff...
IFS0bits.T1IF = 0;
}
And the Timer1 config:
T1CON = 0x8010; //Timer1 ON, Prescaler 8
PR1 = GetPeripheralClock() / 60;
__asm__("EI");
IFS0bits.T1IF = 0; // Timer1 Interrupt Flag cleared
IPC1bits.T1IP = 1; // Timer1 Interrupt Priority 1
IEC0bits.T1IE = 1; // Timer1 Interrupt Enable
Aside from the priority level matching, I don't see what it is that defines this ISR for Timer1.