Hi,
I am currently developing a project using the S32K312 MCU.
I have configured the SPI module as shown below, but the measured clock period does not match the configured Baudrate.
Configured Baudrate: 1,500,000 bps (1.5 Mbps)
Expected Clock Period: ~0.667 us
Measured Clock Period: 1.320 us (Equivalent to approx. 757.58 kbps)
As shown in the attached oscilloscope screenshot, the △T between the clock edges is 1.320 us, which is nearly half the speed of my target baudrate.
Could you please guide me on what might be causing this discrepancy? (e.g., peripheral clock divider settings, protocol clock configuration, or specific register settings in the S32K3 SPI module).
Any advice or check-lists would be greatly appreciated.
Thank you in advance!
I have fixed the issue by changing the clock settings. Thank you so much for your help!
Hi
Did you configure the SpiPhyUnit -> SpiPhyUnitClockRef according to the "24.6.1.1.5 LPSPIn clocking" of S32K3XXRM Rev12?
The LPSPI0 of S32K312 should select: /Mcu/Mcu/McuModuleConfiguration/McuClockSettingConfig_0/AIPS_PLAT_CLK
The LPSPI1\2\3 of S32K312 should select:
/Mcu/Mcu/McuModuleConfiguration/McuClockSettingConfig_0/AIPS_SLOW_CLK
Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "ACCEPT AS SOLUTION" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Can you upload the full SPI waveform including CS, CLK, MISO and MOSI?