imx6 solo: Changing clock source for PWM

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

imx6 solo: Changing clock source for PWM

1,083 次查看
rajendrabaniyav
Contributor I

Hi,

Currently PWM is using ipg_perclk as its source. I would like to change it to 32KHz source. In clock.c I found "ckil_clk" for 32KHz, but when configured it to ckil_clk as parent for PWM, I don't see PWM working properly. Below are my queries.

1. ckil_clk is the right source for PWM for 32KHz?

2. Apart from below change, any other changes required to make it work?

static struct clk pwm_clk[] = {

        {

        __INIT_CLK_DEBUG(pwm_clk_0)

//       .parent = &ipg_perclk,

         .parent = &ckil_clk,

         .id = 0,

         .enable_reg = MXC_CCM_CCGR4,

         .enable_shift = MXC_CCM_CCGRx_CG8_OFFSET,

         .enable = _clk_enable,

         .disable = _clk_disable,

         },

Thanks

Rajendra

标签 (1)
标记 (3)
0 项奖励
3 回复数

620 次查看
CarlosCasillas
NXP Employee
NXP Employee

Hi Rajendra,

According with section 52.3 of the IMX6SDLRM, the clock options for the PWM module are:

  • ipg_clk
  • ipg_clk_32k
  • ipg_clk_highfreq
  • ipg_clk_s

On the same document is said that the ipg_clk_32k Clock is derived from the Clock Root ckil_sync_clk_root and doesn’t say that a specific configuration of CCM_CCGR bits are required. (section 18.4).


Hope this will be useful for you.
Best regards!
/Carlos

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励

620 次查看
rajendrabaniyav
Contributor I

Hi Carlos,

I have configured ckil clock source as below:

static struct clk pwm_clk[] = {

        {

        __INIT_CLK_DEBUG(pwm_clk_0)

//       .parent = &ipg_perclk,

         .parent = &ckil_clk,

         .id = 0,

         .enable_reg = MXC_CCM_CCGR4,

         .enable_shift = MXC_CCM_CCGRx_CG8_OFFSET,

         .enable = _clk_enable,

         .disable = _clk_disable,

         },

After this change PWM doesn't work, is there any other clock I can use which is not derived from PLL2?

regards

Rajendra

0 项奖励

620 次查看
CarlosCasillas
NXP Employee
NXP Employee

Hi Rajendra,

It seems that the 32KHz clock is driver from an external crystal.

Do you have an external 32 or 32.768 KHz external crystal connected to the iMX? In case that yes, is it oscillating?


Hope this will be useful for you.
Best regards!
/Carlos

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励