View previous topic :: View next topic |
Author |
Message |
libellej8
Joined: 03 Mar 2009 Posts: 2 Location: Dorset UK
|
Square wave sweep, from 36KHz to 37KHz in 20mS. How? |
Posted: Tue Jul 14, 2009 2:15 am |
|
|
I need to generate a square wave, which sweeps continuously from around 36KHz to around 37KHz linearly, with the sweep taking 20mS to cover that range. This PIC doesn't have to do anything else.
The purpose is to scan through the resonances of some parallel connected PZT devices to ensure that each one resonates every 20mS.
Each has a very high Q and has its resonance in the range 36-37KHz but they are not exactly matched.
I have tried incrementing the period of a loop by the instruction cycle period - but even with a 100nS instruction cycle I can't get enough resolution.
What techniques can you guys suggest? Any help would be much appreciated. Even an analog method would be OK but PIC is preferred.
Gerry, Weymouth UK. |
|
|
treitmey
Joined: 23 Jan 2004 Posts: 1094 Location: Appleton,WI USA
|
|
Posted: Tue Jul 14, 2009 8:37 am |
|
|
In my simplistic view, I'd opt for
http://media.digikey.com/pdf/Data%20Sheets/National%20Semiconductor%20PDFs/LM566C.pdf
and drive the voltage from a digital pot and a precision voltage reference.
((you have to run the numbers to see if this will hit 36k))
((I was just casually observing the typical app listed at 1k to 10k))
((going for a slower type VCO))
Then say 36k to 37k is 1K range.
Lets say 0.1k resolution for 100 voltage settings.
Then figure R C to get widest range for 36k - 37k on that chip.
Then sweep the pot over that voltage over the 20mS time.
20mS with 100 voltages I think is 200uS between voltage settings. |
|
|
John P
Joined: 17 Sep 2003 Posts: 331
|
|
Posted: Tue Jul 14, 2009 8:04 pm |
|
|
No, unless you can live with very widely spaced frequencies you probably can't use an an entirely digital design.
I'd investigate a controlled analog system with feedback. Suppose you had an LMC555 oscillator, set up to allow a variable frequency controlled (over a limited range) by an analog input. Then you hook up your PIC to a D/A converter which controls that voltage and thus the output frequency. As part of your code, you have a calibration system where the PIC reads the frequency. Depending on your needs, you could have a few, or a lot, of calibration points, where you expect a certain output to the DAC to produce a certain frequency. You could then interpolate as many additional levels as you need between these points. The calibration system wouldn't function during an actual sweep, but you could re-calibrate just before doing a sweep, to keep things accurate. |
|
|
criss_m
Joined: 09 Mar 2006 Posts: 9 Location: Chile
|
|
Posted: Fri Jul 17, 2009 2:04 pm |
|
|
I did stuff like this but using Dspic and DAC for my thesis...
There are functions to synth sinewaves and it's not to complicated to make a sweep ...
br
Cristian Mardones |
|
|
|