Hello, we encountered a strange phenomenon while using the PWM output function with the s32k312. When configuring the clock divider value at the EMIOS_MCL layer for global frequency division, we found it did not work, but configuring the channel frequency divider was effective. For example, when the system clock frequency is 120MHz, if we set the global frequency division to 120 and the channel frequency division to 10, with a period tick of 50,000, the output frequency is 240Hz. However, if we set the global frequency division to 1 and the channel frequency division to 10, with the same period tick of 50,000, the output frequency remains 240Hz.
已解决! 转到解答。
In your project, you didn't enable UCPREN bit.
eMIOS_Cn.UCPREN = 0:
eMIOS_Cn.UCPREN = 1:
Hi@fengba_360
"However, if we set the global frequency division to 1 and the channel frequency division to 10, with the same period tick of 50,000, the output frequency remains 240Hz"
I think this is wrong. It should still change. You can test it again.
Hello, I have conducted another round of actual measurements, and here are my results. I set the global frequency division to 10 and the channel frequency division to 12. Based on theoretical calculations, the final frequency of this channel should be 1MHZ, with a tick of 50,000, resulting in an output frequency of 20HZ. However, when I measured it with an oscilloscope, the actual output frequency was 200HZ.
Received, thank you. However, when I use the EMIOS ICU to measure PWM input and select the EMIOS_ICU_BUS_INTERNAL_COUNTER, the global frequency divider does indeed take effect. As shown in the figure below, I am somewhat confused. Could you please help clarify this?