how to set PWM as center aligned ?

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

how to set PWM as center aligned ?

1,687 次查看
hotashu
Contributor III

I use K40 with processor expert, PWM_LDD bean. it seems no place to set it as center aligned. how to do this ?

hotas

0 项奖励
回复
4 回复数

979 次查看
sergigomis
Contributor III

Hello.

You can program the registers directly.

1st.  Configure the Processor Expert PWM.

2on. After Processor Expert Initialitzation  "PE_low_level_init();", set this code:

FTM0_MODE |= 1<<2;           // Write Protection Disable (1)

FTM0_SC |= 1<<5;                // Center Aligned PWM  CPWMS=1

FTM0_MODE &= 1<<2;        // Write Protection Enable (0)

This code works for me on K22.

Change FTMx to used Timer.

Regards.

0 项奖励
回复

979 次查看
vfilip
NXP Employee
NXP Employee

Hello, I have got info from developers that this component does not provide such feature and in case you need this feature please use corresponding initialization component + PDD macros.

Anyway, it would very helpful for us if you could provide more details about your project.

best regards

Vojtech Filip

Processor Expert Support Team

0 项奖励
回复

979 次查看
hotashu
Contributor III

Hi Filip,

i never used PDD before. is there any sample on how to use PDD macro?

0 项奖励
回复

979 次查看
vfilip
NXP Employee
NXP Employee

Hello,

I would recommend to download CW V10.4 and follow the steps within this thread: How to use PDD macros in CW V10.4 step by step

Best Regard

Vojtech Filip

Processor Expert Support Team

0 项奖励
回复