×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

variable frequency sine wave control from a mpc

variable frequency sine wave control from a mpc

variable frequency sine wave control from a mpc

(OP)
Hi Everyone!

I am trying to send a signal to an audio amp which is a sine wave.
I need to be able to change the frequency of this sine wave.

Can i use a microprocessor like a motorola HC11 to send a pulse width modulation signal to some device that changes the frequency of the sine wave based on the PWM signal? What would this device be? somthing like a wein bridge oscillator circuit?
I am thinking of frequencies from 1kHz to 10kHz.
Is there another way i can do this?
Thankyou.
marko



RE: variable frequency sine wave control from a mpc

If you can generate variable frequency PWM in HC11, you can feed this signal to an RC to filter high frequency components. The output of RC filter will be  sine wave, In fact this is the simplest DAC tecnique used in some microcontroller as you might aware.

RE: variable frequency sine wave control from a mpc

Hello gwarrrr,

There is a number of ways how you can do this. Sinewave through PWM is the lowest cost option.
The sinewave you get is not very clean, the next harmonics are somewhat 35-40dB off (in your desired frequency range with a standard MCU), which makes it good enough for many applications. It's good enough that you can't tell the difference with a scope.

if you need better, than a chip like the ML2035 would be the better choice. Sinewave through D/A conversion with an R2R ladder or a real D/A converter would be better, too, but requires more components.

There is a number of application notes out there about generating sinewave through PWM with a micro, very often combined with DTMF generation. Try Atmel AVR, Microchip and Intel appnotes for "DTMF" and "Sinewave" keywords.

You can find a good one for 8051s with PCA here:
http://developer.intel.com/design/mcs51/technote/3349.htm

All you need is an output filter after the PWM output. That can be as simple as a simple RC filter, depending on your PWM frequency. Realistically, with a desired output of 10kHz and a PWM frequency of 30-60kHz (the performance of most MCUs won't allow much more, since you'll need an interrupt routine at that frequency), you will need a second or fourth order output filter.

In that case, make sure the used filter opAmp accepts an input voltage between 0 and your micro supply voltage. If it is supplied by the same voltage, use a rail-to-rail type, or use a voltage divider at the PWM output.



RE: variable frequency sine wave control from a mpc



Since you have a PWM signal, it is easy to send a sinewave .
Maintain the PWM signal frequency accurate, modulate the duty cycle.
Lets say: you have a 100 KHZ PWM signal that is 50 % duty cycle.
Take the modulating sinewave to vary the duty cycle from 10 % to 90 %.

Down stream the receiver for the PWM signal will trigger a monostable that has a duty cycle of 50 % ( equal to the signal w/o modulation.

Compare the monostable pulse duty cycle with the PWM signal duty cycle, the difference either positive or negative is passed via an Active RC filter  ( 18 to 36 DBs/Octave) to an amplifier, having a filtered sinewave represetning the modulated sinewave.

This I have done many years ago.

Regards

Nandos

RE: variable frequency sine wave control from a mpc

One cute way of generating a sinewave, or a phase-locked group of sinewaves for, say, a 3-phase application, is as follows:

Use Excel or similar to scale a sinewave into a series of discrete samples from hex value 00 to hex value FF.

Load samples of the sinewave in the correct sequence into a memory IC. Connect the memory output lines to a D/A converter. By clocking the memory IC using a digital counter at a user-controllable frequency, the samples are reconstructed into a sinewave of reasonable quality.

Use 3 memory ICs for three phases and skew the counters by 1/3 of a counter cycle, or load the data into the three memory IC's with an addressing offset and use a common counter (easier).

Frequency can be set very accurately if required using a cystal clock, or with a bit more effort sync'd to an external source using a PLL or some DSP algorithms.

RE: variable frequency sine wave control from a mpc

Suggestion: The modulation type of sine wave is also related to the power requirement the sine wave is linked to. This then determines type of hardware.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources