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.

EPWM1 on OMAP-L138

Other Parts Discussed in Thread: OMAPL138, OMAP-L138

Thank you for your support and help.

 Right now I am trying to make ePWM1A working.

Usually – PWM setup is relatively easy but his time – ePWM1A is not working as expected.

This problem with ePWM1 is getting urgent for us.

I use the following settings.

  1. TBCL register = 0xC0B8 (Free run, CLKDIV=0, HSPCLKDIV=1 (default),SWFSYNC=0, SYNCOSEL=3(disabled), PRDLD=1,PHSEN=0, CTRMODE=0(counter up)
  2. TPRD register= 0x4E1F= 20,000d –160MHz/2/20000=4KHz. I need 4KHz square wave
  3. CMPB register = 0x2710= 10,000d  for 50% duty cycle
  4. CMPCTL register = 0x0050 – SHDWBMODE=1, SHDWAMODE=1 – immediate mode for both and only CMPB register is used
  5. AQCTLA= 0x030C – CBU=3 (toggle), CAU=0 (don’t care NU),PRD=3 (toggle)

ePWM1A output shows no activity. (The PINMUX5 set correctly - I checked it)

TBCNT register (which is the counter itself) is always =’0’.

When I am writing something to TBCNT – it stays unchanged.

That means TBCNT is not incrementing.

I don’t see any “enable bits for TBCNT.  The TBCLK is defined as SYSCLKOUT2/2 = 80MHz.

TBCNT register is a counter itsef. Is it correct?

TBCNT must increment with my registyers settings. Is it correct?

Will I see the TBCNT running when EPWM is working correctly?

Can you give me the idea why TBCNT is not running?

 

Thank you,

 

Boris

Dear E2E:

 

  • Hi

    Can you check if the following post helps

    http://e2e.ti.com/support/dsp/omap_applications_processors/f/42/t/43896.aspx#153579 (this is for OMAPL137/C6747, but the initialization steps should be very similar for OMAPL138)

    The key thing to look for would be the SUSPRC register in SYSCFG , as well as TBCLKSYNC bit in CFGCHIP1 also in SYSCFG module.

    Regards

    Mukul

  • Hi Mukul.

    Thank you for your help.

    I set TBCLKSYNC bit in CFGCHIP1 and EPWM1A is running after that.

    I did not change the default in SUSPSRC register in OMAP-L138 SYSCFG module.

    I use GEL file to initialize EPWM1A.

    One thing looks strange: I need to run GEL twice for EPWM1A to start running.

    After the first GEL run - EPWM1A output has an output of ~VDD/2 (~1.6V in my case).

    I checked the registers - they all set OK after the first GEL run.

    Can you give me the idea - why this happened?

    Thank you,

    Boris