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
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.
-------------------------------------------------------------------------------
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!