Hi all.
I have been trying to use a PWM component in a project but no matter what I put in the duty cycle it always stays 50%, Has anyone else experienced the same thing or am I missing something?
Have tried both 10-bit setting and 8-bit setting and the result stays the same...50%
Regards
Nick
PIC24EP512GU810 PWM problems
Moderator: Benj
-
- Posts: 58
- Joined: Sat Aug 22, 2009 5:45 pm
- Has thanked: 17 times
- Been thanked: 7 times
- Contact:
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: PIC24EP512GU810 PWM problems
Hi Nick,
Please can you post your project file so we can see what you're doing and hopefully suggest a fix.
Also is the problem limited to hardware or simulation or both?
Please can you post your project file so we can see what you're doing and hopefully suggest a fix.
Also is the problem limited to hardware or simulation or both?
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 58
- Joined: Sat Aug 22, 2009 5:45 pm
- Has thanked: 17 times
- Been thanked: 7 times
- Contact:
Re: PIC24EP512GU810 PWM problems
Hi Ben.
Thanks a lot for looking into it, maybe I´m just not seeing the problem.
I have tried it on hardware.
Here´s the file
Best Regards
Nick
Thanks a lot for looking into it, maybe I´m just not seeing the problem.
I have tried it on hardware.
Here´s the file
Best Regards
Nick
- Attachments
-
- 24EP512GU810_PWM.fcfx
- (18.64 KiB) Downloaded 261 times
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: PIC24EP512GU810 PWM problems
Hi Nick,
I think I see what's going wrong.
When you enable the PWM it will automatically jump back to the period and prescaler values from the properties.
So if you change the period and or prescaler before enabling the PWM output then these changes will be lost.
I would recommend enabling the PWM and then calling the ChangePeriod and SetDutyCycle10Bit macros and seeing how you get on.
If this still has issues then are you running 7.3 and have you applied the latest post 7.3 updates from here.
viewtopic.php?f=63&t=19743
I think I see what's going wrong.
When you enable the PWM it will automatically jump back to the period and prescaler values from the properties.
So if you change the period and or prescaler before enabling the PWM output then these changes will be lost.
I would recommend enabling the PWM and then calling the ChangePeriod and SetDutyCycle10Bit macros and seeing how you get on.
If this still has issues then are you running 7.3 and have you applied the latest post 7.3 updates from here.
viewtopic.php?f=63&t=19743
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 58
- Joined: Sat Aug 22, 2009 5:45 pm
- Has thanked: 17 times
- Been thanked: 7 times
- Contact:
Re: PIC24EP512GU810 PWM problems
Hi Ben.
....
I cant belive I just didn´t see that
Thank you for, as always, excellent support Ben
Best Regards
Nick
....
I cant belive I just didn´t see that
Thank you for, as always, excellent support Ben
Best Regards
Nick