MKL46Z256VLL4 TPM0 counter not counting

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

MKL46Z256VLL4 TPM0 counter not counting

790 Views
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

Labels (1)
0 Kudos
2 Replies

676 Views
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.
-------------------------------------------------------------------------------

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