ECAP APWM Generation

Brief

Generate and verify APWM signals from ECAP with internal loopback capture

Details

This example demonstrates generating Auxiliary PWM (APWM) signals using the ECAP module and verifying the generated signals through internal loopback capture. APP_ECAP_APWM generates test APWM signals with various frequencies and duty cycles via the Auxiliary PWM mode. APP_ECAP_CAPTURE captures the generated signal through OutputXBar to measure and verify High time, Low time, Total period, and Duty cycle percentage.

Block diagram

Signal Routing: The APWM output from APP_ECAP_APWM is routed internally through OutputXBar to APP_ECAP_CAPTURE for verification APP_ECAP_APWM -> OutputXBar -> APP_ECAP_CAPTURE

Test Cases: The example runs 10 different test cases with varying APWM configurations:

  • Frequencies: 1kHz to 100kHz

  • Duty cycles: 10% to 90%

Validation: Measured values are compared against expected values with a ±5% tolerance, and results are logged

Peripherals used

ECAP
  Instance  : APP_ECAP_APWM
     Mode        : APWM
     Clk         : 250MHz
     Period      : 19999 (10KHz initial)
     Compare     : 5000 (25% duty initial)
ECAP
  Instance  : APP_ECAP_CAPTURE
     Input       : APP_OUTPUTXBAR
     Mode        : Capture
     Clk         : 250MHz
     Edges       : R F R
     Interrupt   : On event3
OUTPUTXBAR
  Instance  : APP_OUTPUTXBAR
     Src         : ECAP - APP_ECAP_APWM
     Dest        : ECAP - APP_ECAP_CAPTURE

External connections

No external connections required

LED Details: PASS LED (LED5), FAIL LED (LED4)