Hello,
There is a problem about PWM output frequency, the configuration of PWM is as below:
eMIOS_Mcl configuration:
PWM channel configuration:
the frequency of this channel should be calculated by below formula:
output frequency = 160000000 / 200 / 65534 = 12.2Hz
but I got a 3.67hz waveform.
It looks like the source clock divided by 3 once again.
I have double checked the configurations and can't find any clue.
I'd like to know why this phenomenon should occur.
RTD is 2.0.1
S32DS V3.5
Thanks!
已解决! 转到解答。
Hi,
your calculation is correct, but in your project the core clock is running from FIRC, not the PLL. This makes that difference.
For clock init use below function
/* Initialize clock */
Clock_Ip_Init(&Clock_Ip_aClockConfig[0]);
BR, Petr
Hi,
your calculation is correct, but in your project the core clock is running from FIRC, not the PLL. This makes that difference.
For clock init use below function
/* Initialize clock */
Clock_Ip_Init(&Clock_Ip_aClockConfig[0]);
BR, Petr