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.

TMS320F28388D: How to input eCAP4 APWM to CLB.

Part Number: TMS320F28388D
Other Parts Discussed in Thread: SYSCONFIG

Hi experts,

My customer wants to input eCAP4 APWM to CLB.
They set the CLB4 register settings as follows, but no APWM signal is input.

CLB_configLocalInputMux(CLB4_BASE,CLB_IN2,CLB_LOCAL_IN_MUX_ECAP_ECAP_OUT);
CLB_configGPInputMux(CLB4_BASE, CLB_IN2, CLB_GP_IN_MUX_EXTERNAL);

When ePWM was input to CLB as shown below, the PWM signal was input correctly.

CLB_configLocalInputMux(CLB4_BASE, CLB_IN2, > CLB_LOCAL_IN_MUX_GLOBAL_IN);
CLB_configGlobalInputMux(CLB4_BASE, CLB_IN2, CLB_GLOBAL_IN_MUX_EPWM2A);
CLB_configGPInputMux(CLB4_BASE, CLB_IN2, CLB_GP_IN_MUX_EXTERNAL);

Also, if they jumper the eCAP4 APWM to GPIO INPUT6 as shown below, the APWM will be correctly input to the CLB.

CLB_configLocalInputMux(CLB4_BASE, CLB_IN2, CLB_LOCAL_IN_MUX_INPUT6);
CLB_configGPInputMux(CLB4_BASE, CLB_IN2, CLB_GP_IN_MUX_EXTERNAL);

They want to input the eCAP APWM to the CLB inside the device, not the jumper, so I want it to work with the top settings.
Please tell me how to input the APWM of eCAP to CLB.

Best regards,
Sasaki

  • Hi Sasaki,

    You can try using the CLB XBAR to route the eCAP signal into the CLB. ECAP4 OUT is available on MUX 06 of any of the CLB XBAR crossbars. After, you can route this CLB XBAR as an input into the CLB through the Global Mux. It should look something like the below

    	XBAR_setCLBMuxConfig(XBAR_AUXSIG0, XBAR_CLB_MUX06_ECAP4_OUT);
    	XBAR_enableCLBMux(XBAR_AUXSIG0, XBAR_AUXSIG0_ENABLED_MUXES);
    	
    	CLB_configLocalInputMux(CLB4_BASE, CLB_IN2, CLB_LOCAL_IN_MUX_GLOBAL_IN);
    	CLB_configGlobalInputMux(CLB4_BASE, CLB_IN2, CLB_GLOBAL_IN_MUX_CLB_AUXSIG0);
    	CLB_configGPInputMux(CLB4_BASE, CLB_IN2, CLB_GP_IN_MUX_EXTERNAL);

    Regards,

    Peter

  • Hi Peter-san,

    Thank you for your support.

    With the code you provided, my customer was able to input the eCAP APWM signal to the CLB.

    The method presented is to use AUX with global input, but why can't I enter eCAP with local input? Looking at the manual, it looks like you can also enter eCAP into CLB with local input.

    Best regards,
    Sasaki

  • Hi Sasaki-san,

    Yes you should be able route ECAP4 out through either Local or Global, since the signal is available on both. I'm not sure why the customer's code was not working. Using the SysConfig tool to generate the local ecap signal gives me the following 

    	//CLB4 CLB_IN2 initialization
    	CLB_configLocalInputMux(CLB4_BASE, CLB_IN2, CLB_LOCAL_IN_MUX_ECAP_ECAP_OUT);
    	CLB_configGlobalInputMux(CLB4_BASE, CLB_IN2, CLB_GLOBAL_IN_MUX_EPWM1A);
    	CLB_configGPInputMux(CLB4_BASE, CLB_IN2, CLB_GP_IN_MUX_EXTERNAL);

    I don't believe the CLB_configGlobalInputMux() call is necessary, but you can have the customer try that. One other thing of note is that there is an ECAP_OUT_EN signal on the local bus which acts as an enable on the ECAP output. This is so, if needed, you can tristate the ECAP output when ECAP is in APWM mode. This may affect your ability to route the ECAP as a local signal.

    Nonetheless, it looks like using the XBAR and routing the ECAP output as a global signal worked. Please reach out if you have any other questions.

    Regards,

    Peter

  • Hi Peter-san,

    Thank you for your support.

    My customer test the forllowing program. But they tested this and ECAP4 OUT was not input to CLB.

    //CLB4 CLB_IN2 initialization
    CLB_configLocalInputMux(CLB4_BASE, CLB_IN2, CLB_LOCAL_IN_MUX_ECAP_ECAP_OUT);
    CLB_configGlobalInputMux(CLB4_BASE, CLB_IN2, CLB_GLOBAL_IN_MUX_EPWM1A);
    CLB_configGPInputMux(CLB4_BASE, CLB_IN2, CLB_GP_IN_MUX_EXTERNAL);

    I would like to know how to use ECAP_OUT_EN.
    Do I set ECAP_OUT_EN in the eCAP register? I could not find the bit field to set ECAP_OUT_EN in the register.
    What should I set if I want my ECAP output to be tri-state?

    Best regards,
    Sasaki

  • Hi Sasaki-san,

    Yes there should be an ECAP_OUT_EN bit that you can set. I will assign this over to the eCAP expert to assist on that

    Regards,

    Peter

  • Sasaki-san,

    We are closing the thread, as we are discussing in another thread on this topic.

    Thanks & Regards,

    Santosh