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 !!
Simple PWM Pulse Generator - Any Ideas ???
Moderator: Benj
Simple PWM Pulse Generator - Any Ideas ???
- Attachments
-
- pwmcode_v1.fcf
- PWM Pluse Generator Flowcode Program
- (4.5 KiB) Downloaded 369 times
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
Re: Simple PWM Pulse Generator - Any Ideas ???
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.
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 390 times
Re: Simple PWM Pulse Generator - Any Ideas ???
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
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
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Simple PWM Pulse Generator - Any Ideas ???
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. Martin
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. Martin
Martin