大家好:
我用例程包“STK_C6657.7z”里的timer程序做测试
执行这个函数generate_clocks_by_timer();在TIMO0上的确可以量到时钟
但执行这个函数generate_pulse_by_timer();在TIMO0上量不到脉冲信号 中断进去了
void generate_pulse_by_timer()
{
Timer64_Config tmrCfg;
puts("\na pulse will be generated on TIMO0…");
uiTick = 0;
//select output on TIMO0 from local timer.
gpBootCfgRegs->TOUTSEL = (DNUM*2)<<CSL_BOOTCFG_TOUTSEL_TOUTSEL0_SHIFT;
//configure the timer for one shot pulse
tmrCfg.timer_num= DNUM;
tmrCfg.timerMode= TIMER_ONE_SHOT_PULSE;
tmrCfg.period= (unsigned long long)PULSE_DELAY_MS*gDSP_Core_Speed_Hz/6000;
tmrCfg.pulseWidth= 3;
Timer64_Init(&tmrCfg);
//wait until the interrupt happen, which means the pulse has been generated
while(0==uiTick)
asm(" nop 5");
puts("a pulse was generated on TIMO0\n");
}
把函数里的tmrCfg.timerMode= TIMER_ONE_SHOT_PULSE; 改为tmrCfg.timerMode= TIMER_PERIODIC_CLOCK;
有脉冲信号的输出
什么问题 求解答???!!!
Thomas Yang1:
问题再细化下吧,中断是每次都产生吗?有没有可能测量的时候出问题了?
skysteed:
回复 Thomas Yang1:
恩 好了 程序没错 把定时器周期值改小 就方便测量了
谢了哦