View previous topic :: View next topic |
Author |
Message |
guest Guest
|
sweep generator |
Posted: Mon Oct 18, 2004 8:37 pm |
|
|
how to make a sweep gnerator? sine wave that sweeps through certain
frequencies
thanks in advance |
|
|
Haplo
Joined: 06 Sep 2003 Posts: 659 Location: Sydney, Australia
|
|
Posted: Mon Oct 18, 2004 10:07 pm |
|
|
What range of frequencies are you talking about? You can use the PWM module with a low-pass filter. |
|
|
guest Guest
|
|
Posted: Mon Oct 18, 2004 11:46 pm |
|
|
i am talking about 1MHz |
|
|
Haplo
Joined: 06 Sep 2003 Posts: 659 Location: Sydney, Australia
|
|
Posted: Tue Oct 19, 2004 12:25 am |
|
|
That shouldn't be any problem as long as you use a fast enough oscillator. How small do you want the freqeuncy steps to be? |
|
|
Will Reeve
Joined: 30 Oct 2003 Posts: 209 Location: Norfolk, England
|
|
Posted: Tue Oct 19, 2004 2:44 am |
|
|
I�ve just finished a project which did just that (well at audio frequencies). After trying PWM, and a 8bit ladder DAC set-up, I ended up with a DDS from Analog Devices. They do a lovely little serial programmed one in a small 10pin package (buy a little PCB to convert to a 10pin DIL) or a faster parallel programmed one in a 28pin package which is the one I used in the end as I needed to change frequencies every 500uS!
They need a clock signal which I generated with the PWM from the PIC. You get a very clean sine wave out.
http://www.analog.com
do a �Search� for the AD9850 and AD9833 which are the two I talk about but there are others.
Little adaptor boards for 10pin to DIL I bought from http://www.epboard.com who shipped to the UK in a couple of days.
Keep well,
Will |
|
|
guest Guest
|
|
Posted: Tue Oct 19, 2004 10:22 am |
|
|
thank you all for your help, about the frequency steps the smallest the better it will be, lets say 1Hz .how can i program the uc to do so? |
|
|
Will Reeve
Joined: 30 Oct 2003 Posts: 209 Location: Norfolk, England
|
|
Posted: Tue Oct 19, 2004 12:25 pm |
|
|
We need range of sweep and how quickly you want to sweep! |
|
|
yerpa
Joined: 19 Feb 2004 Posts: 58 Location: Wisconsin
|
sweep generator |
Posted: Tue Oct 19, 2004 12:31 pm |
|
|
I agree with Will Reeve - use a dedicated chip if you really need that kind of resolution. You are talking about one part per million resolution - that requires a twenty-bit index if you are doing wavetable lookups, and there would be distortion every time you change the index (see Hal Chamberlin's excellent book "Musical Applications of Microprocessors"). Also, using the PIC alone, you would need a way to keep the sample rate rock steady - not an easy trick. I have tried a similar app and only was able to attain 11 Khz audio sample rate with a 20 MHz PIC 16F876. I could probably multiply that by a factor of ten if constant sweep was the only parameter, but would still be a long way from 1 MHz signal rate (requires minimum 2 MHz sample rate). |
|
|
|