AVR controlled DDS generator software writing

During my spare time I am developing the program for 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); Still need to do: Ability to change signal frequency; Implement other signals (listed bellow); 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, SQ  negative polarity(awaiting);…

Continue reading

Creating custom LCD characters using WinAVR

Standard LCD modules comes 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 first column with addresses starting from 0 to 7 (from 0b00000000 to 0b00000111). This means, that you can define any type of 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 row to CGRAM memory For 0 character address (DDRAM=0): So for the first character creation procedure would be: 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 couple shots of couple generated signals. Without going to deep in to timings I wrote couple algorithms to make sure the signals are generated correctly at all voltage range 0-5V. First is 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 really 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 obvious that signals are generated correctly at all voltage interval 0-5V. Later I will probably use signal (pulse, sawtooth,…

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 few words about soldering and making first test run. >This is my PCB board’s bottom. During soldering I discovered one mistake – ISP headers pins 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 thread of making AVR controlled signal generator. This section is devoted for 1 layer PCB prototype making using ultraviolet light exposure and etching. I’ve chosen Eagle as PCB designing software. This is very handy software for making hobby circuits. Firs I designed 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

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. For controlling I’ve chosen Atmega8 microcontroller as this is simplest one of Atmega’s series microcontrollers. It has 8kB flash memory. This is initial post of project. I have only designed schematic and PCB board. I’ll be adding project progress in further posts. 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 9V battery (through 7805 voltage regulator). Controlling will be done with series of buttons on box side. And information will be viewed on 2.×16 LCD screen on top of box. Simplified design of AVR controlled signal generator For controlling LCD display I’ll…

Continue reading