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
Can you please send me your project files stated as all GPT channels are same generated result?
I have already shared the project.
And here are the calculated period values in hal_data.c file:
That why I ask for it because your first statement and the given file shown different! Same issues as mine! Any recommend solution on this issue?
Maybe I loaded a wrong project. Please check this one:
RA4M2.zip
Thanks for your sharing project! But definately CH0~3 vs CH4~7 with different calculation! This calculation method is weird and the user must aware this issue when using RA Smart Configurator !
It is different because they differ on the number of bits so they can achieve different range of periods.