Breaking News
Maxís Cool Beans

Building a Low-Cost Frequency/Function Generator

NO RATINGS
Page 1 / 2 Next >
View Comments: Threaded | Newest First | Oldest First
antedeluvian
User Rank
Blogger
8038
antedeluvian   6/10/2014 5:47:02 PM
NO RATINGS
Max

Let me be the first to reminisce about the Intersil/Exar/Harris 8038. It was a low frequency oscillator for all seasons. For some reason everyone has continued them, but there muist be many around hidden in drawers etc. I may even have a couple myself. If you want o go this way, put out a call- someone will be able to help.

Max The Magnificent
User Rank
Blogger
Re: 8038
Max The Magnificent   6/10/2014 5:49:51 PM
NO RATINGS
@antedeluvian: It was a low frequency oscillator for all seasons.

There were some great chips back then -- my frequency/function generator uses a microcontroller to create it's waveforms -- it really is amazingly tasty (we just had it up on the workbench -- watch for my blog tomorrow)

betajet
User Rank
CEO
Re: 8038
betajet   6/10/2014 7:54:18 PM
NO RATINGS
antedeluvian wrote: for some reason everyone has continued them...

According to the brief Wikipedia page on the ICL8038:
The triangular waves were converted to sine waves involving a non-linear network of transistors and thin-film resistors.

I'm not an IC design expert, but that sounds pretty expensive.  Maxim used to sell a copy, but it's also EOL.  The Maxim site shows how to use a square wave oscillator followed by a high-order switched-capacitor filter to get sine waves.

Douglas442
User Rank
Rookie
Re: 8038
Douglas442   6/10/2014 9:43:16 PM
NO RATINGS
The ICL8038 is one of those chips that have found their way into modular synthesis applications. As such, there are numerous sites that discuss it's use, provide plans, and even offer sale of these, as well as other hard-to-find devices.

Perhaps one particularly useful design, one which overcomes some of the limitations of the 8038, can be found here:


http://www.birthofasynth.com/Thomas_Henry/TH_main.html 

or, more directly, here:

http://www.birthofasynth.com/Thomas_Henry/Pages/8038.html

The author provides details which include schematics, BOM, and even a PCB pattern. 

... luckily for me, at least, as I currently have ten of these chips to make use of.

David Ashton
User Rank
Blogger
Scaredy-cat.....
David Ashton   6/10/2014 6:18:53 PM
NO RATINGS
@Max.... "Ivan rooted around under a bench and extracted a somewhat battered old case....something that scared the socks off me."

Wuss!!  Doesn't look toooo complicated.  Just a couple of breadboards with a frequency generator and some switches and LEDs.   But your new toy does look very tasty.

I can never get EET to post pictures but in copying your text I got a couple of pictures in and of course they posted in the comment without problem, and instead of struggling to get them in I had to delete them out.  Doesn't it make ya spit???

 

MWagner_MA
User Rank
Manager
Sig gen chips XR2206
MWagner_MA   6/11/2014 7:22:04 AM
NO RATINGS
Max, once again you reinforce the reason a lot of us got into Electronics.... its fun!  Your article caught my attention as I also needed a signal generator for some home projects, but not enough to fork over the cash for some swanky Agilent unit.  I built my own around 1981 around a Radio Electronics (remember those guys?) article using an Exar XR2206 chip.  Still have the unit to this day for audio work.  Keep up the good work :-)

Max The Magnificent
User Rank
Blogger
Re: Sig gen chips XR2206
Max The Magnificent   6/11/2014 9:13:04 AM
NO RATINGS
@MWagner_MA: Max, once again you reinforce the reason a lot of us got into Electronics.... its fun!  [...] Keep up the good work :-)

Why, thank you so much for your kind words -- the strange thing for me is the people who don't see just how much fun electronics can be. Just wait till I have my BADASS Display up and running :-)

MeasurementBlues
User Rank
Blogger
Envy?
MeasurementBlues   6/11/2014 3:05:55 PM
NO RATINGS
@Max how the neighbors will envy me

Or they might call the police.

Max The Magnificent
User Rank
Blogger
Re: Envy?
Max The Magnificent   6/11/2014 3:12:45 PM
NO RATINGS
@MeasurementBlues: Or they might call the police.

Once I had it working -- pushing out a 1KHz sine wave into a little speaker -- I proudly called my wife over to see what my had wrought.

"That's a very annoying sound," was her considered opinion LOL

 

MeasurementBlues
User Rank
Blogger
Re: Envy?
MeasurementBlues   6/11/2014 3:28:25 PM
NO RATINGS
@Max, there's an app for that. It's called Tone Generator. Why to to the trouble of designing hardware when you can get a free app for your phone and have it play on a Bluetooth speaker?

Would you like me to make a video to demonstrate?

