!!!PWM Question!!!
gambrino
Posts: 28
Hello forum , i would like to generate 3 PWM phase-shifted , can somebody guide me to generate them? i started from the PWM in the object exchange, file name ( Dedicated pwm generator) , and i changed the code to make wait for the cog but it's seems on the ocsilloscope on pin1 is ok , the Pin7 is not . my code is in the attachment .
Thank you for your help .
Post Edited (gambrino) : 4/15/2009 2:05:25 PM GMT
Thank you for your help .
Post Edited (gambrino) : 4/15/2009 2:05:25 PM GMT
Comments
to me it is not clear want you want to do
can you post a drawing with all three channels and how they should depend from each other ?
best regards
Stefan
i add to the first post the picture of the 3 signals .
Thanks
Thanks
It is the same as always:
As soon as more information is provided NEW solutions can be suggested
To all other forum members especially the newbies:
As you can see from this example it is EXTREMLY useful to provide quite a lot information
in your posting. The members of THIS forum are ALL patient enough to read 10-50 well formatted lines of text
and who doesn't will just surf to another thread
As the ANN1-democode dedicates a cog to run it anyway you can use for example
the code shown below which requires one cog too.
In your picture the ON/OFF-Ratio for all 3 channels is 1:2
Depending on the maximum frequency you can do this easily in SPIN
For different frequencies simple change the resulting value of Delay
In SPIN there is a minimum-value for waitcnt it is 385 this gives a frequency of 16,8 kHz.
If this isn't fast enough you can do the same in ASM
best regards
Stefan
Post Edited (StefanL38) : 4/7/2009 5:30:16 PM GMT
Let me know how this turns out.
Cheers!
Paul Rowntree
Cheers!
Paul Rowntree
Thank you in advance.
Cheers!
OK looked and found this http://obex.parallax.com/objects/414/