MKL46Z256VLL4 TPM0 counter not counting

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

MKL46Z256VLL4 TPM0 counter not counting

1,118件の閲覧回数
vasil_zhmendak
Contributor I

Hello,

I am trying to setup "Center Aligned" PWM signal with MK46Z256VLL4 MCU integrated on FRDM-KL46Z development board and running into issue of TPM0 counter not counting. I attached screenshots of my TPM0 counter code initialization and register status.

"DBGMODE" bits in TPM0_CONF register are set such that debug mode is enabled since I know that having these bits disabled will prevent counter from counting in debug mode.

I spent numerous hours reviewing KL46 reference manual for this feature setup and just can't locate the issue. 

Thank you,

Vasil

ラベル(1)
0 件の賞賛
返信
2 返答(返信)

1,004件の閲覧回数
nxf56274
NXP Employee
NXP Employee

Hi,

Our tpm example is Center Aligned. Why not use our example? Welcome | MCUXpresso SDK Builder  Use this link to download the SDK/

Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

1,004件の閲覧回数
vasil_zhmendak
Contributor I

Hi,

Thank you for pointing this out. After reviewing "frdmkl46z_tpm_simple_pwm" I was able to locate problem in my code. I was not setting TPM clock source so that is the reason why counter was not counting. After adding below line to my code issue went away. 

CLOCK_SetTpmClock(1U);

Thank you!

0 件の賞賛
返信