我要在C6747的相关程序中开两个定时器(比如一个为100kHz,一个为600Hz,两个之间不能整除的),请问该如何设置?我试过TIMER0的12和34。都会出现问题。初始化程序如下:
void initExint(void)
{ CSR&=0xfffe;
asm(" NOP 2 ");
TIMER0_EMUMGT=0x1; //the timer runs free regardless of the soft bit
TIMER0_TGCR=0x317; //采用32位独立定时器12与34
TIMER0_TIM12=0; //This 32-bit value is the current count of the main counter.
//定时器12的起始值为0
TIMER0_TIM34=0; //This 32-bit value is the current count of the main counter.
//定时器34的起始值为0
TIMER0_PRD12=0x10a; //This 32-bit value is the number of timer input clock cycles to count.
TIMER0_PRD34=0x2710; //600Hz的定时器计数单元
TIMER0_INTCLSTAT=0x30003;
TIMER0_TRC=0x00800080; //开定时器12/34,continuously,
INTMUX1=0x044000; // 指定Timer0INT(为4号中断)到中断5(INT5),将Ex4INT指定到INT4 EX6INT到INT6
ISTP=0x80000000; // 重置中断向量表到0C00h
ICR=0xfff0;
ISR=0x0; // 清除等待的中断
IER=0xffff; // 使能ADINT中断 }
不知是哪些地方没有弄好,望指教。谢谢
Tony Tang:
是出了什么问题?没有看到对GIE的使能。是在别的地方做 ?还是用了BIOS?
TI中文支持网
