AVR controlled DDS generator software writing

During my spare time, I am developing the program for the AVR controlled DDS generator. I decided to write software using WinAVR tool-set. How far ahead I have moved with this? I have implemented: Menu system; Reading previous generator configuration from EEPROM; Setting signal mode; Storing last generator configuration to EEPROM to be loaded after reset; Four types of signal output (square, sawtooth, triangle and sine wave); Things I still need to do: Ability to change signal frequency; Implement other signals (listed below); Make program clean-up; Signals in AVR controlled generator: 0 – OUT_|¯|_ – square wave(done); 1 – OUT|/|/| – sawtooth(done); 2 – OUT|\|\| – reverse sawtooth(awaiting); 3 – OUT/\/\/\ – triangle(done); 4 – OUT~~~~ – sine wave(done); 5 – OUT-NOISE – noise signal(awaiting); 20 – PWM-OCC – timer output compare mode(awaiting); 21 – PWM-SINMDS  sine wave modulated PWM(awaiting); 22 – PWMSQSMDS – sine wave modulated PWM. PWM positive,…

Continue reading

Creating custom LCD characters using WinAVR

Standard LCD modules come with built-in Character MAP stored in LCD ROM memory. There is plenty of characters for your needs, but still, you may need some special ones like backslashes, or some symbols that are in different languages. For this LCD has a reserved RAM area for storing eight 5×7 dot matrix character patterns. In the table above this area is in the first column with addresses starting from 0 to 7 (from 0b00000000 to 0b00000111). This means that you can define any characters in these 8 fields as you like and use them by calling them by addresses from 0 to 7. To define one character, you will need to write eight bytes in a row to CGRAM memory For 0 character address (DDRAM=0): So for the first character creation procedure would be: The cycle of 8 iterations: Send command to LCD with CGRAM address from 40h to…

Continue reading

AVR controlled signal generator-first impression

Lazy evening. I decided to take a couple of shots of couple generated signals. Without going too deep into timings, I wrote a couple of algorithms to make sure the signals are generated correctly at all voltage range 0-5V. First is the Sawtooth signal using ASM in AVRStudio:   .INCLUDE “m8def.inc” .DEF tmp = R16 ; Multipurpose register ldi tmp,0xFF; Set all pins of Port D as output out DDRD,tmp sawtooth: out PORTD,tmp inc tmp rjmp sawtooth (My oscilloscope is old so sorry for bad quality) <p > Second signal Triangle. This one I programmed using WinAVR toolset. int main (void) { uint8_t x=0, y=0; atmega8init(); for (;;) /* Note [6] */ { if (y==0) { x++; if (x==255) y=1; } else { x–; if (x==0) y=0; } PORTD=x; } return (0); } It is evident that signals are generated correctly at all voltage interval 0-5V. Later I will probably…

Continue reading

AVR controlled signal generator-skeleton board

This is continuing of thread AVR controlled signal generator. In earlier post 1 layer PCB prototype I described a little about making PCB of this small project. Now a few words about soldering and making the first test run. >This is my PCB board’s bottom. During soldering I discovered one mistake – ISP headers pin MISO and MOSI were swapped. So I had to do some fixes (the green wire). Another small problem, I discovered, was that I couldn’t find 20k SMD resistors for my R-2R leader. For this DAC R-2R leader, I need 10k and 20k resistors to make DAC work properly. So I decided to make “fun” with my Board and soldered 10k SMD resistors in series to gain 20k:

Continue reading

AVR controlled signal generator-1 layer PCB prototype

This is continuing of the thread of making AVR controlled signal generator. This section is devoted to 1 layer PCB prototype making using ultraviolet light exposure and etching. I’ve chosen Eagle as PCB designing software. This is convenient software for making hobby circuits. First I designed a circuit of AVR controlled signal generator: AVR controlled signal generator Circuit image When Circuit is designed, then follows PCB tracing. The resulting PCB I got is here: Not all traces were routed. I will need to connect some places with wires because there left some traces unrouted.

Continue reading

AVR controlled signal generator design considerations

A signal generator is second must have tool after oscilloscope while working with electronics designs. I don’t have any signal generators, so I decided to make one. This gone be simple AVR controlled signal generator. I’ve chosen Atmega8 microcontroller as this is simplest one of Atmega’s series microcontrollers. It has 8kB flash memory. This is an initial post of the project. I have only designed a schematic and PCB board. I’ll be adding project progress in further posts. A little bit about AVR controlled signal generator. This is going to be stand-alone generator coated in 100x60x35mm metal box, the one I’ve found in my drawer. It will be powered from the 9V battery (through 7805 voltage regulator). Controlling will be done with a series of buttons on the box side. And information will be viewed on the 2×16 LCD screen on top of the box. Simplified design of AVR controlled…

Continue reading