Max The Magnificent
User Rank
Blogger
Re: Envy?
Max The Magnificent   6/11/2014 3:33:25 PM
NO RATINGS
@Measurement blues: ...when you can get a free app for your phone and have it play on a Bluetooth speaker?

I did talk about iPad/iPhone/iPod apps and explained why I decided not to use them (sit up and pay attention man!). Also I don;t want to play the tone through a speaker -- I wanted it as an electrical signal whose voltage amplitude and offset I could control.

MeasurementBlues
User Rank
Blogger
Re: Envy?
MeasurementBlues   6/11/2014 3:38:54 PM
NO RATINGS
@Max I wanted it as an electrical signal whose voltage amplitude and offset I could control.

They have analog circuits for that, but your a digital guy.

Max The Magnificent
User Rank
Blogger
Re: Envy?
Max The Magnificent   6/11/2014 3:45:22 PM
NO RATINGS
@MeasurementBlues: They have analog circuits for that...

But I need something that works accuracy :-)

MeasurementBlues
User Rank
Blogger
Re: Envy?
MeasurementBlues   6/11/2014 4:05:41 PM
NO RATINGS
@max But I need something that works accuracy :-)

Are you implyingthat analog circuit have no accuracy? Actually, it's called uncertainly.

 

Max The Magnificent
User Rank
Blogger
Re: Envy?
Max The Magnificent   6/11/2014 4:18:00 PM
NO RATINGS
@MeasurementBlues: Are you implying that analog circuit have no accuracy?

Of course not -- I'm saying it out loud

Max The Magnificent
User Rank
Blogger
Re: Envy?
Max The Magnificent   6/11/2014 4:18:37 PM
NO RATINGS
@MeasurementBlues: Actually, it's called uncertainly.

Are you sure?

Max The Magnificent
User Rank
Blogger
Re: Envy?
Max The Magnificent   6/11/2014 3:34:07 PM
NO RATINGS
@MeasurementBlues: Would you like me to make a video to demonstrate?

Only if you do it in mime! LOL

MeasurementBlues
User Rank
Blogger
Re: Envy?
MeasurementBlues   6/11/2014 3:29:30 PM
NO RATINGS
@Max, I once made an audio oscillator for my father using a 555 timer and then filtering out some of the harmonics.

Max The Magnificent
User Rank
Blogger
Re: Envy?
Max The Magnificent   6/11/2014 3:35:10 PM
NO RATINGS
@MeasurementBlues: ...I once made an audio oscillator for my father using a 555 timer...

It's unfortunate that he'd asked for a new lawnmower :-)

 

MeasurementBlues
User Rank
Blogger
Re: Envy?
MeasurementBlues   6/11/2014 3:40:00 PM
NO RATINGS
@Max It's unfortunate that he'd asked for a new lawnmower :-)

He asked for a frequency counter, too.

Max The Magnificent
User Rank
Blogger
Re: Envy?
Max The Magnificent   6/11/2014 3:46:50 PM
NO RATINGS
@MeasurementBlues: ...He asked for a frequency counter, too...

So you gave him a stopwatch and told him to play a tone through a Bluetooth speaker and start counting...

mhrackin
User Rank
CEO
Another way
mhrackin   6/11/2014 5:48:57 PM
NO RATINGS
Back in the 1970s I created a little circuit that used a SINGLE digital chip to create a pretty good sine wave.  Take an 8-stage shift register (CMOS preferably) and tie the last stage output (inverted; use a transistor if your design doesn't have a spare somewhere).  Oh, and you do need to tie the reset line to a power-up reset (which any digital design should have)That makes what is called a "switch-tail shift register" that will start out with all 8 outputs zero.  First clock pulse will fill the first stage with a "1" which will propagate through until all outputs are 1, at which point the next pulse will start filling with "0"s.  That's a divide-by-16.  Here's the neat part: connect each stage's output to a resistor of a value inversely proportional to sine (22.5 degrees*stage number) ignore the sign! Connect the other ends of all resistors together and to the summing junction (negative input) of an op-amp.  Connect the output of the op amp back to the summing junction with a feedback resistor roughly equal to the parallel value of all the input resistors, and put a small capacitor in parallel with the feedback resistor (this filters the spikes from the sharp edges of the digital outputs). Use your favorite programmable counter design to create the clock at 16 times the desired output frequencies (by changing the programming), or if you have even the tiniest little microP handy, use its programmable timer (of course you could use an 8-bit output parallel port to even eliminate the shift register....).  The rest I leave to the student as an exercise!  You can probably build this today for less than a buck!

 

Max The Magnificent
User Rank
Blogger
Re: Another way
Max The Magnificent   6/11/2014 6:00:55 PM
NO RATINGS
@mhrackin: Back in the 1970s I created a little circuit that used a SINGLE digital chip to create a pretty good sine wave...

I love this stuff. I'd sort of forgotten how we used to cobble circuits together to do "stuff" -- now, whatever we need, our knee-jerk reaction is "how to program this into an MCU"

David Ashton
User Rank
Blogger
Re: Another way
David Ashton   6/11/2014 6:16:52 PM
NO RATINGS
@mhrackin I also used this technique.  It was the subject of an article in Elektor magazine.  I recalculated the resistor values for a 10-bit shift register and used it for a synthesised frequency generator giving a precise 45 to 55 Hz output for testing frequency-sensitive relays (I worked for an electricity utility at the time).  It worked really well.  Because the primary harmonics (for an 8-bit register) are the 15th and 17th, you can just use RC filtering and it gives you an almost perfect sine wave.  I amplified that with a fairly standard audio amp and transformer to 220V for the output.  It was a great project.   Sometime I'd like to take it further and design a wider range generator using a switched-cap filter chip fed by the Shift Register clocking signal to do the filtering.  Oh for a bit more spare time.....

Max The Magnificent
User Rank
Blogger
Re: Another way
Max The Magnificent   6/17/2014 9:46:12 AM
NO RATINGS
@David: Sometime I'd like to take it further and design a wider range generator using a switched-cap filter chip fed by the Shift Register clocking signal to do the filtering.

Ooooh -- that sounds like a good column :-)

