Rethinking AVR DDS3 signal generator project

These things happen all the time. When you start a new project but from the beginning start feeling that it’s not what you wanted. Usually, they end up collecting dust. I think there is nothing shameful because it is better to fail than do nothing. There are thousands of examples where people, companies start new projects with enthusiasm but they never reach the daylight. But without those efforts, we wouldn’t see other great projects and products. Not all of them are made from the first try. It’s been over a year since the announcement of AVR DDS3 signal generator. As you have noticed, there is no progress so far on it. And I am going to give up on it for a couple of reasons. From the beginning, I didn’t feel comfortable with it.

Continue reading

AVR DDS3 boards have arrived

Finally some update on AVR DDS3 signal generator. Circuit is practically done and PCBs are made. I decided to go with two microcontrollers on board to make it more functional. One microcontroller Atmega328P is gonna be dedicated to user interface and signal generator control. Second Atmega88 is gonna be used for signal generator only. This will give un-interruptable signal output while changing parameters or simply doing signal sweeps. Simple keypad should be convenient for entering frequency values and menu navigation.

Continue reading

Modeling of analog part for DDS3 signal generator

When building AVR DDS2 signal generator, there were lots of discussions about signal conditioning in the analog part of the device. The first argument was that LM358 wasn’t the best choice for this purpose. Another one pointed to the sine wave that wasn’t smooth enough. As you can see, there are some dents on it. Other waveforms also are distorted especially when higher voltages are selected. This asks for a better analog part. Some people suggested to replace LM358 with OPA2134, but it seems to be quite an expensive choice. In my opinion low noise, general purpose op-amp can be great too. I’m going to give a try to Texas Instruments TL074 low noise op-amp. It is low power, high slew rate (13V/us) IC – almost five times faster than LM358 and for the same reasonable price.

Continue reading

AVR DDS signal generator V2.0

Finally, the second version of the improved AVR DDS signal generator is here. First AVR DDS V1.0 generator was only an attempt of running the DDS algorithm without any analog amplitude control. In this DDS generator version, I still wanted to keep things as simple as possible using a minimum count of widely available components in the updated circuit. Also, I kept a single-sided PCB approach. AVR DDS specification AVR DDS signal generator V2.0 is a firmware-based DDS signal generator which uses slightly modified Jesper’s mini DDS algorithm which was adapted to AVR-GCC C code as in-line ASM. The AVR DDS signal generator has two outputs – one for DDS signal and another for high speed [1..8MHz] square signal – which may be used for reliving microcontrollers with wrong fuse settings or for other purposes where a high-speed square signal may be needed. High speed (HS) signal is output directly from the Atmega16 OC1A(PD5) pin. The DDS output is used for all complex signals that are generated via R2R resistor network and is adjusted via LM358N offset and amplitude regulating circuits. Two potentiometers can control offset and amplitude. The offset can be controlled in range +5V..-5V while magnitude in range…

Continue reading

AVR-DDS signal generator in-line ASM explained

I have got a couple of questions (in fact not a first ones) for AVR DDS generator I have built: “that’s all the asm code that I don’t understand. Could you explain it? Is it possible to do it with inline asm (only in C)?” I decided to explain this part more deeply because it took some time for myself to figure this all out. First of all, what we have to do, it is to implement simple DDS algorithm. In a few words, Direct Digital Synthesis(DDS) is known as Numerically Controlled Oscillator. Simple rule: NCO-based DDS is a point(memory location)-skipping technique (and a constant interpolation of the stored signal) and runs at continuous update(clock)-rate. As the DDS output frequency is increased, the number of samples per waveform cycles decreases. Practically speaking let’s have some math. We have a clock generator connected to MCU. In my case F_CPU=16000000Hz. This is our Clock In. Then we have sinewave map stored in rom: const uint8_t sinewave[] attribute ((section (“.MySection1”)))= //256 values {0x80,0x83,0x86,0x89,0x8c,0x8f,0x92,… If we have 256 values of a sine wave for a single period, then at clock rate 16MHz picking each value from the table we would have max sine wave…

Continue reading

AVR DDS signal generator V1.0

Sometimes when tuning various electronic hardware, we need a simple signal generator with different waveform and frequency. One of the options is to by a professional with variable gain professional coating and many additional functions. But if you are an amateur, you might want to build one. This small project is dedicated to making one of those signal generators.  

Continue reading