Change PIC frequency

Thread Starter

PIC GUY TREVOR

Joined Mar 8, 2009
28
Hi All

I have a question about a 12V Dc Motor project I am undertaking at school. I am using a PIC 16F84A and all I need to do is change the output frequency from the chip to 2kHz to the motor. I have looked in Microchip and searched the forum but I must be looking in the wrong places. Just need a little push in the right direction.

Thanks
 
Last edited:

mik3

Joined Feb 4, 2008
4,843
Which programming language are you using?

If you will control the speed of the motor with PWM I suggest you to use a frequency of 20 kHz instead of 2 kHz because with 2 kHz you will hear a buzzling sound from the motor.
 

Thread Starter

PIC GUY TREVOR

Joined Mar 8, 2009
28
I am using MPLab as the assembler, Im just following the specs of the circuit re the frequency. If I adjust the duty cycle that will help solve my problem ?
 

jpanhalt

Joined Jan 18, 2008
11,087
Since you are using the16F84A and MPLab, let's assume you are using assembly language. In the code somewhere, you will be generating a PWM signal. Basically, a pin will be made high, there will be a delay, the pin will be made low, there will be another delay, and so forth. The cycle will repeat endlessly.

The ratio of the "on" delay to total delay will give you the duty cycle, and the total delays will give you the frequency of the PWM. Generally, you do not need to change the frequency of the microcontroller.

If still confused, please post your code.

John
 

fanie

Joined Jan 20, 2007
63
Though you may not hear the frequency at 20kHz, you may want to see how the motor react first, then maybe use a different frequency. If the inductance of the motor cause resonance you may want to change the frequency.
 

mik3

Joined Feb 4, 2008
4,843
Though you may not hear the frequency at 20kHz, you may want to see how the motor react first, then maybe use a different frequency. If the inductance of the motor cause resonance you may want to change the frequency.
What will be the effects of reasonance?
 
Top