EQEP frequency measurement

Introduction

This example uses the EQEP to measure frequency of a signal generated by ePWM.

The example does the below

  • Configures EPWM to generate a signal and EQEP to measure frequency of this generated signal (a loopback connection is required).

  • The application runs for the specified time and the frequency calculation is done using the EPWM ISR.

  • After the specified time, the application checks if the measured frequency was within range of the generated frequency.

External Connections

  • Connect eQEP0A to ePWM0A (simulates eQEP Phase A signal)

  • Connect eQEP0B to ePWM0B (simulates eQEP Phase B signal)

  • Connect eQEP0I to GPIO48 (simulates eQEP Index Signal)

AM263X-CC

When using AM263x-CC with TMDSHSECDOCK (HSEC180 controlCARD Baseboard Docking Station)

  • Connect Boosterpack header Pin 11 to eQEP0/SFDM1 Header J24 Pin 1

  • Connect Boosterpack header Pin 59 to eQEP0/SFDM1 Header J24 Pin 2

  • Connect Boosterpack header Pin 40 to eQEP0/SFDM1 Header J24 Pin 3

AM263X-LP

  • Connect eQEP0A to ePWM0A (simulates eQEP Phase A signal)

  • Connect eQEP0B to ePWM0B (simulates eQEP Phase B signal)

  • Connect eQEP0I to GPIO48 (simulates eQEP Index Signal)

  • Connect Boosterpack header J2/J4 Pin 11 to J15 pin 2

  • Connect Boosterpack header J6/J8 Pin 59 to J24 pin 3

  • Connect Boosterpack header J2/J4 Pin 40 to J24 pin 2

External Connections

  • Connect EPWM0A to EQEP2A (EPWM simulates EQEP signal)

  • Connect J3 Pin 24 (EPWM0A) to J3 Pin 28 (EQEP2A)

External Connections

This example uses the Debug Header(J3) on Audio expansion card 1 for testing on AM62DX-EVM.

  • Connect EPWM0A to EQEP0A (EPWM simulates EQEP signal)

  • Connect J3 Pin 13 on AEC1 (EPWM0A) to J3 Pin 8 on AEC1 (EQEP0A)

External Connections

AM62X-SK

  • Connect EPWM0A to EQEP2A (EPWM simulates EQEP signal)

  • Connect J3 Pin 24 (EPWM0A) to J3 Pin 28 (EQEP2A)

AM62X-SIP-SK

  • Connect EPWM0A to EQEP2A (EPWM simulates EQEP signal)

  • Connect J3 Pin 24 (EPWM0A) to J3 Pin 28 (EQEP2A)

AM62X-SK-LP

  • Connect EPWM0A to EQEP2A (EPWM simulates EQEP signal)

  • Connect J3 Pin 24 (EPWM0A) to J3 Pin 28 (EQEP2A)

Supported Combinations

Steps to Run the Example

  • When using CCS projects to build, import the CCS project for the required combination and build it using the CCS project menu (see Using SDK with CCS Projects).

  • When using makefiles to build, note the required combination and build using make command (see Using SDK with Makefiles)

  • Establish connections as mentioned in External Connections section

  • View the UART console logs for results

See Also

EQEP

Sample Output

Shown below is a sample output when the application is run,

EQEP Frequency Measurement Test Started ...
Please ensure EPWM to EQEP loopback is connected...
Please wait 10 seconds ...
Expected frequency = 10000 Hz, Measured frequency = 10000 Hz
EQEP Frequency Measurement Test Passed!!
All tests have passed!!