CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Any algorithms to multiplex ccp to generate 4 square waves?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
future



Joined: 14 May 2004
Posts: 330

View user's profile Send private message

Any algorithms to multiplex ccp to generate 4 square waves?
PostPosted: Sun May 06, 2007 9:08 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon May 07, 2007 6:49 am     Reply with quote

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?).

http://www.national.com/pf/LM/LMX2331L.html
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Mon May 07, 2007 7:18 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon May 07, 2007 9:55 am     Reply with quote

Yes I need it for 350hz maximum with a resolution of 1/4hz.

The 2Ghz PLL seems to be too much for the job Very Happy

I'll look for the NCO theory, thank you.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group