PWM duty cycle not adjusting
Posted: Fri Aug 01, 2014 12:04 pm
Hi,
I think I've found a problem with the PWM component. On our project I have the period set to 255, the prescale 16 and the duty cycle 128. This gives me a frequency of 2.92Hz, a period of 3.41us and an on and off of around 171us, so a 50/50 duty cycle.
When we scope the output on the MIAC that the PWM is running through (A) we have found the duty is vastly different - actual amount 90/10 (30us off, 300us on). Adjusting the duty to 64, you would expect the on duty to be around 25%, and again setting it to 32 you would expect 12.5% but when scoped it doesn't change noticeably. It updates correctly on the simulation though.
Any help is much appreciated!
Regards,
Ben
I think I've found a problem with the PWM component. On our project I have the period set to 255, the prescale 16 and the duty cycle 128. This gives me a frequency of 2.92Hz, a period of 3.41us and an on and off of around 171us, so a 50/50 duty cycle.
When we scope the output on the MIAC that the PWM is running through (A) we have found the duty is vastly different - actual amount 90/10 (30us off, 300us on). Adjusting the duty to 64, you would expect the on duty to be around 25%, and again setting it to 32 you would expect 12.5% but when scoped it doesn't change noticeably. It updates correctly on the simulation though.
Any help is much appreciated!
Regards,
Ben