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.

AM62X-RESTRICTED-SW: The TZ function setting for AM62X PWM does not work

Part Number: AM62X-RESTRICTED-SW
Other Parts Discussed in Thread: AM620, SYSCONFIG

  • Hardware Platform: AM62X SKEVM
  • CCS: 12.8.1
  • SDK: mcu_plus_sdk_am62x_10_01_00_33
  • Example Project: epwm_duty_cycle_sync_am62x-sk_m4fss0-0_freertos_ti-arm-clang

    The code is detailed in the attachment.

    epwm_duty_cycle_sync_am62x-sk_m4fss0-0_freertos_ti-arm-clang.zip 

    Hi  TI Experts 
  • I am using TI's EV board and configuring the SPI0_D1/B14 pin as a TZ0 input. 
  • Then configure it in the PWM initialization.
  • Then, when I input high and low levels on the input pin, the PWM does not stop or turn off its output.To verify whether the signal is actually being input, I configured this pin as a GPIO input, and could see the switching between high and low levels in the software simulation.
    May I ask if there are any errors in my above configurations?
  •  
  • Hi, I will take a look, allow a day or two to come back to you

    Paula

  • Hi,any update?

  • Hi Ye, sorry for my late reply.

    After code inspection, one thing that you can try is to enable TZ0 at the beginning and configure Trip Actions to see if output works, something like below snipped code

        /* Configure trip zone Submodule */
        /* Enable TZ0 input as trip source for cycle-by-cycle trip */
        EPWM_tzTripEventEnable(gEpwm0BaseAddr, EPWM_TZ_EVENT_CYCLE_BY_CYCLE, 0U);
        /* Configure trip actions - force outputs low on trip */
        EPWM_tzTriggerTripAction(gEpwm0BaseAddr, PWMSS_EPWM_TZCTL_TZA_LOW_STATE, EPWM_OUTPUT_CH_A);
        EPWM_tzTriggerTripAction(gEpwm0BaseAddr, PWMSS_EPWM_TZCTL_TZB_LOW_STATE, EPWM_OUTPUT_CH_B);
    

    FYI, we have an example EPWM TZ for AM243x in our MCU+SDK: AM243x MCU+ SDK: EPWM trip zone 

    AM243x example is a bit different as it doesn't configure Trip Action, it is more a SW PWM functionality test (GPIO High -> TZ triggers -> Semaphores/ISR -> clear and increase counters -> next loop iteration).

    Another main difference I observed was in AM243x's EPWM TZ code uses SOC_allowEpwmTzReg() function for temporarily enabling writes. This SOC function is not in AM62x SOC driver, so probably not needed.

    In any case, there are some differences, but still, it is a working example if you want to take a look.

    thank you,

    Paula

  • Hi, I downloaded and read the AM243x examples, but they aren't referenceable because the drive library functions are all different. Could you please help write and test the TZ code based on the AM62x routine? This project is extremely urgent, and we're only blocking at this point. Thank you.

  • According to the requirements of TI's domestic FAE, I have made the modifications based on the TI routine with minimal changes. The three screenshots show the modifications compared to the original TI routine. Regarding the memory, I found that the registers related to TZ have not been modified correctly. The attachment includes the program package and memory information. I checked the register datasheet again and found no further configurable items.

    4213.epwm_duty_cycle_sync_am62x-sk_m4fss0-0_freertos_ti-arm-clang.zipPWM0.dat

    Please directly provide me with a usable configuration that only enables the TZ function, and just tell me directly how to configure it.

  • sync status from customer.

    customer expects us to support them ASAP as they will get new PCB design and try to verify this feature in next week.

    would you please help check the code change and register dump? then give suggestions? Customer hope TI can verify this feature on TI EVM then provide to them.

    thanks a lot!

    yong

  • Ye, Yong, I will start working in reproducing it. Please bear with me if I have further questions

    Paula

  • Dear Anxiao.

    it needs call SOC_allowEpwmTzReg() to unlock the access(write) to TZ register.

    please apply below patch to epwm_duty_cycle demo in MCU+ SDK.

    step1: preapre one SD card, copy epwm_duty_cycle demo binary with patch applied.

    step2: probe AM620 ball A13 and B14. and use a cable to connect B14 to 3.3V power rail by default.

    step3: power on the board. check there is PWM wave on ball A13.

    step4: plug out and plug in the cable quickly. check there is no PWM wave output when ball B14 is low.

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/0001_2D00_am62x_2D00_enable_2D00_ePWM_2D00_CBC_2D00_TZ_2D00_not_2D00_enable_2D00_TZ_2D00_INT.patch

    thanks a lot!

    yong

  • Dear Anxiao.

    would you please check if you need TZ event interrupt in your application?

    Dear Paula.

    I found there is no TZ interrupt number generated by sysconfig tool.

    Also, I think TZ event interrupt only can route to ICSSM0 and GIC (A53), see below table in TRM. 

    so this interrupt can not be routed to M4F, right?

    thanks a lot!

    yong

  • Hi Yong, your understanding is correct.

    Thank you

    Paula

  • We don't need the interrupt function; we only require the TZ-triggered PWM shutdown function (CBC). Please promptly conduct tests and verification based on TI's DV board. Thank you.