Timer_A0 Up Mode: Periodic Interrupt + Square Wave

TA0 counts from 0 up to CCR0 (up mode). On every match it raises the CCR0 interrupt and OUTMOD_4 toggles the timer output, producing a square wave at half the interrupt frequency. The main loop does nothing: the timer does all the work.

What to watch as you step

Open this example