|
在我的系统中timer4中断服务程序用来调用OSTimeTick()
我在创建的任务中初始化了timer4的
rINTMSK &= ~(BIT_TIMER4);
pISR_TIMER4 = (int)Timer4ISR;
rTCNTB4 = (rTCNTB0 & ~(0xFFFF))|99; //1ms
rTCFG0 = ((rTCFG0&0x000000FF)|(0xF900)); // prescaer = 249
rTCFG1 = (rTCFG1&0x0000FFFF); //1/2//Timer4 Driver value=2 ;1/2
rTCON=(rTCON & (0x0FFFFF)) |0x200000;
rTCON=(rTCON & (0x0FFFFF)) |0x500000;
我想的是在我启动定时器后,想该rTCNTB4的值怎样操作呀?(conuter为我输入的定时初始值)
1> rTCNTB4 = (rTCNTB0 & ~(0xffff)) | counter;
2>
rTCON = (rTCON & (0x0FFFFF));
rTCNTB4 = (rTCNTB0 & ~(0xffff)) | counter;
rINTMSK &= ~(BIT_TIMER4);
pISR_TIMER4 = (int)Timer4ISR;
rTCFG0 = ((rTCFG0&0x000000FF)|(0xF900)); // prescaer = 249
rTCFG1 = (rTCFG1&0x0000FFFF); //1/2//Timer4 Driver value=2 ;1/2
rTCON=(rTCON & (0x0FFFFF)) |0x200000;
rTCON=(rTCON & (0x0FFFFF)) |0x500000;
3>rTCON = (rTCON & (0x0FFFFF));
rTCNTB4 = (rTCNTB0 & ~(0xffff)) | counter;
rTCON=(rTCON & (0x0FFFFF)) |0x200000;
rTCON=(rTCON & (0x0FFFFF)) |0x500000;
经实验以上3种方法都不能成功........想请教各位大哥帮帮忙..
急急在线等候
|
|