Hi,
I need an example of how to use the HRPWM of the MKV46.
What this note means?
"NOTE: FRCTRL[FRAC23_EN] should be set to 0 when the values of VAL2 and VAL3 cause the high or
low time of the PWM output to be 3 cycles or less."
Ari.
Solved! Go to Solution.
Hi, Ari,
The Note says that "FRCTRL[FRAC23_EN] should be set to 0 when the values of VAL2 and VAL3 cause the high or low time of the PWM output to be 3 cycles or less.", Assume that the PWM is set up in edge alignment mode, PWMA0 pin will become high when the PWM counter reaches up to VAL2, the PWMA0 pin will become low when the PWM counter reaches up to VAL3, when the (PWMA_SMxVAL2-PWMA_SMxINIT) or (PWMA_SMxVAL1-PWMA_SMxVAL3) are equal to or less than 3, the fractional PWM function will have problem. In other words, user should select VAL2 and VAL3 register so that the (PWMA_SMxVAL2-PWMA_SMxINIT) or (PWMA_SMxVAL1-PWMA_SMxVAL3) are greater than 3 if user wants to use fractional PWM function.
Regarding the PWM example using the fractional PWM cycle, I am developing the code, I will paste here when I finish it.
BR
XiangJun Rong
Hi, Ari,
The Note says that "FRCTRL[FRAC23_EN] should be set to 0 when the values of VAL2 and VAL3 cause the high or low time of the PWM output to be 3 cycles or less.", Assume that the PWM is set up in edge alignment mode, PWMA0 pin will become high when the PWM counter reaches up to VAL2, the PWMA0 pin will become low when the PWM counter reaches up to VAL3, when the (PWMA_SMxVAL2-PWMA_SMxINIT) or (PWMA_SMxVAL1-PWMA_SMxVAL3) are equal to or less than 3, the fractional PWM function will have problem. In other words, user should select VAL2 and VAL3 register so that the (PWMA_SMxVAL2-PWMA_SMxINIT) or (PWMA_SMxVAL1-PWMA_SMxVAL3) are greater than 3 if user wants to use fractional PWM function.
Regarding the PWM example using the fractional PWM cycle, I am developing the code, I will paste here when I finish it.
BR
XiangJun Rong
Hi,
This is the example code for high resolution PWM developed under KDS ver3.0 and SDK version1.2, because the setting MCG is complicated, I use SDK to set up the MCG so that the KV46 can run in 100MHz.
//pls modify the system_MKV46F15.h with the following code so that the KV46 can run in 100MHz as core/system frequency, fast bus clock is 100MHz
#ifndef CLOCK_SETUP
define CLOCK_SETUP 4
#endif
BR
XiangJun Rong