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.
- This example needs IO breakout board for testing on AM64X-EVM.
- All pin numbers are on the IO break out board.
GPIO | EQEP |
Gpio0_26(Pin 3 of J7) | EQEP0_A(Pin 17 of J8) |
Gpio0_27(Pin 5 of J7) | EQEP0_B(Pin 19 of J7) |
Gpio0_43(Pin 13 of J7) | EQEP0_S(Pin 19 of J8) |
Gpio0_44(Pin 15 of J7) | EQEP0_I(Pin 17 of J7) |
Supported Combinations
Parameter | Value |
CPU + OS | r5fss0-0 nortos |
r5fss0-0 freertos |
a53ss0-0 freertos |
a53ss0-0 nortos |
Toolchain | ti-arm-clang |
arm.gnu.aarch64-none |
Board | am64x-evm |
Example folder | examples/drivers/eqep/eqep_capture/ |
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)
- Launch a CCS debug session and run the executable, see CCS Launch, Load and Run
- Please connect GPIO to EQEP pins as mentioned above in Introduction section
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.