My customer tried to generate some PWM outputs working on the i.MX RT1050. But the PWM waveform accuracy is not correct. I reproduced this issue with i.MX RT1050 EVKB, using demo code $\boards\evkbimxrt1050\driver_examples\qtmr\inputcapture_outputpwm in SDK. It should probe a 50Khz PWM signal output with 50% dutycycle. The oscilloscope shows the PWM output at pin J23-5 accuracy was about 49.7K.
Hi S.z. Liang,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
After testing, both of two compare values need to minus 1 after calculating, so please use the adapted codes to replace the original code in the QTMR_SetupPwm() function.
/* Setup the compare registers for PWM output */
base->CHANNEL[channel].COMP1 = lowCount-1;
base->CHANNEL[channel].COMP2 = highCount-1;
/* Setup the pre-load registers for PWM output */
base->CHANNEL[channel].CMPLD1 = lowCount-1;
base->CHANNEL[channel].CMPLD2 = highCount-1;
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.
-------------------------------------------------------------------------------