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:
Whether CLKOUT directly reflects the core/system clock or a divided version of it.
The correct configuration steps required to ensure the MCU runs at 40 MHz from the external oscillator.
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.