尊敬的TI工程师:
您好,我这边有一个DSP-C5505的板子,根据例程的timer0的代码,我修改了hGpt = GPT_open (GPT_0, &gptObj, &status);为 hGpt = GPT_open (GPT_1, &gptObj, &status);//我放了个断点到中断函数里,但是一直进不了中断。我是不是还有修改其他的地方?
下编程定时器0是可以实现的,程序正常运行,现在改了个定时器1,就不行了。程序如下:
timer0_int()
[
CSL_Status status;
CSL_Config hwConfig;
CSL_GptObj gptObj;
CSL_Handle hGpt;
/* Open the CSL GPT module */
hGpt = GPT_open (GPT_1, &gptObj, &status);//----修改此处--GPT_0 改为 GPT_1
/* Reset the GPT module */
status = GPT_reset(hGpt);
IRQ_clear(TINT_EVENT);
//Disable interrupt
IRQ_globalDisable();
/* Initialize Interrupt Vector table */
IRQ_setVecs((Uint32)(&VECSTART));
IRQ_plug(TINT_EVENT,&Timer_isr);
IRQ_enable(TINT_EVENT);
/* Timer interval 0.5sec (2Hz)*/
hwConfig.autoLoad = GPT_AUTO_ENABLE;
hwConfig.ctrlTim = GPT_TIMER_ENABLE;
hwConfig.preScaleDiv = GPT_PRE_SC_DIV_11; // Pre scale Divide input clock by 4096
// 98.304M/4096 = 24K
hwConfig.prdLow = 0x2EE0; ////24K/12K = 2Hz (12K = 0x2EE0)
hwConfig.prdHigh = 0x0000;
/* Configure Timer0 */
status = GPT_config(hGpt, &hwConfig);
IRQ_globalEnable();
/* Start timer */
GPT_start(hGpt);
}
0