Previous in Forum: Embedded System Software   Next in Forum: PC Problems with Standby Mode
Close
Close
Close
2 comments
Rate Comments: Nested
Participant

Join Date: Oct 2006
Posts: 3

need help for frequency acceleration and deceleration

08/15/2007 9:58 AM

Hi I request suggestion to accelerate frequency from 0 to 150kHz within predifined time(0-500mSec) using pwm(pic ic).Please help me for designing circuit.

Thank you

Register to Reply
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.

"Almost" Good Answers:

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, vote them!
Guru
Engineering Fields - Electrical Engineering - New Member

Join Date: Sep 2006
Location: El Lago, Texas, USA
Posts: 2639
Good Answers: 65
#1

Re: need help for frequency acceleration and deceleration

08/15/2007 11:02 AM

The basic idea is to use a counter. Load it with zeros. Let it count up until it rolls over - set your output signal to '1'. Repeat the load and count process, and when it rolls over this time, set your output signal to "0". You've just generated one clock period.

Now load your counter with "1", and repeat the above process - you'll generate another clock period, but it will be one count shorter than the first.

Now load the counter with "2", generate another clock period, and keep incrementing the counter load value until you get up to your highest value of 150KHz.

You may need more than one level of counter to get the frequencies you want, depending on your clock speed, and the resolution you want, etc.

Or, you can do the same thing but load the counter with a large value and count backwards to zero, and set the output signal when the counter hits zero. Same thing.

There is a good application note on PWM at the Microchip web site, if you do a little searching for it.

Register to Reply Score 1 for Good Answer
Commentator

Join Date: Jun 2007
Posts: 82
Good Answers: 2
#2

Re: need help for frequency acceleration and deceleration

08/16/2007 4:21 PM

Let's think about what you are asking.

1. You will have to interrupt early frequencies, since your maximum sweep time is 500 ms. (You will no be able to do a complete 1 Hz cycle in 500 msec. ; you will never complete a 0 Hz period).

2. Is it a sinewave or a square wave you are interested in sweeping?

3. If you think interrupting is NOT ok, then you have to do a series calculation for best fit sequence of periods.

I need more information on restraints to be of more help. Hopefully, you wil re-think the problem to get better specification.

__________________
The purpose of a system, is what it does.
Register to Reply
Register to Reply 2 comments

"Almost" Good Answers:

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, vote them!

Previous in Forum: Embedded System Software   Next in Forum: PC Problems with Standby Mode

Advertisement