Hello!
The frdmkl03z_tpm_pwm_twochannel example you are using sets up its functions in a way that the resolution of the PWM is based on 100 steps in order to be simple and easy to understand (by basing its duty cycle in percentage). However, you are able to adjust the resolution. "The Edge-Aligned PWM (EPWM) Mode" section of the KL03 Sub-Family Reference Manual (p. 478) describes the way that the PWM is set up using the TPM registers. In this case the “EPWM period is determined by (MOD + 0x0001) and the pulse width (duty cycle) is determined by CnV.” So, in order to increase the resolution of your PWM to 256, you would require to adjust the value of MOD to 255. This would still depend on the values of the clock you are using and the frequency of your PWM, but as you can see in the example from the SDK that you are using, the formula to calculate the MOD value for a specific clock and frequency is: mod = (tpmClock / pwmFreq_Hz) - 1;
You can find this reference manual by clicking on this link:
https://www.nxp.com/docs/en/reference-manual/KL03P24M48SF0RM.pdf
Regards,
Edwin.