AM62L FreeRTOS SDK  11.00.00
EQEP Capture

Introduction

This example demonstrates eQEP capture test. Example configures the eQEP and captures the quadrature input signal at index event. Example also configures the eQEP to calculate frequency using unit timeout event. Based on the position count values, it calculates the frequency of the input signal. EQEP signal is generated using GPIO pin toggling. GPIO pins need to be looped back to the EQEP pins that are available in the board. Below is the connection details.

AM62LX-EVM

  • This example uses the user expansion connector (J2) in the board for testing on AM62LX-EVM.
  • 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

For AM62L EVM PROC181E1:

  • The pin FET_SEL0 (S0) is connected to the TCA6424 IO expander, hence it requires the user to write to the IO expander through software to give it a high signal for GPIO Expansion Connector (J2) to work. By default, this has been done through sysconfig for this example.

For AM62L EVM PROC181E1-1:

  • The pin FET_SEL0 (S0) is connected to the J29 Expansion connector, hence it requires the user to connect the Pin 1 and Pin 2 of J29 to give pin S0 a high signal for GPIO Expansion Connector (J2) to work. This needs to be done by the user to receive signals on the GPIO Expansion Connector (J2).

Below is the connection details.

GPIO EQEP
Gpio0_18(Pin 29 of J2) EQEP0_A(Pin 19 of J2)
Gpio0_19(Pin 30 of J2) EQEP0_B(Pin 14 of J2)
Gpio0_20(Pin 27 of J2) EQEP0_S(Pin 12 of J2)
Gpio0_21(Pin 23 of J2) EQEP0_I(Pin 15 of J2)

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_capture/

Steps to Run the Example

See Also

EQEP

Sample Output

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

EQEP Capture application started...
Sending quadrature wave for 50 cycles in clockwise direction.With index event in between, Captures 4 edges per cycle
Quadrature input capture test clockwise direction passed
Sending quadrature wave for 50 cycles in anticlockwise direction.With index event in between, Captures 4 edges per cycle
Quadrature input capture test anti clockwise direction passed
Starting Frequency calculation test
Expected Frequency is 500 Hz
Average frequency is 500 Hz
Frequency calculation test passed
All tests have passed.