MCUXpresso SDK Documentation

eqdc_position

eqdc_position#

Overview#

This project shows how to sample the shaft position based on quadrature signal (PHASEA and PHASEB). This project assumes that the shaft encoder disk has 1000 lines. To count the revolution, EQDC modulo count mode is enabled, and modulus value set to 4x1000. User could also change to use the INDEX signal to count revolution.

This project setups a 1kHz signal as TRIGGER signal, the EQDC position, revolution, and position difference are loaded to HOLD registers at the edge of TRIGGER signal. In the TRIGGER signal’s ISR, the hold position values are saved to global variables, user can check the variables through freemaster. Also, these global variables are output to the debug terminal every 500ms.

Supported Boards#

MC56F80000-EVK
Hardware requirements
  • Micro USB cable

  • MC56F80000-EVK board

  • Personal Computer

Board hardware common setting
  1. Power setting:

    Connect J8 pin2 and pin3 Connect J6 pin1 and pin2 Connect J5 pin1 and pin2

  2. Reset pin setting:

    Connect J11 pin2 and pin3

  3. Debugger setting:

    Connect J13 pin 1-2, 3-4, 5-6, 7-8

Board settings
  • Board which generating quadrature signals Connects MC56F80000-EVK Board PHASEA signal J3-3 PHASEB signal J3-1 INDEX signal J1-3

Prepare the Demo
  1. Connect USB cable between the host PC and the J12 USB port on the target board. It setups Multilink and COM port in PC device manager.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board with Multilink debug configuration.

  4. Launch the debugger in your IDE to begin running the demo.

Running the demo

When the demo running, the position, revolution are shown in the terminal periodically.