AM62L FreeRTOS SDK  11.00.00
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.

AM62LX-EVM

  • This example uses the user expansion connector (J2) in the board for testing on AM62LX-SK.
  • All pin numbers are on the expansion connector in the board.
  • The pins configured for the example is enabled on user expansion connector based on the FET selection switch(FET_SEL0).
  • The SOC_VOUT0_DATAn are the input to FET switches. The pins that are configured for the example are pinmuxed with the FET switches.
  • The S0 select pin decides if the configured pins (which is pinmuxed with SOC_VOUT0_DATAn) map to HDMI or USER EXP connector.
  • The S0 pin is triggered to a high value in the software. When the S0 is high, the pin that is configured for the example (which is pinmuxed with SOC_VOUT0_DATAn) will be available on the user expansion connector.

The below diagram depicts the selection:

S2 S1 S0 IP(nA)/OP(nB1 (Or) nB2)
H H L nA=nB1 -> SOC - HDMI
H H H nA=nB2 -> SOC - GPIO EXP CONN

Below is the connection details.

  • Connect EPWM0A to EQEP0A (EPWM simulates EQEP signal)
  • Connect J2 Pin 18 (EPWM0A) to J2 Pin 19 (EQEP0A)

Supported Combinations

Parameter Value
CPU + OS a53ss0-0 nortos
a53ss0-0 freertos
Toolchain arm.gnu.aarch64-none
Board am62lx-evm
Example folder examples/drivers/eqep/eqep_frequency_measurement/

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
  • To Load and Run an example (see Application Run and debugging using CCS)
  • 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!!