How do I get 3kHz signal?

Thread Starter

RG23

Joined Dec 6, 2010
304
I am using PIC 16f887

I have a timer of 10ms .

I want to obtain 3Khz signal using this timer.

If anyone has an idea please let me know

Thank you
 

bertus

Joined Apr 5, 2008
22,270
Hello,

You will never manage 3kHz with a 10mS timer.
The period time for 3 kHz is 1/3kHz = 0.333333 mS.
The highest frequency with a 10 mS timer is 1/10mS = 100 Hz.

Bertus
 

Thread Starter

RG23

Joined Dec 6, 2010
304
You could use the PWM output to generate 3kHz
_______________________________________________________________

What is that PWM output?

I have no idea on that
Please elaborate
 

Thread Starter

RG23

Joined Dec 6, 2010
304
Check the CCP module in the datasheet. It's also handy for frequency generation
________________________________________________________________

What was the PWM output you were talking about?

Do let me know if I can actually create a 3kHz signal from 10 ms timer?

Thank you
 

spinnaker

Joined Oct 29, 2009
7,830
spinnaker

Senior Member

Actually its a different question

If you have any idea please let me know

Actually it is. It is PWM. If you learn how to do one you will know how to do the other.

But as we say in the States. "You are trying to get blood out of a stone". Meaning you are trying to do the impossible. As others pointed out, you need a much faster timer. Did you mean 10u seconds?

You can do it with a timer but you would need a faster timer.


It is actually easier to do it with PWM. Check the top of this subforum for a very nice post on how to do PWM. It is a sticky post.
 
Top