HRPWM example for MKV46?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

HRPWM example for MKV46?

跳至解决方案
1,477 次查看
arimendes
Contributor III

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.

0 项奖励
回复
1 解答
1,176 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

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

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,177 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

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

0 项奖励
回复
1,176 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

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

0 项奖励
回复