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,
    I think nRF5340’s QDEC peripheral could be great to solve my problem.
    From link
    I see Zephyr manages the quadrature decoder.

    The next question is how to activate it under NCS 1.5.1 ?
    I’ve enabled CONFIG_QDEC_NRFX in prj.conf, and put the following definition in dts overlay

    &qdec {
        status = "okay";
        a-pin = <3>;
        b-pin = <28>;
        enable-pin = <30>;
        led-pin = <0xFFFFFFFF>;
        led-pre = <0>;
        steps = <24>;
    };

    Build fails in parsing the input tree.
    From link
    I read nRF5340 is not listed among the SoC allowed to enable HAS_HW_NRF_QDEC.

    Is there a way to use QDEC on nRF5340 ?

Reply
  • Hi,
    I think nRF5340’s QDEC peripheral could be great to solve my problem.
    From link
    I see Zephyr manages the quadrature decoder.

    The next question is how to activate it under NCS 1.5.1 ?
    I’ve enabled CONFIG_QDEC_NRFX in prj.conf, and put the following definition in dts overlay

    &qdec {
        status = "okay";
        a-pin = <3>;
        b-pin = <28>;
        enable-pin = <30>;
        led-pin = <0xFFFFFFFF>;
        led-pre = <0>;
        steps = <24>;
    };

    Build fails in parsing the input tree.
    From link
    I read nRF5340 is not listed among the SoC allowed to enable HAS_HW_NRF_QDEC.

    Is there a way to use QDEC on nRF5340 ?

Children
No Data
Related