//T0PR = 0x00000229; // 大概10us
__inline void timer0_config()
{
T0PR = 0x0000d804; // 大概1ms 中断一次;
T0TCR = 0x00000001; //enable timer
VICVectAddr4 = (unsigned)T0isr; //Set the timer ISR vector address
VICVectCntl4 = 0x00000024; //Set channel
VICIntEnable |= 0x00000010; //Enable the interrupt
}
问题就出在这里,T0 该如何配置,才能1MS 进入一次中断呢?
谢谢
uint8 test[2]={0xff,0x55}; // 通过串口要发送的内容;
void T0isr (void) __irq
{
sent(test,2);
T0IR |= 0x00000001; //Clear match 0 interrupt
VICVectAddr = 0x00000000; //Dummy write to signal end of interrupt
}