Any algorithms to multiplex ccp to generate 4 square waves?
Posted: Sun May 06, 2007 9:08 am
hello everybody,
I am timing 2 square waves with a fast timer2 interrupt, but adding more outputs will slow the code a lot.
I am wondering about how to generate 4 similar waves (duty cycle can change) and sync them with a main wave. This sync can be out of phase from 0 to 90 degrees. The hardest part would be this syncing I think.
Previous researches resulted to linked lists and binary trees but I could not see how to make it work.
So I ask how would you solve it?
Thank you.
jma_1
Joined: 08 Feb 2005 Posts: 147 Location: Wisconsin
Posted: Mon May 07, 2007 6:49 am
Greetings,
Perhaps a PLL is the way to go. Here is a chip offered by National Semi that might put you in the right direction (2 channel?).
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
Posted: Mon May 07, 2007 7:18 am
Try googling "numerically controlled oscillator". That is a powerful technique but a PIC can only do it at audio frequencies. I have a PIC16C54 generating up to 32kHz. _________________ The search for better is endless. Instead simply find very good and get the job done.
future
Joined: 14 May 2004 Posts: 330
Posted: Mon May 07, 2007 9:55 am
Yes I need it for 350hz maximum with a resolution of 1/4hz.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum