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

QDEC example simple code

Hi,

I want to interface two QENC with nrf52840, I saw QDEC example and it works as expected.

The problem I am facing is that QENC has four pins of which two are for power and two are ENCA and ENCB. Since I don't have QENC LED, I have to sample let's say 25 samples per second directly, how to do that?

Also I tried connecting my QENC pins to QDEC A (pin3) and QDEC B (pin4), connecting QDEC LED as it is and tried the software, it didn't work.

Is there a simple code not simulator where I can test my actual hardware and the direction whether it is in positive direction or negative direction?

How to add two QDEC in a project?

Regards

SDK 15.2, Keil, nRF52840 DK

  • Thank you for your help

    I am reading ACC registers but values seems completely incorrect.

    I used gpiote to count pulses and they seems to be fine.

    Do you know some common reasons why it isn't working as expected?

    I am planning to use gpiote and count risung edge pulses which seems okay for me as of now but still I think qdec should work somehow for my applcation.

    Regards

Related