@Senlent ,
I'm trying to configure some PWM output signals in EMIOS 0 and EMIOS 1 instances to generate up t0 20KHz frequency.
S32 Design Studio for S32 Platform
Version: 3.5
S32k312 evaluation board
Below are my configurations screen shots for reference





Currently, global clock for EMIOS 0 and 1 are 160 MHz.
For testing, I tried to generate 1000 Hz and 50 % duty cycle. The scope result is not as expected. Only duty cycle is correct and frequency is not correctly displayed.
#define PWM_CLOCK_FREQUENCY (120000000U)
#define PWM_PRESCALAR (3U)
#define PWM_DIV_FREQUENCY ((PWM_CLOCK_FREQUENCY/PWM_PRESCALAR))
pwm_Frequency = 1000U;
Pwm_Period[pwm_ChannelId] = (PWM_DIV_FREQUENCY/pwm_Frequency);
Pwm_DutyCycle[pwm_ChannelId] = ((Pwm_Period[pwm_ChannelId] * pwm_DutyCycle)/100);
Below API's are called in the code for frequency & duty cycle.
Emios_Pwm_Ip_SetPeriod(INSTANCE_0, Emios_Pwm_Ip_I0_Ch0.ChannelId, Pwm_au16Period[pwm_ChannelId]);
Emios_Pwm_Ip_SetDutyCycle(INSTANCE_0, Emios_Pwm_Ip_I0_Ch0.ChannelId, Pwm_DutyCycle[pwm_ChannelId]);
Also, what is the purpose of Emios_Mcl_Ip_SetCounterBusPeriod() API. Do we need to call one time on initialization or every time when new frequency and duty cycle are called.
Please let me know if anything configured incorrectly
Thank you,