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

From analog to digital signal filtering

Signal filter is electrical equipment that attenuates the unwanted signal characteristic wave. Filters can be analog or digital. An analog filter processes analog signals. They are mainly arranged with capacitors and resistors. Digital signal filters process digital signals which are quantized. Digital filters are arranged with solid state components to process the signals. Let’s start from analog filters. Analog filter is a circuit which filters unwanted frequencies. Filtering is done by choosing circuit transfer function. Simplest analog low pass filter: The current in RC circuit can be calculated as follows: Then if we think about digital filtering, then Uin(t) and Uex(t) we can change to xn=x(nT) and yn=y(nT). Then we can rewrite equation: Then we get: yn=a0xn+a1xn-1-b1yn-1, Where a0=1/(1+T/RC), a1=-1/(1+T/RC), b1=-1/(1+T/RC). This equation now can be used to build digital filter. Filter can be described using response function. Response function of analog filter is reaction to step function while digital filter response function is response to step function in samples: u[n] = 1, if n>=0 u[n] = 0, otherwise According to method described in previous article we can calculate filter transfer function h(n); Results are in following table: Filter h at t/RC 0 0.5 1 1.5 2 Analog 1 0.779…

Continue reading

Building embedded software using algorithm flow charts

Embedded software consists of various functions performing particular tasks. Before writing any ASM or C code it is good to draw algorithm flow chart. Flow charts are visual method of representing inner algorithm. It is easer analyze the algorithm and write the code according to diagram. The main parts of diagram: Fig 1. Simple series instructions Fig 2. Parallel instructions Fig 3. if-then-else structure Fig 4. while (for) structure Fig 5. do until structure Fig 6. case structure For each function or procedure make separate algorithm flow charts – this enables easer integration of them in to main function. Sample how program flow chart may look. Fig 7. Sample program Flow Chart

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 signal generator For controlling LCD, I’ll be using three wire interface. I described how to connect the LCD using three wires. If using only three wires for LCD, there are more ATmega8 pins left for other functions connecting DAC and buttons. As DAC in my project, I’ll be using the R-2R…

Continue reading

Atman AVR kick start

Atman AVR is integrated c/C++ compiler IDE for Atmel AVR microcontrollers. AtmanAvr C development environment includes ProjectWizard, CodeWizard, Workspace, Output, Text editor, Binary editor, Debugger. The compiler itself is GCC compiler for AVR. The only thing that makes it commercial is the integrated environment: ProjectWizard – lets you customize project through series dialogs and then it generates initial code automatically; CodeWizard – helps in programming routine tasks like creating new modules, adding functions navigating; Advanced workspace where you can find File View, Class View and I/O View and many more. If you would like to try this IDE you may download AtmanAvr C IDE from manufacturers site https://www.atmanecl.com. Bellow is a Atman AVR kick start guide with some screenshots: Create new project File->New: In the Project Name enter the name of your project. Also select where your project will be located. From tab Projects select one type of projects: AVR C Wizard(boot) – Bootloader project using C; AVR C Wizard(exe) – standard C program – usually this is the choice for your projects; AVR C Wizard(lib) – wizard for library creation using C; AVR C++ Wizard(boot) – Bootloader project using C++; AVR C++ Wizard(exe) – standard C++ program; Blank –…

Continue reading

Tradeoff between DC motors and stepper motors

This is small comparison made between three types of motors: DC motors and stepper motors. Let’s see what are their cons and pros: Stepper motors doesn’t require feedback to determine position. The position is determined by microcontroller by sending pulses to stepper motor; When load is to high to stepper motor, then it may stall and there is no way to report this to microcontroller; DC motors with feedback can report stalls on high loads or other conditions; Stepper motor has no brushes – there is no EMI; Stepper motor may produce full torque – this enables them to hold rotor in desired position; DC motors deliver more torque at higher speeds than stepper motors; Stepper motors can produce low speed without loss of torque. Dc motors looses torque at low speed because of low current; Lets conclude this all. Systems with stepper motors and without feedback cannot determine what motor is really doing. For this reason stepper motors usually are used where loads are known (like floppy disk or printer). If loads are known and determined, then there some smart control can be applied – for smaller loads there can be smaller current applied in other hand for higher…

Continue reading