Flowchart Timer0

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Oasis Technologies Pvt.Ltd.

Init_timer

Set timeval variable to 0.


Set the match count in the match register.
T0MR0 = 149999;( 10mSec = 150.000-1 counts)
Set the MCR register to interrupt and reset on match.
T0MCR = 3
Enable the timer.
T0TCR = 1
Update the VICVECADDR0 with the ISR address.
VICVectAddr0 = (unsigned long)tc0
Update the VIC control register with the source of the interrupt (timer 0) and enable the
source.
VICVectCntl0 = 0x20 | 4
Enable the timer interrupt.
VICIntEnable |= 0x00000010

Return to main

tc0

Clear the interrupt flag at the source of the interrupt.


T0IR = 1;
(by acknowledging the T0IR register). Increase timeval by 1.

Perform the interrupt handling function.

Clear the interrupt flag at the VIC level


{by acknowledging VICVECADDR }
VICVectAddr = 0

Return

www.oasistech.co.in

You might also like