6 volatile unsigned long milliSeconds=0;
8 #define RELOAD_VALUE 18432000/2/CLOCKS_PER_SEC
10 void Timer2Handler (void) interrupt 5 using 1 {
11 TF2=0; // reset overflow flag
13 // that's all for now :)
16 // we can't just use milliSeconds
17 unsigned long clock(void) {
25 void startTimer (void)
27 printf ("\n\rStarting timer 2 test.\n\r");
30 ET2=0; // disable timer interrupts initially
31 T2CON=0; // stop, timer mode, autoreload
34 TL2=RTL2=(-RELOAD_VALUE)&0xff;
35 TH2=RTH2=(-RELOAD_VALUE)>>8;
38 ET2=1; // enable timer interrupts