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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

Jump to solution
589 Views
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

Tags (4)
0 Kudos
1 Solution
421 Views
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!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
2 Replies
422 Views
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 Kudos
421 Views
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 Kudos