MCUXpresso SDK API Reference Manual  Rev 2.16.000
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
EQDC Peripheral and Driver Overview

Content including 1) peripheral features, work logic and work method; 2) driver design logic and use method. More...

Peripheral features and how this peripheral works

The Enhanced Quadrature Decoder module interfaces to position/speed sensors that are used in industrial motor control applications and decodes shaft position, revolution count, and speed. The quadrature decoder gets 8 input signals: PHASEA, PHASEB, INDEX/PRESET, TRIGGER, HOME/ENABLE and ICAP[3:1] from those position/speed sensors, and outputs 11 signals: POS_MATCH[3:0], COMP_FLG[3:0], DIR, CNT_DN, and CNT_UP for system use.

Features

How this peripheral works

  1. Initialize the module clock, configure the input pins (PHASEA, PHASEB, INDEX/PRESET, HOME/ENABLE) based on use case, configure the TRIGGER and POSMATCH ICAP[3:1] signal if necessary.
  2. After configured, EQDC's Revolution Counter, Position Counter, Position Difference Counter, Last Edge Time Counter, and Position Difference Period Counter start to work based on configurations. Input signal PHASEA, PHASEB, INDEX/PRESET, HOME/ENABLE are filtered by digital glitch filter before feeding EQDC counters. The EQDC counters values are saved to each hold registers at the proper time, taking a snapshot of the counters' values allows a consistent view of a system's position and the velocity to be attained.

How this driver is designed to make this peripheral works

EQDC driver's initialize function EQDC_Init initializes the EQDC based on configuration structure eqdc_config_t. This function convers all the EQDC configurations. Generally EQDC is ready to work after calling this function. The function EQDC_GetDefaultConfig helps to fill the eqdc_config_t with default values.

Besides EQDC_Init for the whole module configuration, there are smaller flexible functions used for runtime setting, including:

When EQDC is working, EQDC driver provides functions to get the counter registers value, revolution count value, position difference value, last edge time, position difference period.

How to use this driver

  1. Prepare the module clock, configure the input pins according to real use case, configure output pin if it is used.
  2. Prepare the configuration eqdc_config_t, initialize the EQDC using EQDC_Init.
  3. When EQDC started running, call the value get APIs to get the required register value to calculate position and speed.