FILE: ecap_ex2_capture_pwm.c
This example configures MCPWM1A for:
- Up count mode
- Period starts at 500 and goes up to 8000
- Toggle output on PRD
eCAP1 is configured to capture the time between rising and falling edge of the MCPWM1A output.
External Connections
- eCAP1 is on GPIO2
- MCPWM1A is on GPIO0
- Connect GPIO0 to GPIO2.
Watch Variables
- ecap1PassCount - Successful captures.
- ecap1IntCount - Interrupt counts.