how to set PWM as center aligned ?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how to set PWM as center aligned ?

1,371 Views
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 Kudos
4 Replies

663 Views
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 Kudos

663 Views
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 Kudos

663 Views
hotashu
Contributor III

Hi Filip,

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

0 Kudos

663 Views
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 Kudos