Lowest PWM-TPM frequency for L series MCUs

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

Lowest PWM-TPM frequency for L series MCUs

450 Views
mtangy
Contributor II

I'm trying to get my MKL26Z256VLL4 MCU to output a 100Hz PWM signal. The lowest I've been able to get it is 322Hz. Does anyone know if this Micro controller is capable of producing a PWM signal at such a low frequency? Any input would be much appreciated. 

Labels (1)
Tags (1)
2 Replies

376 Views
harshpatel
Contributor IV

Hello Michael Tangy

Kerry Zhou has suggested correct method. But still you will face issue then share your code. i will update it as per your requirement.

Thanks & regards

Harsh

INDIA 

0 Kudos

376 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Michael Tangy,

     Yes, you can get 100HZ PWM in the KL26.

     You can use the external 8Mzh crystal as the TPM clock source.

pastedImage_1.png

Then in the TPM module, the prescaler divide by 128, and set the modulo counter as 624, now you can get the 100Khz, because modulo counter = 62.5K/100hz  -1 =624.

pastedImage_2.png

 I have help you creating a project, it based on KDS PE, I have attached it for your reference.

This project can generate 100hz in PTC2 pin, this is the test result.

pastedImage_3.png

Wish it helps you.


Have a great day,
Kerry

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