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.

using HRCAP on 28069

Hi All,

We have to measure the frequency of a signal which can be from 0.1 Hz to 300 Hz.

Connecting it to a ECAP pin and measuring the events is quite easy and works well.

Since we do not have any ECAP pin free,  we connect to a HRCAP pin.  Even if we run it in the normal mode (not hi resolution) we have an issue that we cannot measure lower frequencies since the capture register is only 16 bit. Is there any way we can work with HRCAP itself for measuring low frequency?

We have right now using TIMER2 as a counter and latching the count in the code when HRCAP event occurs.

Any ideas?

Vaidi.

  • Vaidi,

    Your solution makes sense.  There is no way to directly extend the HRCAP module to 32-bits.

    If you don't need high-resolution, another thought might be to use the EQEP module's up-count mode and read the QCPRD to get the delta-time between events.  It may be some work to get the EQEP configuration correct, but once done, the peripheral should do most of the work with very little CPU intervention. 

    Note that I haven't tried this directly, but I believe it should work.


    Thank you,
    Brett

  • Hi Brett,

    Thanks for the confirmation that we cannot extend to 32 bit.- we will anyway need Timer2 to run continuously for some time stamping, so we will go with this idea only. We have connected some other inputs too to HRCAP inputs, hence using Timer2 as a clock can be used for all the inputs. We just use the interrupt events of HRCAPs but take a snap shot of Timer2 value - we just need to take care of timer2 overflow during delta time computation.

    Vaidi.