This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

ePWM Trip Zone software one-shot force fails from R5F

Part Number: AM6442

I've found an issue where the R5F cannot trigger the one-shot trip on any ePWM peripheral. Luckily the problem is very easy to reproduce:

Using AM64EVM (SR2.0) with SBL_NULL flashed, in OSPI boot mode, MCU+ SDK 08.05.00.24

1. Open CCS (I'm using 12.1.0.00007)

2. Import ePWM example from mcu_plus_sdk_am64x_08_05_00_24\examples\drivers\epwm\epwm_duty_cycle_sync\am64x-evm\r5fss0-0_nortos

3. On line 268 of app_epwm_dc.c, add the following line:

Fullscreen
1
EPWM_tzTriggerSwEvent(gEpwm0BaseAddr, EPWM_TZ_EVENT_ONE_SHOT); // trigger trip-zone to turn off ePWM0
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

4. Compile the example in debug mode

5. Put an oscilloscope probe on ePWM0 'A' (I'm probing J6 pin 7 on the PROC102E1 breakout board for the HSE connector).

6. Power on AM64EVM board, connect CCS via JTAG

7. Connect to R5F0_0 and load example

8. Place breakpoint on the line that was previously added (line 268)

9. Run the example; you should see a PWM waveform on the oscilloscope for ~60 seconds before the breakpoint on line 268 is hit.

10. Note that ePWM0 'A' is still active. Use 'step over' to execute the EPWM_tzTriggerSwEvent() function; note the PWM continues to be active (it should have turned off)!

11. In CCS, put the memory browser in 16-bit hex mode and write a value of '0x4' to 0x23000030 (this is the same write the EPWM_tzTriggerSwEvent() function was doing). On the oscilloscope you should now see that EPWM0 'A' is no longer active. Also, the flag register 0x2300002C should report back '0x4' now that the trip is latched.

In summary, when the R5F uses the EPWM_tzTriggerSwEvent() function to invoke a software one-shot force (writing 0x4 to the EPWM_TZFRC register) it has no effect. But writing to the same register using the memory browser in CCS works correctly.

I haven't been able to figure out why the R5F cannot write to the EPWM Trip Zone Force register. Note that all other PWM registers in the 0x23000000 range seem to be accessible from the R5F, which suggests this isn't a permissions or RAT translation issue. The end goal is for the R5F to be able to enable or disable the EPWM outputs via the trip zone.

Any ideas?

  • Well, as soon as I posted the question I figured out the answer.

    There are EALLOW bits in each CTRLMMR_EPWMx_CTRL register that are disabled by default. The TRM says the EALLOW bits "Enable write access to EPWM tripzone registers". After enabling these bits the trip zone works as expected.

    So the new question is: shouldn't the ePWM examples (or better yet, the ePWM driver) enable the EALLOW bits?

  • Steven, thanks for pointing out, I have passed your recommendation to the dev team and we will definitely look at this.

    Please let us know if you have any other query or can we close this thread

    Regards

    Anshu

  • Hi Anshu, if this info has been passed to dev team feel free to close this thread. Thanks!