2384620_en-US

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

2384620_en-US

2384620_en-US

The S32K144 chip has a clock configuration issue; the timing period changes after the clock is modified.

I encountered the following problem during the development of S32K144:

Ni__0-1782181934609.png

The initialization timer's interrupt overflow period should be 1 second.
The premise is that my clock configuration is 8MHz.

Ni__1-1782182016343.pngNi__2-1782182026827.png

However, after I changed the clock to a 20M clock...

Ni__3-1782182078529.png

Ni__4-1782182086180.png

I discovered that my timer overflow period is no longer 1 second, but has become 400 milliseconds.
However, my timer clock selection is still set to the 8MHz internal clock.

PCC->PCCn[PCC_FTM1_INDEX] |= PCC_PCCn_PCS(0x01) /* Clock src=1, 8 MHz SIRCDIV1_CLK */
| PCC_PCCn_CGC_MASK; /* Enable clock for FTM regs */

I'm not sure what configuration issue is causing this problem.


Re: S32K144芯片的时钟配置问题,更改时钟后定时周期出现变化

Hi

建议看一下S32K1 RM的Table 27-9. Peripheral module clocking (continued),FTM具体选择哪个时钟源需要查看FTMn_SC[CLKS]29.6.17 PCC FTM1 Register (PCC_FTM1)PCS位。

Table 27-9. Peripheral module clocking FTM.png

你用Processor Expert生成配置,又用baremetal方式直接操作寄存器。我不确定是否是因为调用了SDK里的API导致和你的baremetal程序冲突了。 建议debug情况下直接检查上述两个寄存器。

顺便提一句,baremetal直接操作寄存器的话建议参考S32K144_Project_FTM例程,如果想用ProcessorExpert 搭配SDK的API则建议参考ftm_periodic_interrupt_s32k144例程。

Best Regards,
Robin

标记 (1)
无评分
版本历史
最后更新:
星期三
更新人: