Hello!
I made a little PWM test and i found two problems. See attached program.
First problem: When i power up the controller, after the PWM enable, it's turns on as full duty until it's get another command.
PWM problems
Moderator: Benj
- Bachman
- Posts: 116
- Joined: Sun Sep 07, 2014 11:37 am
- Location: Hungary
- Has thanked: 9 times
- Been thanked: 53 times
- Contact:
Re: PWM problems
Second problem: Set the duty to 255, simulation shows az 100 %, but in the real HW, it's not 100 %.
- 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: PWM problems
Hello,
I can maybe see why you are not getting 100% duty on. You are writing to the PWM duty register even when the duty remains constant so maybe this is causing the problem.
If you move the SetDutyCycle call into the decision icons yes branches then does this solve the problem?
I can maybe see why you are not getting 100% duty on. You are writing to the PWM duty register even when the duty remains constant so maybe this is causing the problem.
If you move the SetDutyCycle call into the decision icons yes branches then does this solve the problem?
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
- Bachman
- Posts: 116
- Joined: Sun Sep 07, 2014 11:37 am
- Location: Hungary
- Has thanked: 9 times
- Been thanked: 53 times
- Contact:
Re: PWM problems
It's doesn't matter, where is the SetDutyCycle command. After the PWM enabled, the output goes to full duty until it's got another SetDutyCycle command. I've tested it on Flowcode 5, on that version, only the second problem exists, set duty to 255 is not 100 % duty on the HW.