Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
A DDS Signal generator By Les MW0SEC Objectives and requirements • A stable/accurate signal generator having a frequency range of: • 1 c/s – 40 Mc/s • Amplitude modulation • Calibrated attenuator giving an output of 100 mV rms max, reducing to -100 dB in 1dB steps. • Easy operation – particularly fine tuning. Resources • • • • AD9850 DDS module with 125 Mc/s clock PIC controller 16F628. 822 Voltage controlled amplifier. A commercial attenuator covering 0-100 dB in 10 dB steps. • TL071 Op. amp configured as stable oscillator for amplitude modulation. Block diagram Xtal Display PSU Keypad Set level summer ∑ Encoder (Tune) Programmer interface DDS Module CPU Mod. Gen. VCA Attenuator (Analogue section) Output The AD9850 DDS • This device produces a particular frequency by synthesising a sinewave from a crystal clock. • The frequency is set by loading a binary word having a value where: • fOUT = (Δ Phase × CLKIN)/2^32 • This means binary word = (2^32 / oscillator frequency in c/s). How to control things • I used a PIC (16F628). This is a small fast microprocessor with two 8-bit busses which can be configured as input/output. • Due to the limitations of the device, I increased the address range with a TTL address decoder. • I used a diode matrix to scan the keyboard and encoder. Address Strobe 1 The diode matrix +ve Pull-up resistors D0 D1 D2 Address Strobe 2 The data lines are held high by the pull-up resistors. When the address strobe goes low, if a switch is pressed, the data representing the switch appears on the data bus. The diodes separate the data paths. Data bus Address decoder S0 S1 Address 000 to 111 (0-7) A0 Eight possible Decodes. A1 74LS138 A2 S7 Expand three pins to eight addresses Hard sums! • The PIC is a simple device intended to control the likes of washing machines. Making it do multiple precision addition and multiplication involves a bit of thought. • Two number bases are required. Decimal, for the human interface and Binary for the internal operations. In addition, the display requires ASCII characters. Hard work! • For each click of the encoder, the processor has to add/subtract the tuning increment from the 32 bit frequency word, multiply the result by 34.359738(ish) and load the result to the DDS. It then has to convert the number to decimal, format it and feed it to the display. This requires a lot of code……. Tuning • Tuning is achieved by a rotary encoder. Data (A) Strobe Data (B) Shaft The data output when the shaft is turned gives a sequence of numbers: 0 – 2 – 3 – 1 for one direction and 0 – 1 – 3 – 2 for the other, so any data change Indicates an increment and by analysing the sequence, we can determine if The increment goes up or down. I used an encoder with detents, which gives an output of zero when at rest. Controlling amplitude • Now we have accurate frequency, we need accurate amplitude. This is achieved by a voltage-controlled wide band amplifier. A meter indicates carrier level and this can be set by adjusting the VCA control voltage. Modulation is achieved by summing an audio voltage with the control signal. The attenuator. • So far we have achieved an accurate frequency at a known level. We need to be able to attenuate this down to the microvolt level in convenient steps. I cheated here and used a commercial device which was in the junk box. This gives a range of 0 to -100 dB in 10 dB steps, The “inbetween” dB’s can be set on the carrier level meter. The attenuator (2) • The design of an accurate attenuator is a question of simple arithmetic – all you need is a network like this: RA RA RB • The problem arises in terms of screening to prevent leakage at VHF. This requires some precision machining for housing. VCA, Modualtor, PSU. Credits • Firstly to Stewart (ETF) for inspiring me to do the project and for sending through some examples. • Secondly to Curtis Preuss, (WB2V) from whom I ripped off some code in the multiply routine. • Lastly to AMD for making a really useful device!