Why in FRDM-KL03, when I mesure with timer the frequency of IRC48M reference I see 8MHz instead 48?

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

Why in FRDM-KL03, when I mesure with timer the frequency of IRC48M reference I see 8MHz instead 48?

跳至解决方案
1,309 次查看
alessiopaolucci
Contributor III

I wrote a driver for the FRDM_KL03Z's MCG module, all seems work, the only strange beahvior is that when mesure the IRC48M reference with a timer, I obtain 8MHz instead 48MHz.

Help me! Does anyone know why this happens?

Best Regards!

Alessio Paolucci

标记 (4)
0 项奖励
回复
1 解答
1,141 次查看
adriancano
NXP Employee
NXP Employee

Hi,

You can check the IRC48M frequency in a pin setting the CLKOUT pin. I tested this on the FRDM-KL03 on the pin PTA12 which is J4[3] on the board.

You need to set the following registers:

SIM_SOPT2 = SIM_SOPT2_CLKOUTSEL(7)  //Selects the IRC48M clock output on the CLKOUT pin.

SIM_SCGC5 |= SIM_SCGC5_PORTA_MASK;    //PORTA clock enabled

PORTA_PCR12 = PORT_PCR_MUX(0x05) | PORT_PCR_DSE_MASK;  //Set PTA12 to CLOCKOUT functionallity and DS on the pin

I initialized the Core at 48 MHz and the Bus clock at 24 MHz using the IRC48M internal reference clock and measured ~48 MHz on the PTA12.


Hope this information can help you

Best Regards,
Adrian Sanchez Cano
Technical Support Engineer
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,142 次查看
adriancano
NXP Employee
NXP Employee

Hi,

You can check the IRC48M frequency in a pin setting the CLKOUT pin. I tested this on the FRDM-KL03 on the pin PTA12 which is J4[3] on the board.

You need to set the following registers:

SIM_SOPT2 = SIM_SOPT2_CLKOUTSEL(7)  //Selects the IRC48M clock output on the CLKOUT pin.

SIM_SCGC5 |= SIM_SCGC5_PORTA_MASK;    //PORTA clock enabled

PORTA_PCR12 = PORT_PCR_MUX(0x05) | PORT_PCR_DSE_MASK;  //Set PTA12 to CLOCKOUT functionallity and DS on the pin

I initialized the Core at 48 MHz and the Bus clock at 24 MHz using the IRC48M internal reference clock and measured ~48 MHz on the PTA12.


Hope this information can help you

Best Regards,
Adrian Sanchez Cano
Technical Support Engineer
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复
1,141 次查看
alessiopaolucci
Contributor III

Thanks, I try this solution and, even if the waveform is very blunt, the frequency is in fact 48MHz.

Best Regards.

Alessio Paolucci

0 项奖励
回复