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 CCS Technical Support

which function i will use to change frequency

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



Joined: 28 Nov 2014
Posts: 5

View user's profile Send private message

which function i will use to change frequency
PostPosted: Fri Nov 28, 2014 2:52 am     Reply with quote

hi every body

i want to know which function or how can i change frequency without damage duty cycle ?

tank you very much



Smile Smile
Ttelmah



Joined: 11 Mar 2010
Posts: 19568

View user's profile Send private message

PostPosted: Fri Nov 28, 2014 4:24 am     Reply with quote

Of what?......

If you mean the PWM, the only single function that would change it's frequency without changing the duty cycle, would be to change the prescaler. Gives typically three possible frequencies. For everything else, you will have to change the timer setting, and then change the duty cycle yourself.

Understand that the PWM, is not designed to generate variable frequencies. If you want this, then look at a chip with an NCO.
nuri



Joined: 28 Nov 2014
Posts: 5

View user's profile Send private message

PostPosted: Fri Nov 28, 2014 7:07 am     Reply with quote

i want to make a circuit like in this video using pic microcontroller, http://www.youtube.com/watch?v=p_Wx1elYPaU
Ttelmah



Joined: 11 Mar 2010
Posts: 19568

View user's profile Send private message

PostPosted: Fri Nov 28, 2014 7:39 am     Reply with quote

You vary the width of the pulse, not the frequency for this. This is what 'PWM' means (pulse width modulation). The fan here is designed to accept such a signal (you need to make sure the fan you have, is designed to accept such a signal), and choose a PIC with with a PWM module. The PWM signal on these fans is designed to be 25kHz (fixed frequency - but will accept anything from about 21 to 28kHz), and the speed is simply controlled by the PWM ratio. You'd want a PIC at perhaps 16MHz to give good resolution at this sort of PWM frequency. Then it is just a matter of setting up the timer to give a frequency close to the required 25kHz, and varying the PWM pulse width to control the speed.
nuri



Joined: 28 Nov 2014
Posts: 5

View user's profile Send private message

PostPosted: Fri Nov 28, 2014 8:09 am     Reply with quote

ok . thank you very much for your answer , it means that i can not design the circuit that control the speed by varying frequency without changing of duty cycle right?
Ttelmah



Joined: 11 Mar 2010
Posts: 19568

View user's profile Send private message

PostPosted: Fri Nov 28, 2014 8:15 am     Reply with quote

Those fans do not want you to change the frequency. They require you to change the pulse width only. That is what the circuit being displayed does. Pull the data sheet for such a fan:

<www.formfactors.org/developer%5Cspecs%5Crev1_2_public.pdf>

The frequency has to be fixed for these. You change the pulse width only and the fan changes speed.

You are starting on a wrong premise.

These fans are common on PC's, and are operated by fixed frequencies.
nuri



Joined: 28 Nov 2014
Posts: 5

View user's profile Send private message

PostPosted: Fri Nov 28, 2014 8:23 am     Reply with quote

yeah i understood what you said that the speed of that circuit is controled by varying then witdh of the pulse .. but let say for anothor example if i want to control the speed by varying frequency without changing of duty cycle can i do it or not?
Ttelmah



Joined: 11 Mar 2010
Posts: 19568

View user's profile Send private message

PostPosted: Fri Nov 28, 2014 8:46 am     Reply with quote

The motors where you change speed with frequency, are things like BLDC motors, where you synthesise (normally three) signals to drive the motor phases. You leave the PWM running at a fixed frequency, and vary the apparent frequency of the much lower frequency 'synthesised' signal, by varying the pulse width of the PWM. Have a look at Microchip application note 857a, and the others on such control. You don't change the frequency of the PWM, you synthesise a lower frequency signal with this.
nuri



Joined: 28 Nov 2014
Posts: 5

View user's profile Send private message

PostPosted: Fri Nov 28, 2014 9:07 am     Reply with quote

ok thank you very much for your all answers Very Happy Very Happy
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