imxrt1052 32bit pwm

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

imxrt1052 32bit pwm

跳至解决方案
1,317 次查看
ccc_clive
Contributor III

can i use pwm with 32it count?

0 项奖励
回复
1 解答
1,291 次查看
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @ccc_clive ,

Thanks for your interest in NXP MIMXRT series!

PWM only provides 16 bit counter, we can't do a 32bit counter using hardware alone. Please refer to this post: 已解决: i.MX.RT1052 - Is it possible to create a 32bit PWM module using 2 quad timers? - NXP Community

Maybe you can design the software to realize, eg, when the counter 16 bit is overflowed, then in the overflowed interrupt, you use a software count flag to record it. when the 16 bit overflow 0xffff times, it means the counter 32 bit is reached.
Besides this, actually, PIT is the 32bit counter, maybe you can use the PIT associate with the GPIO to realize the PWM generation.
Wish it helps you!

Best regards,
Gavin

在原帖中查看解决方案

0 项奖励
回复
2 回复数
995 次查看
ccc_clive
Contributor III

最终使用了pit来模拟pwm,中断中翻转IO,中断频率为pwm频率的2倍,占空比为百分50

0 项奖励
回复
1,292 次查看
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @ccc_clive ,

Thanks for your interest in NXP MIMXRT series!

PWM only provides 16 bit counter, we can't do a 32bit counter using hardware alone. Please refer to this post: 已解决: i.MX.RT1052 - Is it possible to create a 32bit PWM module using 2 quad timers? - NXP Community

Maybe you can design the software to realize, eg, when the counter 16 bit is overflowed, then in the overflowed interrupt, you use a software count flag to record it. when the 16 bit overflow 0xffff times, it means the counter 32 bit is reached.
Besides this, actually, PIT is the 32bit counter, maybe you can use the PIT associate with the GPIO to realize the PWM generation.
Wish it helps you!

Best regards,
Gavin

0 项奖励
回复
%3CLINGO-SUB%20id%3D%22lingo-sub-1901098%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3Eimxrt1052%2032bit%20pwm%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1901098%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E6%88%91%E5%8F%AF%E4%BB%A5%E4%BD%BF%E7%94%A8%2032it%20%E8%AE%A1%E6%95%B0%E7%9A%84%20pwm%20%E5%90%97%EF%BC%9F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2018140%22%20slang%3D%22zh-CN%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9A%20imxrt1052%2032bit%20pwm%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2018140%22%20slang%3D%22zh-CN%22%20mode%3D%22CREATE%22%3E%3CP%3E%E6%9C%80%E7%BB%88%E4%BD%BF%E7%94%A8%E4%BA%86pit%E6%9D%A5%E6%A8%A1%E6%8B%9Fpwm%EF%BC%8C%E4%B8%AD%E6%96%AD%E4%B8%AD%E7%BF%BB%E8%BD%ACIO%EF%BC%8C%E4%B8%AD%E6%96%AD%E9%A2%91%E7%8E%87%E4%B8%BApwm%E9%A2%91%E7%8E%87%E7%9A%842%E5%80%8D%EF%BC%8C%E5%8D%A0%E7%A9%BA%E6%AF%94%E4%B8%BA%E7%99%BE%E5%88%8650%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1901922%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9A%20imxrt1052%2032bit%20pwm%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1901922%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F216319%22%20target%3D%22_blank%22%3E%40ccc_clive%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%0A%3CP%3E%E6%84%9F%E8%B0%A2%E6%82%A8%E5%AF%B9%20NXP%20MIMXRT%20%E7%B3%BB%E5%88%97%E7%9A%84%E5%85%B3%E6%B3%A8%EF%BC%81%3C%2FP%3E%0A%3CP%3EPWM%20%E4%BB%85%E6%8F%90%E4%BE%9B%2016%20%E4%BD%8D%E8%AE%A1%E6%95%B0%E5%99%A8%EF%BC%8C%E6%88%91%E4%BB%AC%E4%B8%8D%E8%83%BD%E4%BB%85%E4%BD%BF%E7%94%A8%E7%A1%AC%E4%BB%B6%E6%9D%A5%E5%AE%9E%E7%8E%B0%2032%20%E4%BD%8D%E8%AE%A1%E6%95%B0%E5%99%A8%E3%80%82%E8%AF%B7%E5%8F%82%E8%80%83%E6%AD%A4%E5%B8%96%E5%AD%90%EF%BC%9A%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fi-MX-RT-Crossover-MCUs%2Fi-MX-RT1052-Is-it-possible-to-create-a-32bit-PWM-module-using-2%2Fm-p%2F1428671%22%20target%3D%22_blank%22%3E%E5%B7%B2%E8%A7%A3%E5%86%B3%EF%BC%9Ai.MX.RT1052%20-%20%E6%98%AF%E5%90%A6%E5%8F%AF%E4%BB%A5%E4%BD%BF%E7%94%A8%202%20%E4%B8%AA%E5%9B%9B%E8%B7%AF%E5%AE%9A%E6%97%B6%E5%99%A8%E5%88%9B%E5%BB%BA%2032%20%E4%BD%8D%20PWM%20%E6%A8%A1%E5%9D%97%EF%BC%9F%20-%20NXP%20%E7%A4%BE%E5%8C%BA%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%E4%B9%9F%E8%AE%B8%E4%BD%A0%E5%8F%AF%E4%BB%A5%E8%AE%BE%E8%AE%A1%E8%BD%AF%E4%BB%B6%E6%9D%A5%E5%AE%9E%E7%8E%B0%EF%BC%8C%E6%AF%94%E5%A6%82%E5%BD%93%E8%AE%A1%E6%95%B0%E5%99%A816%E4%BD%8D%E6%BA%A2%E5%87%BA%E6%97%B6%EF%BC%8C%E9%82%A3%E4%B9%88%E5%9C%A8%E6%BA%A2%E5%87%BA%E4%B8%AD%E6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