whollender
Well-known member
Ok, I think I got it. The ISR code you have doesn't clear the interrupt flag, so the interrupt code get's called over and over again in an infinite loop.
If you've only enabled the timer overflow interrupt, you'll want the first line in the ISR to clear the flag by writing a 0 to the TOF bit:
If some of the channel interrupts are enabled (in the FTM0_CxSC regs), you'll need more code to determine which interrupt flag is set.
If you've only enabled the timer overflow interrupt, you'll want the first line in the ISR to clear the flag by writing a 0 to the TOF bit:
Code:
FTM0_SC = FTM_SC_CLKS(1) | FTM_SC_PS(0) | FTM_SC_TOIE;
If some of the channel interrupts are enabled (in the FTM0_CxSC regs), you'll need more code to determine which interrupt flag is set.