我想用定时器控制USI采集数据,但是我把定时器的频率设置到128khz的时候,系统会跑飞,
我想请教一下,w90p710上能不能实现128khz的定时器啊?
#include "wblib.h"
UINT32 volatile g_count=0;
VOID timer0ISR(void)
{
outpw(REG_TISR,1);
g_count++;
}
int main(void)
{
sysPrintf("Test!");
outpw(REG_TCR0,0x00); //disable timer0
outpw(REG_TICR0,0x78); //counter value: Freq = Crystal clock / ((pre-scaler+1) * counter)),counter= 15000000/128000
sysInstallISR(IRQ_LEVEL_1, IRQ_TIMER0, (PVOID)timer0ISR, 0);
sysEnableInterrupt(IRQ_TIMER0);
outpw(REG_TCR0,0x68000000);//enable timer0,irq and start
while(g_count<1024);
sysPrintf("end!");
return (0);
}
请高手帮我看看! |