Defineing multiple PWM componants on one TimmerUnit

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

Defineing multiple PWM componants on one TimmerUnit

Jump to solution
942 Views
avnergidron
Contributor III

Hi,

I am using the PE on the KDS 3.0.0 and kl25z128.

What I want to do is to define multiple PWM components on one TimerUnit(TPM) using its channels.

When I use the PE to define the PWM is gives me a warning saying that the enable function of one PWM component may affect the others that are defined on the same TimerUnit.

I ran code and that exactly what heppened. When I enabled one of the PWM the others strted to work also.

Is there a way to use each channel of the TimerUnit separately?

Thanks in advance!

Avner

Tags (3)
0 Kudos
Reply
1 Solution
741 Views
marek_neuzil
NXP Employee
NXP Employee

Hello,

The Enable/Disable methods of the PWM component cause enable/disable of the whole TPM device (timer). Therefore you cannot use these methods for shared timer of the TPM device. You must use methods that control the TPM channels (PWM channels) only. For example you can set duty to 0% or 100% to set the required level output level of the pin or you can disconnect the channel pin by clearing MSB, MSA, ELSB and ELSA bits of the TPMx_CnSC register. In this case you can use for example PDD macros:

TPM_PDD_SelectChannelMode(TPM0_BASE_PTR, 0, TPM_PDD_OUTPUT_NONE);

TPM_PDD_SelectChannelEdgeLevel(TPM0_BASE_PTR, 0, TPM_PDD_EDGE_NONE);

Best Regards,

Marek Neuzil

View solution in original post

1 Reply
742 Views
marek_neuzil
NXP Employee
NXP Employee

Hello,

The Enable/Disable methods of the PWM component cause enable/disable of the whole TPM device (timer). Therefore you cannot use these methods for shared timer of the TPM device. You must use methods that control the TPM channels (PWM channels) only. For example you can set duty to 0% or 100% to set the required level output level of the pin or you can disconnect the channel pin by clearing MSB, MSA, ELSB and ELSA bits of the TPMx_CnSC register. In this case you can use for example PDD macros:

TPM_PDD_SelectChannelMode(TPM0_BASE_PTR, 0, TPM_PDD_OUTPUT_NONE);

TPM_PDD_SelectChannelEdgeLevel(TPM0_BASE_PTR, 0, TPM_PDD_EDGE_NONE);

Best Regards,

Marek Neuzil