Defineing multiple PWM componants on one TimmerUnit

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Defineing multiple PWM componants on one TimmerUnit

ソリューションへジャンプ
1,287件の閲覧回数
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

タグ(3)
0 件の賞賛
返信
1 解決策
1,086件の閲覧回数
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

元の投稿で解決策を見る

1 返信
1,087件の閲覧回数
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