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.

TMS570LC4357: RTI rtiResetCounter(rtiREG1, rtiCOUNTER_BLOCK0);

Part Number: TMS570LC4357

王工您好:

       咨询个问题,我们使用rtiResetCounter清除rtiREG1->CNT[0].FRCx的值,但是根据打印,rtiREG1->CNT[0].FRCx的值时钟累加,并没有被清除,为什么啊?

       难道rtiResetCounter这个函数不好用?

while(1)
{
rtiResetCounter(rtiREG1, rtiCOUNTER_BLOCK0);
uint32_t uc,fc;
fc=rtiREG1->CNT[0].FRCx;
uc=rtiREG1->CNT[0].UCx;
printf("CPUCx:%d %d %d %d\r\n",rtiREG1->CNT[0].CPUCx,uc,fc,value2);
}

  • Hi,

    English:

    We must stop the counter before reset.

    So call the "rtiStopCounter" function before reset.

    So use below code

    rtiStopCounter(rtiREG1, rtiCOUNTER_BLOCK0);

    rtiResetCounter(rtiREG1, rtiCOUNTER_BLOCK0);

    uint32_t uc,fc;

    fc=rtiREG1->CNT[0].FRCx;

    uc=rtiREG1->CNT[0].UCx;

    printf("CPUCx:%d %d %d %d\r\n",rtiREG1->CNT[0].CPUCx,uc,fc,value2);

    中国人:

    我们必须在重置之前停止计数器。 所以在复位之前调用“rtiStopCounter”函数。 所以使用下面的代码

    rtiStopCounter(rtiREG1, rtiCOUNTER_BLOCK0);

    rtiResetCounter(rtiREG1, rtiCOUNTER_BLOCK0);

    uint32_t uc,fc;

    fc=rtiREG1->CNT[0].FRCx;

    uc=rtiREG1->CNT[0].UCx;

    printf("CPUCx:%d %d %d %d\r\n",rtiREG1->CNT[0].CPUCx,uc,fc,value2);

    --

    Thanks & Regards,

    Jagadish.