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

Variable Frequency Pulse Needed

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



Joined: 21 Feb 2006
Posts: 19
Location: San Diego

View user's profile Send private message

Variable Frequency Pulse Needed
PostPosted: Tue Nov 28, 2006 7:01 pm     Reply with quote

PIC18F65J15
50Hz to 1kHz with at least 7 bits

My circuit has a stepper motor controller/driver that requires a pulse for each step. The speed has to be ramped but is otherwise constant for long periods of time. I want to avoid using an interrupt as it will fire every 1 to 20 ms. I'm shooting for a nice deterministic main loop...

The PWM frequency options look to be too coarse and too fast.

I didn't see a way to set the Compare function so that it would both reset the timer and toggle the CCP pin.

Any ideas?

Greg
Greg_R



Joined: 21 Feb 2006
Posts: 19
Location: San Diego

View user's profile Send private message

Additional Details
PostPosted: Tue Nov 28, 2006 7:05 pm     Reply with quote

10Mhz Crystal with 4xPLL
Design is not in layout yet so any pin can be made available.

Greg
SherpaDoug



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

View user's profile Send private message

PostPosted: Tue Nov 28, 2006 9:51 pm     Reply with quote

Try googling "numerically controlled oscillator". I did one on a 20MHz 16C58 PIC that went up to 35kHz.
_________________
The search for better is endless. Instead simply find very good and get the job done.
Greg_R



Joined: 21 Feb 2006
Posts: 19
Location: San Diego

View user's profile Send private message

Just need a pulse without using an interrupt...
PostPosted: Tue Nov 28, 2006 10:06 pm     Reply with quote

SherpaDoug,

Thanks for the suggestion but unless I missed something it doesn't answer the question. I'm simply looking for ways to avoid using an interrupt. Everything else the circuit needs to do will fit into a simple task schedule.

Greg
Greg_R



Joined: 21 Feb 2006
Posts: 19
Location: San Diego

View user's profile Send private message

dsPIC solved the problem
PostPosted: Tue Dec 19, 2006 4:35 pm     Reply with quote

Turns out the compare modules on the dsPIC33s will do exactly what I need. Good thing the system also has one of them...

Greg
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