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.

HRCAP

Hello!!! In TMS320x2806x Piccolo Technical Reference Manual there is an example of hrcap isr:

interrupt void HRCAP1_Isr (void)
{
EALLOW;
if (HRCap1Regs.HCIFR.bit.RISEOVF == 1) {
ESTOP0; // Another rising edge detected
}
.....
}

And also in Control suite in all examples of hrcap there are these two strings of code. Can anybody explain, how can be the another edge detected? When we catch the interrupt, and fall to the isr, all interupts are disabled by controller and PIE Interrupts are disabled too.Thanks a lot!!

  • Hi,

    You mean, you want to detect falling edge instead rising one? or you want to detect the next rising edge? Can you be more clearer?

    Regards,
    Gautam
  • Hello Illya,

    Even though interrupts are disabled by the controller, the RISEOVF flag may be set if a new rising edge is detected while the rise flag is also set. This means that the HRCAP captured values may not be valid anymore because some or all of the values may have been overwritten by the captures corresponding to the new rising edge. This is an erroneous condition and that is why an ESTOP instruction is executed in the example code. User may replace this piece of code with his/her own code for this condition.

    This may happen if the input signal to the HRCAP is running at a very high frequency or input (rising edges) come in at a very high frequency and before the ISR is completely executed allowing correct values to be read before the next input edge/cycle.

    I hope this helps.

    Hrishi