Interrupt handler for ENC phase inputs?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Interrupt handler for ENC phase inputs?

706 Views
jackking
Senior Contributor I

I am trying to find documentation or an example of the MCUXpresso SDK ENC module that uses interrupts on the phase inputs.

The SDK examples use a polling cycle to look for increments of the position value, but I would like to trigger an interrupt if the position value changes.  I do see that there is an interrupt config for tracking index, but I don't see a corresponding example for the position value.

thanks

0 Kudos
3 Replies

592 Views
FelipeGarcia
NXP Employee
NXP Employee

Hi Jack,

 

Could you please specify the MCU you are working on?

 

Best regards,

Felipe

0 Kudos

592 Views
jackking
Senior Contributor I

Sure, it is the IMXRT1052

0 Kudos

592 Views
FelipeGarcia
NXP Employee
NXP Employee

Hi Jack,

 

Unfortunately, we don’t have examples using interrupt for position value. However, you have the following interrupt triggers.

 

enum _enc_interrupt_enable

{

    kENC_HOMETransitionInterruptEnable = (1U << 0U),  /*!< HOME interrupt enable. */

    kENC_INDEXPulseInterruptEnable = (1U << 1U),      /*!< INDEX pulse interrupt enable. */

    kENC_WatchdogTimeoutInterruptEnable = (1U << 2U), /*!< Watchdog timeout interrupt enable. */

    kENC_PositionCompareInerruptEnable = (1U << 3U),  /*!< Position compare interrupt enable. */

    kENC_SimultBothPhaseChangeInterruptEnable =

        (1U << 4U),                                     /*!< Simultaneous PHASEA and PHASEB change interrupt enable. */

    kENC_PositionRollOverInterruptEnable = (1U << 5U),  /*!< Roll-over interrupt enable. */

    kENC_PositionRollUnderInterruptEnable = (1U << 6U), /*!< Roll-under interrupt enable. */

};

 

I believe the one you are looking for is kENC_PositionCompareInerruptEnable.

 

Hope it helps!

 

Best regards,

Felipe

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos