How do you enable OC?
Set corresponding bit in TIOS to 1
What sets a flag?
If TCNT = TCi ( TCi is set to the time to interrupt next )
How do you arm an interrupt?
Set CiI to 1 in TIE
How do you Acknowledge an interrupt?
Clear CiF in TFLG1 by setting to 1
What 7 things must be done by OC Init?
Disable interrupts, Enable TCNT, Enable OC, Arm OC, Set first interrupt time, Clear flag, enable interrupts
What is the first thing to be done by OC init?
Disable interrupts ( sei )
What is the second thing to be done by OC init?
Enable TCNT ( TEN = 1)
What is the third thing to be done by OC init?
Enable OC ( set bit of TIOS )
What is the fourth thing to be done by OC init?
Arm OC ( set bit of TIE )
What is the fifth thing to be done by OC init?
Set first interrupt time ( TCNT = TCNT + period )
What is the sixth thing to be done by OC init?
Clear Flag ( set bit of TSCR2 )
What is the last thing to be done by OC init?
Re-enable interrupts ( cli )
What 2 things must be done by OC handler?
Acknowledge and set next time to interrupt
Upgrade to remove ads