#include unsigned int Tcount; #ifndef TFLG1_C7F_MASK #define TFLG1_C7F_MASK 0x80 #endif void main(void) { TSCR1 = 0x80; TSCR2 = 0x04; TIOS = 0x80; TCTL1 = 0x40; while(1) { Tcount = TCNT; Tcount = Tcount + 62500; TC7 = Tcount; while (!(TFLG1 & TFLG1_C7F_MASK)); TFLG1 = TFLG1 | TFLG1_C7F_MASK; } }