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.

28069定时器的PSCH:PSC值可以读出来吗?



你好,

我打算用28069的cputimer0定时器做时间记录,其中PRD和TDDR均设置成最大值,但是在程序运行的过程中,PSC值不变一直是0xFF,只有TIM寄存器在递减。

这是我度寄存器的方式: 

TIM = CpuTimer0Regs.TIM.all;
TPR = CpuTimer0Regs.TPR.bit.PSC;
TPRH = CpuTimer0Regs.TPRH.bit.PSCH;

void InitCpuTimers(void)
{
    // CPU Timer 0
 // Initialize address pointers to respective timer registers:
 CpuTimer0.RegsAddr = &CpuTimer0Regs;
 
 CpuTimer0Regs.PRD.all  = 0x0000FFFF;

 CpuTimer0Regs.TPR.bit.TDDR  = 0xFF;
 CpuTimer0Regs.TPRH.bit.TDDRH = 0xFF;
 
 CpuTimer0Regs.TCR.bit.TSS = 1;

 CpuTimer0Regs.TCR.bit.TRB = 1;
 }
在主函数中,设置CpuTimer0Regs.TCR.all= 0x4000;
请问是什么问题?谢谢