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.

[DRA829]Question about Timer and PWM in DRA829

Other Parts Discussed in Thread: DRA829

Hi,

I have some questions,and please help me resloved!

1. In cslr_main_ctrl_mmr.h file (line:2003)  we can find there has CSL_MAIN_CTRL_MMR_CFG0_TIMER0_CTRL   (0x00004200U),and in cslr_mcu_ctrl_mmr.h (line:486) we can also find CSL_MCU_CTRL_MMR_CFG0_MCU_TIMER0_CTRL   (0x00004200U),,The queation is these two register has same address and base address. but how do we distinguish them? And if we use both MCU Timer0 and MAIN timer0 at same time, how should we use?

2.If we use PWM function we must config a clock source which is timer I think,The question is how should we associate PWMn with timern? For example if we use PWM_CHANNEL1 what timer should we use?

Thanks,

Regards,

Linda Xie

  

  • Hello ,

    1. I don't have the header files in front of me, but looking in the TRM this should be the offset for both these registers. That is, you should have another define variable that states the base address, and the code should add the offset to that.

    • CTRLMMR_TIMER0_CTRL (physical address which is base address + offset) should be at 0010 4200h (for Proxy0)
    • CTRLMMR_MCU_TIMER0_CTRL (physical address which is base address + offset) should be at 40F0 4200h (for Proxy0)

    2. I will ask a PWM expert to help here. We will post another answer shortly.

    thanks,

    Alex

  • Hello again ,

    Here is what I got from the PWM owner: The ePWMs modules in DRA829 are now clocked by SYSCLK0 / 4. For details, refer to the TRM, because there are a lot more details and you will get a better understanding.

    thanks,

    Alex

  • Hi,Alex

    yes,I already read that section.And has some question,first is in TRM (page:24316) we can see Table 12-15440, this table tell as all ePWMS in MAIN domain ,however in Pwm.h (line:284-345) we also can see PWM_CHANNEL1-9 are in MCU domain,

    How should I understand that?
    Thankss,
    Regards,
    Linda Xie
  • I concur, all ePWM instances are in the MAIN domain as per documentation. We need to bring in the SDK team to comment on why it's included like that in the header file. They will respond here soon.

    thanks,

    Alex

  • Hi,Alex

    It's OK!  And I have some new queation.

    1.How many ePWM are there?

    2.What is the correspondence between PWM and PORT? For example,if we use PWM_CHANNEL3 ,then which one pin will output PWM pulse that I can use oscilloscope to capture it. I mean if there has a table to introduce the relation between ePWM and PORT.

    3.If we use ePWM should I also config a Timern as a clock source?

    Thanks,

    Regards,

    Linda Xie 

  • Hi,Alex

        Do you have any progress?Hope to reply as soon as possibile.
    Thank,
    Regards
    Linda Xie
  • Hello ,

    We have experts notified to answer this, let me escalate this so you get answers sooner.

    Thanks,

    Alex

  • Hi,Alex

    Happy to see you reply me,and I  have another question which is PwmFunctionalClock default value is 19200000 and the comment say it is 25MHz in EB.

    So my confusion is why 19200000 is 25MHz ?Is there have a formula to convern or calculate?

    Thanks,

    Regards,

    Linda Xie

  • Hi,Alex

    Do you make some progress? I also encounter a problem!!!!

    Steps is:

    1.I config two PWM channel which ID is PWM 13 and PWM 17 in EB.

    2.I initial main domain timer3 and timer7 and other configuration in my project.

    3.Download project in chip,only the PWM 13 can output PWM pulse, the PWM17 can't output PWM no matter what I do!!

    Please help me resloved the problem!

    Thanks,

    Regards,

    Linda Xie

  • Hello ,

    Please wait a bit, I am not a PWM expert and we have asked somebody to comment here soon. They should reply here very soon.

    thanks,
    Alex

  • Hi Xie Linde,

    I believe you are referring to MCUSW (MCAL) code here.

    • The channel you are referring in pwm.h file are the timer instances not the PWM instance.
    • As TRM table mentions the There are 6 EPWM instances are each having 2 output channel
    • By default we are setting the timer clock source to HFOSC0_CLK in PwmAppStartup.c file

    Our MCAL expert is on leave. We will get back on remaining queries by tomorrow.

    Regards,

    Ankur

  • Hi,Ankur

    Yeah,I have referring to MCUSW and TRM manual, and I also have some question write below here.

    1,You said the channel in pwm.h file are the timer instances not the PWM instance, so I want to know How many channel I can use? I thinking the answer  is eighteen channels,because Dra829 has ten TIMERIO channels in MCU domain and eight TIMERIO channels in MAIN domain. 

    2.First I must say thank to you for I also confuse to  HFOSC0_CLK or WKUP_HFOSC0_CLKOUT or MAIN_PLL0_HSDIV1_CLKOUT. Can you explain it to me in detail? I will be very very grateful to you.

    Thanks,

    Regards,

    Linda Xie

  • Hi Linda,

    On #1, yes on DRA829, in total we can have 18 channels.

    On #2, The Pwm example application selects default clock source, HFOSC0_CLKOUT in case of MCU and main domain timers.

    Regards, Sujith

  • Hi Linda,

    I haven't heard back from you, I'm assuming you were able to resolve your issue. If not, just post a reply below (or create a new thread if the thread has locked due to time-out).

    Regards, Sujith