Dear Renesas team,
I have an issue with an symmetric pwm mode:
I set the duty cycle it from 0% to 5% to 100% to 5% and so on like that:
while(1)
{
R_GPT_DutyCycleSet(g_timer0.p_ctrl, 0, GPT_IO_PIN_GTIOCA); // 0% duty cycle
// Wait some time
R_GPT_DutyCycleSet(g_timer0.p_ctrl, 1200, GPT_IO_PIN_GTIOCA); // 5% duty cycle
R_GPT_DutyCycleSet(g_timer0.p_ctrl, 24000, GPT_IO_PIN_GTIOCA); // 100% duty cycle
// wait some time
}
The problem is the switch from 0% to 5% results in 5% ... but the switch from 100% to 5% results in 95% ... so actually the inverse.
I added an example for the RA2E1 EVK that you can see thatTest_PWM.zip
You can measure the PWN here on P103. You see there 0% duty cycle for 5sec, then 5% duty cycle for 5 secs,, then 100% duty cycle for 5 secs and the 95% for 5 secs
Hi Stefan,
The R_GPT_DutyCycleSet api is based on your current PWM period.
So could you have a test to change your duty cycle in the following way:
Regards,
NP_Renesas
Dear Renesas-Team,
no ... sorry ... it is the same behaviour.
I justed checked and calculated the period_count every time before setting the duty cycle.
Kind regards
Stefan
After checking your project, find that the project using symmetric pwm and output reatain mode.
That will cause the output values after releasing 100% duty change.
You can check 20.3.6 in this document for more informarion:
RA2E1 Group User's Manual: Hardware (renesas.com)
So, I suggest changing the following sets (retain settings) as you need:
Hope it helps,
Dear Renesas Team,
at a first check, it seems to work by enabling the custom waveform.
I will do more tests on monday and will verify the settings here.