The timing is off but I knew to expect that, but the SetDutyCycle(either) doesn't function correctly.
thanks,
Chad
PWM in output. not working correct. (fixed (my fault))
Moderator: Benj
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
- Contact:
Re: PWM in output. not working correct.
Hi Chad,
The SetDutyCycle() parameter is limited to 8 bits, so best to use the SetDuty10Bit() for ARM
SetDuty10Bit() actually takes a 16 bit parameter
(The naming is historic, as 32 bit processors are more recent)
Using the numbers in your attached program I would expect the duty ratio to be 128/6400 and 512/6400
Is that not what you get?
Leigh
The SetDutyCycle() parameter is limited to 8 bits, so best to use the SetDuty10Bit() for ARM
SetDuty10Bit() actually takes a 16 bit parameter
(The naming is historic, as 32 bit processors are more recent)
Using the numbers in your attached program I would expect the duty ratio to be 128/6400 and 512/6400
Is that not what you get?
Leigh
-
- Posts: 198
- Joined: Sun Nov 04, 2018 7:13 pm
- Has thanked: 27 times
- Been thanked: 33 times
- Contact:
Re: PWM in output. not working correct.
Ok, I get it now. I was trying to use a 16 bit number (in the 10 bit). I thought it was expecting a 16 bit number whole not the #/6400.
If I use 3200/6400 I get the expected 50% duty.. My goal was to make a ~10khz base freq then change the duty to modulate a led...
My error thanks!
chad
If I use 3200/6400 I get the expected 50% duty.. My goal was to make a ~10khz base freq then change the duty to modulate a led...
My error thanks!
chad