This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF5340 - real-time time capture

Hi,
on nRF5340 I want to capture accurate timing of external events.
I need a kind of real-time capture module to read the time period of a pulse train generated by a rotating turbine.
The minimum period is 200 us. The time resolution of 10-20 us is acceptable.
Is there a suitable HW peripheral I can use on nRF5340 to do the job efficiently ?

Best Regards

Parents
  • Hi,

    Just out of curiosity, why does using QDEC make sense in this case? You would normally use GPIOTE and a TIMER hooked up via DPPI in such cases, for instance as shown here (some minor adjustments are needed for the nRF53140).

  • Thank you Einar.

    The aim is to measure instant flow and volume of air.
    Our encoder is a low inertial vane rotating in between two swirl plates deflecting the air entering the air flow path and converting the linear airflow into a helical flow. The vane angular velocity is proportional to the flow and is detected by the interruption of a pair of infrared beams.
    Thus we have two signals which are pulse trains in quadrature.
    The frequency of each pulse train is therefore proportional to the air flow and the number of pulses is proportional to the volume.

    QDEC is ready-made to immediately deliver the volume by counting pulses, with automatic adjust of count direction upon reversing of flow.
    The approach you suggest is measuring the flow, by assessing time between consecutive pulses.
    At first glance I would say it is more complicated, for the fact that you have to use three objects (GPIOTE, TIMER, DPPI) instead of one (QDEC).

  • Hi,

    Now I see. I was mostly focusing on the first line of your question, if you get a quadrature encoded signal which you typically get from something measuring rotation, then QDEC is definitely sensible.

    Regarding the QDEC on the nRF53 that is at least partially supported in NCS master. There, HAS_HW_NRF_QDEC0 is defined, and that is equivalent with HAS_HW_NRF_QDEC (See CONFIG_NRFX_QDEC).

Reply Children
No Data
Related