imxrt1052 32bit pwm

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

imxrt1052 32bit pwm

Jump to solution
225 Views
ccc_clive
Contributor III

can i use pwm with 32it count?

0 Kudos
Reply
1 Solution
199 Views
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

View solution in original post

0 Kudos
Reply
1 Reply
200 Views
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 Kudos
Reply