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.

AM335x PWM generation with DMTIMER

Guru 15520 points

Hi,

I have question about AM335x DMTIMER.

My customer are using DMTIMER6 to generate PWM pulse(4096Hz or 4219Hz)

Case 1: generate 4096Hz

When they use CLK_32KHz as DMTIMER clock source and configure the DMTIMER register as following,

4096Hz was output successfully.

/////////////////////////////////////////////////////////////////////////

CLKSEL_TIMER6_CLK     = 0x00000002 //select CLK_32KHz

CM_PER_TIMER6_CLKCTRL = 0x00000002  //Enable

TIMER6_TCLR = 0x00000040 // PT=0,TRG=0,SCPWM=0,CE=1,PRE=0,PTV=0,AR=0,ST=0

TIMER6_TMAR = 0xFFFFFFFB

TIMER6_TLDR = 0xFFFFFFF8

TIMER6_TTGR = 0x00000000

/////////////////////////////////////////////////////////////////////////

Case 2: generate 4219Hz

But when they use CLK_M_OSC(24MHz) as DMTIMER clock source and configure the DMTIMER register as following,

they don't know why but it output about 32KHz.

/////////////////////////////////////////////////////////////////////////

CLKSEL_TIMER6_CLK     = 0x00000001 //select CLK_M_OSC(24MHz)

CM_PER_TIMER6_CLKCTRL = 0x00000002  //Enable

TIMER6_TCLR = 0x00000068 //PT=0,TRG=0,SCPWM=0,CE=1,PRE=1,PTV=010,AR=0,ST=0

TIMER6_TMAR = 0xFFFFFE9C

TIMER6_TLDR = 0xFFFFFD39

TIMER6_TTGR = 0x00000000

/////////////////////////////////////////////////////////////////////////

In case 2, I guess register configuration is fine.

From the configuration value of TCLR.PRE, TCLR.PTV, TLDR, I guess about 4220Hz should be generated.

If the register configurations are mistaken, can you please tell me.

best regards,

g.f.