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,280件の閲覧回数
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,112件の閲覧回数
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,113件の閲覧回数
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,112件の閲覧回数
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 件の賞賛
返信