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.

ECAP Examples

Other Parts Discussed in Thread: TMS320C6748

Hello,

Are there any ECAP StarterWare examples that would demonstrate the Capture and compare and PWM functionality of this peripheral anywhere?

Thank you in advance,

David.

  • Hello David,

    There is no Starterware examples to demonstrate the Capture and compare and PWM functionality of ECAP. But the demo example application demonstrate the PWM functionality of ECAP peripheral by controlling the backlight of LCD.

    Regards

    Savinay

    http://processors.wiki.ti.com/index.php/StarterWare
  • Hi Savinay,

    Could you be more specific please? I've tried looking in the demo_c674x_c6748_evmC6748\demoRaster.c and where I traced to platform_c674x_c6748_evmC6748\lcd.c function ConfigRasterDisplayEnable() that enables backlight, but only as GPIO output, not through the ECAP_PWM. 

    Thank you,

    David.

  • David,

                  Please refer StarterWare_02.00.00.05 for AM335x. The eCAP is used for brightness control in demo example. you need to refer file demoEcap.c

    Regards

    Baskaran

  • Hi Baskaran,

    My application is designed for TMS320C6748, no ARM core, there is no demoEcap.c file in StarterWare 1.20.02.02, but I'll have a look if there's anything I can use.

    Best regards,

    David.

  • David,

    Unfortunately, we don't include eCAP support in the C6748 release.  This means that there is no eCAP example application and no eCAP pinmux functionality in the platform library.  There is an ecap.c source file in the drivers folder, but using this on C6748 would require some modifications due to differences between AM335x (the device that this file was originally written to support) and C6748.

    For PWM functionality, I suggest taking a look at the ehrpwm example application for C6748.  Hope this helps.

  • Hi David,

    Send me your email and I will send you an example.

    Avi Tal
    avraham_tal@yahoo.com
  • Hi,
    If you can do without the driver and project files, here is the main code (2.5KHz on 300MHz CPU):

    *(int *)PINMUX01 &= 0x0FFFFFFF;
    *(int *)PINMUX01 |= 0x40000000;

    ECAPClockEnable(CSL_ECAP_1_REGS);

    ECAPCaptureLoadingEnable(CSL_ECAP_1_REGS);

    ECAPPrescaleConfig(CSL_ECAP_1_REGS, 61);

    ECAPOperatingModeSelect(CSL_ECAP_1_REGS, ECAP_APWM_MODE);

    ECAPOneShotREARM(CSL_ECAP_1_REGS);

    ECAPAPWMPolarityConfig(CSL_ECAP_1_REGS, ECAP_APWM_ACTIVE_HIGH);

    ECAPCounterControl(CSL_ECAP_1_REGS, ECAP_COUNTER_FREE_RUNNING);

    ECAPAPWMCaptureConfig(CSL_ECAP_1_REGS, 600*duty_cycle, 60000);

    ECAPAPWMShadowCaptureConfig(CSL_ECAP_1_REGS, 600*duty_cycle, 60000);

    ECAPCounterPhaseValConfig(CSL_ECAP_1_REGS, 600*duty_cycle);

    Enjoy.
    Avi Tal.