zeeglen
User Rank
Blogger
Re: Another way
zeeglen   6/11/2014 8:05:11 PM
NO RATINGS
@ mhrackin

What an elegant idea!  Long ago a test engineer designed a production test fixture for one of my products that required a low frequency sine wave signal.  I suggested that he use a Wien-bridge oscillator, but he was of the digital persuasion and used a squave oscillator, a counter chain, a PROM with the sine conversion lookup table, and a D-to-A.

If only he (and me) had known about what you just described.  Any idea of the distortion specs vs number of shift stages?

mhrackin
User Rank
CEO
Re: Another way
mhrackin   6/12/2014 9:37:19 AM
NO RATINGS
See David's post above.  My original application aws used in a couple of designs covering the full audio range.  As David pointed out, the main distortion products are pretty high-order, thus the single pole of the small capacitor in parallel with the summing op amp does a pretty good job (depending on how many decades of range you want to support). For my designs, the range was a single decade (telecom range of 300Hz-3KHz) and distortion was well under a percent as I recall.  This was back when i worked for Motorola Comm division in South Florida.  My designs always had the highest gross margins in the company despite being considered the "razors" of the business, not the blades!

anon6223816
User Rank
Rookie
Re: Another way
anon6223816   6/16/2014 5:51:27 PM
NO RATINGS
Note that you can use another set of resistors and an op amp to genererate a triangle, square wave, or other approximate (symmetrical) wave form at the same time off the same register, since the output impedance of modern digital chips is very low compared to the R you'll use with the op amp.

mhrackin
User Rank
CEO
Re: Another way
mhrackin   6/16/2014 7:19:01 PM
NO RATINGS
Triangles are really easy: all equal value resistors!   I didn't mention earlier, but all resistors should be 1% tolerance or better metal-film for low noise and distortion.  In volume, these are only a fraction of a cent in surface-mount flavors. The cost of mounting is larger than the piece part cost!

bwmetz0
User Rank
Rookie
PC + Audacity = Tone Generator
bwmetz0   6/16/2014 6:49:33 PM
NO RATINGS
I've never had a chance to verify with a scope (can't afford one), but some of those annoying sounds (sine, square, sawtooth) that your wife complains about can be easily generated with Audacity (http://audacity.sourceforge.net), an opensource project.  They claim 0.001 Hz resolution, but I'm sure it's really a function of your soundcard quality, e.g. software vs. on-board vs. discrete card.  The nice bit is there are additional community driven plug-ins for generating other tones like DTMF, etc.

 

The rig looks sweet, but figured you have a old PC sitting around and since this is an audio project, the response is probably good enough using a device designed for producing the same (think about MIDI files)...just in case you forget the new tasty at home or office one day.

August Cartoon Caption Winner!
August Cartoon Caption Winner!
"All the King's horses and all the KIng's men gave up on Humpty, so they handed the problem off to Engineering."
5 comments
Top Comments of the Week
Like Us on Facebook

Datasheets.com Parts Search

185 million searchable parts
(please enter a part number or hit search to begin)
EE Times on Twitter
EE Times Twitter Feed
Flash Poll
Radio
NEXT UPCOMING BROADCAST
How to Cope with a Burpy Comet
October 17, 2pm EDT Friday
EE Times Editorial Director Karen Field interviews Andrea Accomazzo, Flight Director for the Rosetta Spacecraft.