Simple PWM Pulse Generator - Any Ideas ???

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
gggwww
Posts: 54
Joined: Wed Sep 09, 2009 12:50 am
Has thanked: 1 time
Contact:

Simple PWM Pulse Generator - Any Ideas ???

Post by gggwww »

Hello,

Im trying to create a simple flowcode program to generate a square wave with the following characteristics:

Frequency = 988Hz
Duty Cycle = 4.47% ( which is an 85us on time)

I am using an F628A with the PWM macro.

I have tried ( multiple multiple times) changing the duty cycle and change period macros and cannot figure out how to set the macro values to get the pulse as described above.

Also. measuring CCCP1 output on my oscilloscope does not match what the flowcode graphic is displaying in the panel

Any help would be GREATLY appreciated

Thanks !!
Attachments
pwmcode_v1.fcf
PWM Pluse Generator Flowcode Program
(4.5 KiB) Downloaded 353 times

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: Simple PWM Pulse Generator - Any Ideas ???

Post by Enamul »

Hi,
Here is the corrected version. you have to put right duty cycle...
100% equal to 255..so 4.47% equal to 11. Rest of the thing was clock 4MHz and setting proper PWM properties.
Attachments
pwmcode_v1.fcf
(4.5 KiB) Downloaded 371 times
Enamul
University of Nottingham
enamul4mm@gmail.com

gggwww
Posts: 54
Joined: Wed Sep 09, 2009 12:50 am
Has thanked: 1 time
Contact:

Re: Simple PWM Pulse Generator - Any Ideas ???

Post by gggwww »

Enamul,

Thanks !!!

Not getting the same result on the o'scope but did some tweaking and got to the pulse parameters I needed.

Best Regards,

George

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Simple PWM Pulse Generator - Any Ideas ???

Post by medelec35 »

Hi George,
I have used EB070 - E-blocks test pod, so you can compare results with your scope.
I have set my target device on 4MHz internal osc.
As you can see from waveform, Enamu'ls is not that much different from spec.
PWM Gen.png
(116.26 KiB) Downloaded 2439 times
Martin
Martin

Post Reply