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
Hi Rajendra,
According with section 52.3 of the IMX6SDLRM, the clock options for the PWM module are:
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!
-----------------------------------------------------------------------------------------------------------------------
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
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!
-----------------------------------------------------------------------------------------------------------------------