Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Signal generator ?

Status
Not open for further replies.

curry87

New Member
looking for a no thrills signal generator literally just to learn from and use with oscope.Would want a sinewave waveform,offset,amplitude,freq control at the least.Whats the cheapest/easiest solution buy a second hand one or build one ?
 
Google Wien Bridge oscillator. You can build one. This will give you a sinewave output of varying frequency. Failing that, a 555 timer circuit will give you the same, but a square wave
 
If you want to buy, then it's totally driven by what you're willing to spend. Years ago I bought a very nice Wavetek sweep/function generator from an old guy who reconditioned stuff -- it cost me $65 delivered all the way across the US. It was an outstanding deal and it still does work when called up.

If you have more time than money, building one is by far the cheapest way to go -- and gives good experience. But be realistic about the amount of time it will take you.
 
Google Wien Bridge oscillator. You can build one. This will give you a sinewave output of varying frequency. Failing that, a 555 timer circuit will give you the same, but a square wave
Do you have one that works so difficult to know if it will work or not so many bad ones out there.
 
Some simple Function Generators base on the XR2206 Chip.
That offers Sine, Triangle and Rectangular functionality.
Sine has a little Spike at the top and bottom of the sine wave, at higher frequencies.
There are many solutions for that in the Internet.
The magazine ELEKTOR ( https://www.elektor.com ) bring at least 3 schematics with this Chip, last 20 years.

Pretty good Performance will give you DDS Functon Generators.
They base most on an DDS Chip and will be steered by a Microcontroller or PC.
That's a little more complex, but it bring better results and wider Frequency ranges.
This generator type make very good locking wave forms, as long, as the output frequency is quite low in comparison to the clock frequency. At higher output frequencies the dissortion will be more and more.
A good output filter is a must!
ELV ( https://www.elv.de ) has about 3 Kits for such a Generator in stock.

Most Wien Bridge Generators offers a fine Sine Wave with less distortion.
But sometimes it's not easy to stabilize that generator type for a wide frequency range.

Higher Frequency cost more Money.
Possibly a easy ready to use Function Generator is quite enough for your usage?
 
When looking on eBay I found that most did not have a digital frequency display but a few did...and didn't seem to go for any more than those that didn't. As the one I ended up buying can have an external input I got a free frequency counter too!

It's not exactly state of the art but is fully functioned and all I had to do was squirt some switch cleaner in all the BNC sockets and in all the switches and potentiometers, and it now works perfectly.
 
glad to know you found something. if you were going to build something, a wein bridge oscillator would work, and the addition of a clipping circuit would have given you square waves, then you could make triangle waves from the square waves. a couple of op amps would have added the offset feature.. a lot of the "function generator" circuits start with a square wave, convert it to a triangle wave by driving constant current sources through a capacitor, then convert to a sine wave by the use of a log amp (which is why the sine waves have the little "pips" at the peaks, because they are derived from triangle waves)
 
I've builted such an ATMEGA 16 DDS Generator too.
Such an ATMEGA16 DDS Generator has very low features.
A sine wave above 2kHz look's not longer than a sine.
At 60kHz it looks more like a EKG curve than a sine.
8 Bit resolution for the D/A is very low.

When looking for a DDS Generator, then choose one with a performant DDS Chip.
The steering CPU of such a system can be a ATMEGA16, but not the DDS Generator.
 
Wkrug, did you use an R2R or PWM? And did you program it with C or ASM?
It's harder to do in C as it needs to be aware of the loop time, but it can be done successfully in any combination...

The R2R DDS link I posted previously will produce great sine waves up to 65kHz...
Here is a similar example of an R2R sine at 100Khz: **broken link removed**
That looks like a pretty good waveform to me, the project is here: **broken link removed**

With PWM you prolly want to use an accumulator to catch underflow, some example code I wrote and tested is here:
http://www.avrfreaks.net/index.php?module=Freaks%20Academy&func=viewItem&item_id=1493&item_type=project
This is uses an accumulator to improve PWM resolution, it was written in C for the ATtiny26.
Up to about 30Khz Sine output looks good, but after that the loss of step resolution starts to show without a filter.

And here is an example I made using the DDS chip AD9833, designed to track an ultrasonic system:
http://krazatchu.ca/2008/04/17/ultrasonic-resonant-tracker/
The library for the AD9833 is posted here:
http://www.avrfreaks.net/index.php?...&func=viewItem&item_type=project&item_id=1423

There are many ways to approach this problem, if done right an AVR DSS can be very capable well above audio frequencies...

Michael
http://n0m1.com/
http://krazatchu.ca/
 
Last edited by a moderator:
There was used an Assembler DDS loop with an R2R Network as Output.
The sine wave looks well at frequencies under 2kHz.

Above that limit the waveform appends hardly from the Output frequency against Controller clock frequency.

In the 10kHz wave of your linked site you can see the artifacts of the dds Output generation.

I try to make some Osci- Shots and post again.
**broken link removed**
Such thing should be an 5.1khz sine wave!

The advantage of such a generator is, it's tiny, cheap, easy to use.
Such thing s simple tone Generator is OK. To measure filters or similar things it's not recommendable, because the harmonics
 
Last edited:
It looks like there are only 6 or 7 steps per wavelength, there should be a lot more that that at 5Khz...
In fact that looks a lot like a PWM implementation with a first order filter on the output...
Are you sure it's really R2R and not PWM?

Also, a couple of possibilities:
1) Your loop is too slow, are you using a lut (lookup table) or generating values on the fly?
2) Your MCU clock is too low, or your using a high prescaler ? (16Mhz xtal or internal RC at 1Mhz or 8Mhz?, prescaler is 1?)

Michael
http://n0m1.com/
http://krazatchu.ca/

EDIT: If I get some time later I will capture some images from my AVR DDS...
 
Last edited:
What are the fuse settings of your ATmega16? They should look like this:


You must make sure JTAGen is unchecked otherwise some pins won't be used.
And the SUT_CKSEL fuse must be set to External Crystal. <-- My guess this is the problem...

Also, you may need to also program the eeprom file (.epp), depending on the location of the LUT....

Michael
 
My actual Fuses:
**broken link removed**
My Compiler said the .eep file is emty!

The frequency at the Display and the measured output frequency are the same, so i don't think that's a clock problem.
 
Last edited:
Here is a screen capture of the output after a single RC filter, sine wave 10Khz...
This is the software from:0/

**broken link removed**

I've also updated the post here
Michael
 
Last edited by a moderator:
Your right, if the display and your oscilloscope match up, then it's not the clock...

What are you writing to the timer registers TCCRaX and TCCRbX ?
(or in other words, whats your prescaler and pwm mode?)

Michael
 
looking for a no thrills signal generator literally just to learn from and use with oscope
How about this? Dead simple. Gives square, triangle and sine (approx) outputs. Frequency up to at least 1Mhz.
 

Attachments

  • WaveformGenerator.gif
    WaveformGenerator.gif
    11.2 KB · Views: 279
Status
Not open for further replies.

Latest threads

Back
Top