Forum Home
Press F1
 
Thread ID: 44750 2004-04-29 05:01:00 A stand alone sine wave generator using Atmel chip vpothineni (4911) Press F1
Post ID Timestamp Content User
232919 2004-04-29 05:01:00 Hello everyone...i was actually supposed to be doing another project..but it didnt go as planned. so now im doing

A stand alone sine wave generator using Atmel chip

It requires to run at frequency of at least 25kHz, but the harmonic distortion is not critical and may be as high as 3%.

Preliminary Specifications

(i) The device will operate from a dual supply of nominally 12V, onboard power regulation will be used where required.
(ii) The microcontroller used will be the Atmel AT90S2313 employing a 4MHz resonator as the clock source.
(iii) The output voltage required is 0dBm into 600 Ohms the output impedance is of course 600 Ohms.
(iv) Some means of adjusting the frequency will be provided.
(v) PCB size will not exceed 80mm by 50mm.

So if anyone has any ideas..please let me know..me only a beginne r...so any websites to learn would be great as well..thanx a
lot.

thanx to everyone...
vpothineni (4911)
232920 2004-04-30 05:18:00 Mostly software muddlers here .

Looks like a not-too-hard project, but it's the sort of thing which might be more easily done differently . :D And of course it will have hidden teeth .
They always bite . Here's just a few random ideas . No guarantees . A bit of Google time will help .

The 3% distortion helps . . . you can generate the sine wave by sending sine values (from a table --- and you only need values for 90° because of symmetry) to an 8 bit D-A (can be resistors on the bits of a port feeding an opamp summer) at the appropriate rate . 25 kHz is 40 µsec so a 4MHz clock can handle a reasonable number of samples/cycle . But you'll need a lowpass filter on the output . I don't see a way to use the PWM outputs . . .

The loop which steps though the values is the time-critical one .

You might be able to choose resistor values to
have suitable weights so you could just step through a 0-255 count on the port to get a sine output, rather than using a table, and the 1-2-4-8 . . . sequence, or the standard ladder .

It would be much easier with a direct digital synthesiser chip . ;-) You might get away with a voltage-freq converter, driven from a D-A . Either of these would need filters to knock the corners off the square wave to get a sine approximation . :D

The ouput level is the trivial part: an adjustable gain opamp with 600 Ù in series witht he output,and adjust to 2x 0 . 774V rms (because the OdBm is when feeding a 600Ω load) . Pk-pk volts is higher than than rms . ;-)

Varying frequency . . . just set up a freqency and run a tight loop . Use an interrupt to get into a command mode .

A 10MHz clock would give a few more spare cycles . I hope the 2313 has one cycle/clock; some cpus give 1cycle/4 clocks . ;-)
Graham L (2)
232921 2004-05-03 00:01:00 Thank you Graham L so much....thats shud give me a good start.
will keep u guys posted :)

thank you again
vpothineni (4911)
1