Page 1 of 1

Simple PWM Pulse Generator - Any Ideas ???

Posted: Sun Sep 02, 2012 7:56 pm
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 !!

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

Posted: Sun Sep 02, 2012 9:22 pm
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.

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

Posted: Mon Sep 03, 2012 2:27 am
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

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

Posted: Mon Sep 03, 2012 7:34 am
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