This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

求助 6713 主频由225MHz改为300MHz后 定时器工作不正常

外部晶振50M

之前一直是配置成225M 定时器是1ms 没问题 现在想提升到300M 重新配置后 发现定时器超过了1ms

Timer0 Clock = Cpu Clock / 4 = 300 / 4 = 75MHz 定时1ms的话 定时器的周期值应该是37500 没错吧

程序如下:

225M时:

//--------------PLL-------------

PLLM=9; 

OSCDIV1 = 0x8000; 

PLLDIV1 = 0x8001;
PLLDelay(20);

PLLDIV2 = 0x8003;
PLLDelay(20);

PLLDIV3 = 0x8003;
PLLDelay(20);

PLLCSR &= 0xfff3;
PLLDelay(1500);
PLLCSR |= 0x01;
PLLDelay(20);

//-----------Timer0------------

TIMER0CTL=0x03C0;
TIMER0PRD= 28125;

300M时:

PLLM=12;

OSCDIV1 = 0x8000;

PLLDIV1 = 0x8001;
PLLDelay(20);

PLLDIV2 = 0x8005;
PLLDelay(20);

PLLDIV3 = 0x8005;
PLLDelay(20);

//------------Timer0-------------

TIMER0CTL=0x03C0;
TIMER0PRD= 37500;