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
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
RE: variable frequency sine wave control from a mpc
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
http://robotics.eecs.berkeley.edu/~sastry/ee20/modulation/node4.html
etc. for more info.
What about a demodulation at the other end?
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
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