hi,
i'm studying RA6M3 for a potential project. I intend to use GPT to generate a PWM. I studied the FSP configurator, select a GPT module, it looks OK, user can set the duty cycle for a PWM waveform.
but my application will be a saw-wave PWM, so I need to set value to GTCCRA and GTCCRB. but I didn't find where i can set the value for these two registers with FSP configurator? I may have to do it by directly writing registers in my code?
appreciated for your help.
The initial values for GTCCRA / GTCCRB are set via the "Duty Cycle Percent" parameter.
This will set the GTCCRA / GTCCRB to the same value.
During your application, the GTCCRA / GTCCRB registers can be set with the API call R_GPT_DutyCycleSet(), for example:
err = R_GPT_DutyCycleSet(&g_timer3_ctrl, 0x1234, GPT_IO_PIN_GTIOCA); if( err != FSP_SUCCESS ) { __BKPT(1); // error - investigate why. } err = R_GPT_DutyCycleSet(&g_timer3_ctrl, 0x5678, GPT_IO_PIN_GTIOCB); if( err != FSP_SUCCESS ) { __BKPT(1); // error - investigate why. }
Just so everyone interested doesn't need to look for the diagram in the User's Manual that helps explain what the GTCCRA / GTCCRB registers do, I have attached it below:
The full datasheet is available here: User Manual