S32k118 operating on external clock

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

S32k118 operating on external clock

686 Views
Luke_John
Contributor I

Hello,

I am configuring an NXP S32K118 to operate from an external clock source using the S32K118 LQFP48 EVB. According to the board schematic, the EVB provides a 40 MHz external oscillator. I configured the EXTAL and XTAL pins to use this external clock source.

To verify the system clock frequency, I enabled a timer and routed the system clock to a CLKOUT pin. Based on the reference manual, CLKOUT is expected to reflect the system/core clock. However, when measuring the CLKOUT signal using a PicoScope, the observed frequency is 10 MHz instead of the expected 40 MHz.

Additionally, I configured an OCU (Output Compare Unit) peripheral to generate periodic interrupts using OCU_EXTERNAL_CLOCK as its clock source. Assuming a 40 MHz clock, the expected tick period is 25 ns, so 65,530 ticks should correspond to approximately 1.6 ms. However, no interrupts are fired when using OCU_EXTERNAL_CLOCK. When switching the clock source to OCU_SYSTEM_CLOCK, the OCU operates correctly and interrupts are triggered as expected.

This suggests either:

  • The external clock is not being used as intended,

  • The system clock is being divided (e.g., by a factor of 4, explaining the 10 MHz observation), or

  • The OCU external clock source is not properly configured or routed.

Could you clarify:

  1. Whether CLKOUT directly reflects the core/system clock or a divided version of it.

  2. The correct configuration steps required to ensure the MCU runs at 40 MHz from the external oscillator.

  3. The correct usage and clock source mapping for OCU_EXTERNAL_CLOCK, and why it does not fire interrupts in this configuration.

I have attached the project for reference.

 

0 Kudos
Reply
1 Reply

639 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @Luke_John 

There seems to be some confusion regarding CLKOUT. CLKOUT does not output the raw source clock frequency directly; instead, it depends on the following configuration fields:

  • SIM_CHIPCTL[CLKOUTSEL]
  • SIM_CHIPCTL[CLKOUTDIV]

Additionally, CLKOUT is limited to a maximum frequency of 20 MHz, as stated in Section 7.5.7 of the S32K1xx Data Sheet, Rev. 15.

Regarding OCU, as you may know, it relies on the FTM module. The FTM supports three clock source options:

  • System clock (SYS_CLK): for S32K11x devices, this clock can operate at up to 48 MHz in RUN mode.
  • Fixed-frequency clock: provided by RTC_CLK.
  • External clock: selectable from SOSCDIV1_CLK, SIRCDIV1_CLK, FIRCDIV1_CLK, SPLLDIV1_CLK, or other available external clock sources.

As for the configuration itself, there is an OCU example project provided with the RTDs. I recommend taking a look at that example as a reference for the correct setup.

 

BR, VaneB

0 Kudos
Reply