1 F2812测试程序中关于事件管理器定时器的程序示例中函数 void init_eva_timer1(void) { // Initialize EVA Timer 1: // Setup Timer 1 Registers (EV A) EvaRegs.GPTCONA.all = 0; // Set the Period for the GP timer 1 to 0x0200; EvaRegs.T1PR = 0x0200; // Period EvaRegs.T1CMPR = 0x0000; // Compare Reg // Enable Period interrupt bits for GP timer 1 // Count up, x128, internal clk, enable compare, use own period EvaRegs.EVAIMRA.bit.T1PINT = 1; EvaRegs.EVAIFRA.bit.T1PINT = 1;
// Clear the counter for GP timer 1 EvaRegs.T1CNT = 0x0000; EvaRegs.T1CON.all = 0x1742;
// Start EVA ADC Conversion on timer 1 Period interrupt EvaRegs.GPTCONA.bit.T1TOADC = 2;
}
如果我想1秒钟中断一次,那么EvaRegs.T1PR该设为多少?谢谢! |