Part Number:CC1310
void Timer0_Callback(void) {TimerIntClear(GPT0_BASE, TIMER_TIMA_TIMEOUT);//清空中断GPIO_toggle(Board_GPIO_LED0); } void Timer0_Init(void) {// Power on the TIMER0 peripheralPRCMPeripheralRunEnable(PRCM_PERIPH_TIMER0);TimerDisable(GPT0_BASE, TIMER_A);TimerConfigure(GPT0_BASE, TIMER_CFG_SPLIT_PAIR |TIMER_CFG_A_PERIODIC_UP);TimerLoadSet(GPT0_BASE, TIMER_A, 200);TimerPrescaleSet(GPT0_BASE, TIMER_A, 48-1);//实际分频值加1//TimerIntervalLoadMode(GPT0_BASE, TIMER_A, TIMER_INTERVALLOAD_NEXTCYCLE);//更新模式:在下个时钟周期TimerIntRegister(GPT0_BASE, TIMER_A, Timer0_Callback);TimerIntEnable(GPT0_BASE, TIMER_TIMA_TIMEOUT);TimerIntClear(GPT0_BASE, TIMER_TIMA_TIMEOUT);//清空中断TimerEnable(GPT0_BASE, TIMER_A); }
请问这段代码定时器时间视乎不起作用,一直是63.9ms,改LOAD值定时时间也不变,不知是哪的问题。
Vivian Gao:
您好
您可以试一下下方链接的代码和提到的相关链接。
e2e.ti.com/…/cc1310-need-solution-as-cc1310-timer-code-is-not-working