CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Square wave sweep, from 36KHz to 37KHz in 20mS. How?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
libellej8



Joined: 03 Mar 2009
Posts: 2
Location: Dorset UK

View user's profile Send private message

Square wave sweep, from 36KHz to 37KHz in 20mS. How?
PostPosted: Tue Jul 14, 2009 2:15 am     Reply with quote

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? Question Any help would be much appreciated. Even an analog method would be OK but PIC is preferred. Confused

Gerry, Weymouth UK.
treitmey



Joined: 23 Jan 2004
Posts: 1094
Location: Appleton,WI USA

View user's profile Send private message Visit poster's website

PostPosted: Tue Jul 14, 2009 8:37 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Jul 14, 2009 8:04 pm     Reply with quote

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

View user's profile Send private message MSN Messenger

PostPosted: Fri Jul 17, 2009 2:04 pm     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group