PDA

View Full Version : Sine wave generator



Mario
- 14th March 2006, 00:42
Can I use the Pic to generate me 10 MHz pure sine wave.IF it is possible can someone help me with the code.

Darrel Taylor
- 14th March 2006, 01:18
Yes, but only if you use a 16F84 @ 4Mhz :rolleyes:

Well, actually, No.

If you had an 18F running at 40mhz, you could execute 1 instruction per cycle of that 10mhz. That's not enough to add 2 numbers, let alone generate a sine wave.

Now, if you really meant 10khz, then Yes, you can get close with FREQOUT. But it won't be "Pure".

.

mister_e
- 14th March 2006, 03:32
Is the frequency of 10MHZ may change or you want it fix?

Some Wein bridge Op-Amp circuit are possible.. at 10MHZ.. may work or not, never tried it before.

MAX038 will work... not cheap, do too much things

10MHZ square wave TTL or CMOS based and integrated twice (or more) with low pass/bandpass/highpass filter using op-amp.

If your project will use a PIC.. why not choosing a 10MHZ Crystal and send the sgnal to a buffer... then send it to those low-pass filter?

Mario
- 14th March 2006, 16:53
Is the frequency of 10MHZ may change or you want it fix?

Some Wein bridge Op-Amp circuit are possible.. at 10MHZ.. may work or not, never tried it before.

MAX038 will work... not cheap, do too much things

10MHZ square wave TTL or CMOS based and integrated twice (or more) with low pass/bandpass/highpass filter using op-amp.

If your project will use a PIC.. why not choosing a 10MHZ Crystal and send the sgnal to a buffer... then send it to those low-pass filter?


Actually why I 'm thinking in that way, because I'm restricted with 9 v battery so you can't use opamp and it's is not simple to design it using transistors (I'm not good in that).

As MR. Darrel Taylor said it's not possible with PIC , then help me with any circuits.

Luciano
- 14th March 2006, 18:27
Hi Mario,

Search DDS (Direct Digital Synthesis).
Search with Google: DDS 16f84

Examples with an AVR:
http://www.myplace.nu/avr/minidds/
http://www.geocities.com/leon_heller/minidds.html

Best regards,

Luciano

Mario
- 14th March 2006, 19:05
Hi Mario,

Search DDS (Direct Digital Synthesis).
Search with Google: DDS 16f84

Examples with an AVR:
http://www.myplace.nu/avr/minidds/
http://www.geocities.com/leon_heller/minidds.html

Best regards,

Luciano
thank you for ur co-operation but that will not work with me. My project should be portable (not connected PC).what I want exactly is simple (sinewave) oscillator circuit with a single supply (not more than 9v) at 10 MHz or more.

Luciano
- 14th March 2006, 20:26
Hi,

The two links I posted run with a 9V battery.
You don't need a PC. Add a keyboard and
an LCD if you need the ability to enter
a user selectable frequency.

Luciano

mister_e
- 14th March 2006, 21:23
why are you thinking that it will not work with OPAMP even @9V?

What else the project do? Do you need a variable frequency?

Mario
- 14th March 2006, 22:03
why are you thinking that it will not work with OPAMP even @9V?

What else the project do? Do you need a variable frequency?

..............

I know there are a single supply op-amp's but it might not give me acceptable sine wave ( amplitude )....and frequency...... if I can do it by op-amp just help me with good one I can use.

For me no need for variable frequency......... I wana connect it to power amplifier. I need my frequency to be stable that's why I need crystal.

I think it should be done in more simple way (n. of Chip used ,cost,....) than what they advice me to do..

mister_e
- 14th March 2006, 22:17
How about my favourite LT1722?

Maybe i'll try to figure out something. So if i correctly undrstand, the only thing you need is a simple 10MHZ SineWave generator... nothing else, no PIC, no LCD nothing else?

Mario
- 14th March 2006, 22:36
How about my favourite LT1722?

Maybe i'll try to figure out something. So if i correctly undrstand, the only thing you need is a simple 10MHZ SineWave generator... nothing else, no PIC, no LCD nothing else?

That's what I'm trying to tell.

I will try with LT1722 thanxx

mister_e
- 15th March 2006, 19:35
Something that spring to mind using a PIC.

Use a 12F629 or else with an external Crystal. Fed the CLKOUT signal to those OpAmp Filter.

The PIC will manage the Power-on/Off AND monitor the battery voltage. Could be interesting now... well just an idea.

One other using a 12F683.
This one Will produce a PWM signal on GP2 to generate a negative voltage for the OpAmp and do the same things as the previous suggestion.

Unfortunately those baby 10F can't run with an external OSC... that would be perfect here...

mister_e
- 15th March 2006, 19:45
mmpfff, forget the PWM stuff. We can even have +V and -V by designing the power supply another way...just by moving the Ground reference you can have +4V, kinda gnd and -5V if you're using a fix 5Volt regulator.

The main problem will be when the battery voltage will drop... mmm i still prefer the PWM stuff after all

ChrisMicro
- 17th March 2006, 00:30
#12 Of Steve will do the trick