Hello,
Can someone advise me as to what I am doing incorrect in the attached Flowcode 5.2 code. The objective is to start the single PWM of the PIC18F14K50 at one PWM period, halt the PWM disable it, change the PWM period to a different value and restart the PWM.
The only PWM period setting that seems to take in Flowcode are those set using the Ext Properties of the PWM Panel, using the ChangePeriod() macro does not seem to work.
Also the displayed values for the PWM Period both in the Component Properties and Simulation display do show the same values and both values shown appear to not match the actual PWM period.
Thanks in advance,
Dave
PWM ChangePeriod Macro not working PIC18F14K50
Moderator: Benj
PWM ChangePeriod Macro not working PIC18F14K50
- Attachments
-
- simple_pwm_02.fcf
- Simple PWM Flowcode program to test PWM period change
- (7 KiB) Downloaded 327 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: PWM ChangePeriod Macro not working PIC18F14K50
Hello Dave,
It looks like the original property settings are used when enabling the PWM channel. Is it possible for you to edit the settings without first disabling the PWM output as I believe this should work. If not then let me know and I will show you how to get around this bug.
It looks like the original property settings are used when enabling the PWM channel. Is it possible for you to edit the settings without first disabling the PWM output as I believe this should work. If not then let me know and I will show you how to get around this bug.
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
Re: PWM ChangePeriod Macro not working PIC18F14K50
Hi Dave
not sure if this will work but ive slightly changed your flow code so rather than disable and reenable pwm it sets to 0
Regards
Dazz
not sure if this will work but ive slightly changed your flow code so rather than disable and reenable pwm it sets to 0
Regards
Dazz
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php
Re: PWM ChangePeriod Macro not working PIC18F14K50
Hi Dazz,
Thank you very much for your reply and code review! I did a quick test of what you uploaded and it appears to work, moving the PWM from 48kHz to 64kHz. My quick review of your code, and I will do a more in-depth in the morning is that you physically change the PWM period to zeros rather than my disable/enable step. Sure did not find any documentation from Matrix on this procedure, that's weak.
Thanks again,
Dave Proffer
Thank you very much for your reply and code review! I did a quick test of what you uploaded and it appears to work, moving the PWM from 48kHz to 64kHz. My quick review of your code, and I will do a more in-depth in the morning is that you physically change the PWM period to zeros rather than my disable/enable step. Sure did not find any documentation from Matrix on this procedure, that's weak.
Thanks again,
Dave Proffer