程序如下所示,Timer64P0 – TINT12可以正常中断,但是34中断不了,初始化有问题吗?
void interrupt TIME0INT() //T12
{
cnt++;
TIMER0_INTCLSTAT |= 0x00003; //clear the interrupt flag
}
void interrupt TIME1INT() //T34
{
cnt1++;
TIMER0_INTCLSTAT |= 0x30000; //clear the interrupt flag
}
void Timer0_init(void)
{
CSR &= 0xfffe; //
asm(" NOP 2 ");
TIMER0_EMUMGT = 0x01;
TIMER0_TGCR=0x00015; //采用32位独立定时器12与34 ??? TIMER0_TIM12 = 0;
TIMER0_TIM34 = 0;
TIMER0_PRD12 = 24000;
TIMER0_PRD34 = 12000;
TIMER0_INTCLSTAT = 0x30003; //T12,T34 all are opened
TIMER0_TRC = 0x00800080; INTmux1=0x044000; // 指定Timer0INT(为6号中断),Timer1INT(为5号中断)
ISTP=0x80000000; // 重置中断向量表到0C00h
ICR=0xfff0; ISR=0x0; // 清除等待的中断
IER=0xffff; // 使能ADINT中断 CSR=CSR|0x1; //开总中断}
noaming:
能否单步一下查看T64P0_TINT34事件标志位是否置位了?然后仔细查找问题的原因