Using RA Smart Configurator V5.4.0 add 8 new GPT stacks in RA4M2 or RA4M3 project with the same parameters as follow:
XTAL= 8MHz, PCLKD=100MHz, Mode=Saw-wave PWM. Period=1, Period Unit=Hertz
Then the gerated code different as follow:
GPT Channel 0~3: /* Actual period: 1 seconds. Actual duty: 50%. */ .period_counts = (uint32_t) 0x5f5e100, .duty_cycle_counts = 0x2faf080, .source_div = (timer_source_div_t)0,
GPT Channel 4~7: /* Actual period: 0.67108864 seconds. Actual duty: 50%. */ .period_counts = (uint32_t) 0x10000, .duty_cycle_counts = 0x8000, .source_div = (timer_source_div_t)10,
In actual harware function, GPT Channel 4~7 not function unless manual changed the mentioned setting above to GPT Channel 0~3 setting in hal_data.c then function well. Please clarify why this issues happened? Is that RA Smart Configurator issues?
Hi Sukuan,
Can you please share your project to us. I try to replicate your problem on my e2studio, I add 8GPT channels with 1Herzt PWM output in FSP5.4.0, and then generate the project and I didn't see the code like yours:
All the channels are in same configuration.
BR,
NP_Renesas
Test_RA4M2_GPT.zip
Attached project for your verification.
Regards,
SUSH
GPT channels 0-3 are 32 bits while channels 4-7 are 16 bits so they can achieve a smaller range of period cycles.
Then how you make it all 8 gpt the same calculation as mentioned above?
Try to lower the PCLKD frequency.
Failed to make it even lower down the PCLKD=50MHZ! Can you please send me your mentioned replicated e2studiio project file for my verification and references.
Please find the attached project for reference.
RA4M2_GPT.zip
Can you please share your project files for my verification & reference?
Thank for the shared project files! Similar issues found as per mine. Anyway, thank you very much!
Not sure what the similar issues are since both channel 0 and 4 have period = 1s.