Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Forums > Electronic Projects Design/Ideas/Reviews


Electronic Projects Design/Ideas/Reviews Are you building an electronic project or want to? Maybe you need some assistance? Come and submit your electronic questions here and let our experienced members find a solution.

Reply
 
LinkBack Thread Tools Display Modes
Old 23rd September 2007, 07:19 AM   (permalink)
Default Microcontroller based Function Generator

hi friends what about Microcontroller based Function Generator project using some AT89c2051 or higher an DAC 0808 ,and LM741 for c/v conversion to generate Sine, square, triangle, and sawtooth waveforms , and it also have some capability like
(1) To display the status on LCD whats going on at output (like what waveform at what freq)
(2) Also it can produce variable frequency by pressing up and down button then start
http://upload.wikimedia.org/wikipedi...eforms.svg.png
TPS is offline  
Old 23rd September 2007, 04:20 PM   (permalink)
Default

You are here too?
Bury the very old LM741 opamp and use a modern opamp that has enough power bandwidth.
__________________
Uncle $crooge
audioguru is offline  
Old 24th September 2007, 03:17 AM   (permalink)
Default

Fast, fine frequency control isn't easy to do using micro controllers, you generally have issues with the clock rate the chip is running at being different than the frequency you're trying to generate. As long as the output signal is divisable by the MCU clock this can be avoided but this will limit your frequency output. You could use an adjustable clock source for the MCU, perhaps from an analog PLL. The MCU could adjust this PLL to get a desired running frequency by using some other external clock as a refrence on an interupt. It's basically a frequency counter in reverse. Instead of using a fixed sampling period to determine a variable external clocks frequency, you use the fixed external frequency pulse to determine the local oscilator's frequency.
__________________
"Because I be what I be. I would tell you what you want to know if I
could, mum, but I be a cat, and no cat anywhere ever gave anyone a
straight answer, har har."
Sceadwian is offline  
Old 24th September 2007, 03:49 AM   (permalink)
Default

Quote:
Originally Posted by Sceadwian
Fast, fine frequency control isn't easy to do using micro controllers, you generally have issues with the clock rate the chip is running at being different than the frequency you're trying to generate. As long as the output signal is divisable by the MCU clock this can be avoided but this will limit your frequency output. You could use an adjustable clock source for the MCU, perhaps from an analog PLL. The MCU could adjust this PLL to get a desired running frequency by using some other external clock as a refrence on an interupt. It's basically a frequency counter in reverse. Instead of using a fixed sampling period to determine a variable external clocks frequency, you use the fixed external frequency pulse to determine the local oscilator's frequency.
Isn't that like arguing that CD players can only reproduce frequencies that are divisors of the sample rate?

A table and linear interpolation would give you any frequency required. Obviously, as the frequency increases then the CPU clock will have more of an effect. I would guess that for audio frequencies, this would be easily doable with a microcontroller.

Mike.
Edit, missed that sentence in the middle - "this can be avoided but this will limit your frequency output"

Last edited by Pommie; 24th September 2007 at 03:51 AM.
Pommie is offline  
Old 24th September 2007, 04:05 AM   (permalink)
Default

The DAC referenced by the original post has a 150ns settling time for a rail to rail swing, that's over 6.5MHz's. An at89c2051 has a maximum clock frequency of 24mhz, so I'm assuming this is a real function generator not an audio one. TPS would need to specify his desired frequency range for each function (they're not all going to be the same) and desired resolution.

I'm not sure of the jmp instructions execution speed on this chip, but it's either 2 or 4 cycles so you'd be limited to either 8mhz or 4.8mhz for a looping pattern, or the full 24mhz for a one shot that fit within flash space.
Aliasing can and does occur on a CD player, but it's either filtered on the final output stage or it's not audioble to the human ear. If this is digital/analog electronics usage aliasing will make a function generator effectivtly useless.
__________________
"Because I be what I be. I would tell you what you want to know if I
could, mum, but I be a cat, and no cat anywhere ever gave anyone a
straight answer, har har."

Last edited by Sceadwian; 24th September 2007 at 04:15 AM.
Sceadwian is offline  
Old 25th September 2007, 11:59 AM   (permalink)
Default

I haven’t done that with a microcontroller. But the below readymade FUNCTION GENERATORS I have measured with a frequency counter done by a microcontroller.

ICL8038, XR2206, MAX038
__________________
Gayan

My Website
http://gsmicro.blogspot.com/
Gayan Soyza is offline  
Old 25th September 2007, 01:54 PM   (permalink)
Default

Quote:
Originally Posted by Gayan Soyza
ICL8038, XR2206, MAX038
They are all not made anymore and are obsolete.
__________________
Uncle $crooge
audioguru is offline  
Old 25th September 2007, 06:25 PM   (permalink)
Default

I saw the ICL8038 surplus $4 I think, BGMICRO(?)...

Anyway, search for 'AVR DDS', saw several done in software. Don't remember all the chips, but there was a Tiny2313, ATmega88, and ATmega8. Couple of PIC versions as well.
HarveyH42 is online now  
Old 26th September 2007, 01:04 AM   (permalink)
Default

It really all depends on the frequency range and resolution desired. The AVR ones are good to a couple hundred khz's the resolution is pretty good
__________________
"Because I be what I be. I would tell you what you want to know if I
could, mum, but I be a cat, and no cat anywhere ever gave anyone a
straight answer, har har."

Last edited by Sceadwian; 26th September 2007 at 01:06 AM.
Sceadwian is offline  
Reply

Bookmarks

Thread Tools
Display Modes



Similar Threads
Title Starter Forum Replies Latest
analog function generator theory schematic walters General Electronics Chat 13 16th December 2005 05:28 PM
Function Generator question: What is GATE function? Cifrocco General Electronics Chat 8 14th April 2005 04:11 AM
Function Generator output driver evandude General Electronics Chat 6 31st January 2005 08:49 PM
Microcontroller based UPS grandestlama Micro Controllers 6 23rd August 2004 05:00 PM
problem with function generator samcheetah General Electronics Chat 0 17th April 2004 08:53 AM



All times are GMT. The time now is 01:53 AM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker