Programming and customizing AVR microcontrollers

AVR microcontroller programs can be classified by programming method – how to program is loaded into microcontroller from the computer. One is a Parallel programmer (byte by byte). This isn’t a popular programming method. But it is a fast programming method. Using a parallel programmer, you can set fuses that will protect you from using the ISP method. But the main disadvantage of parallel programming is that you have to remove the microcontroller from the circuit. This might be used when producing a series of the same kind of preprogrammed microcontrollers before they are soldered into the board. The parallel programmer can program the RESET pin to be used as a fully functional I/O line; this is why ISP cannot be used after this procedure. Restoring of the RESET function can only be done with a Parallel programmer. The serial programming interface is more convenient for electronics hobbyists. The main benefit of the ISP programmer that you can program the microcontroller directly on board. ISP programmers can be connected to COM or LPT port. COM port is becoming obsolete as it requires additional circuitry, while LPT programmer can be as simple as few wires connecting AVR to LPT port. Popular…

Continue reading

Embedded C program libraries and linking

What is a compilation of programs? Maybe it is more or less clear? But what is program linking? I am sure many beginners heard of this but done exactly know what it is. In a few words, I can say that linker creates an output file from relocatable objects. The compiler is not one big program. It usually consists of up to a dozen smaller programs. Some programs, so-called program driver, control these programs. This driver can be a makefile and make.exe program. The whole compiler pieces are the preprocessor, the syntactic and semantic checker, code generator, the assembler, the optimizer, the linker, and make program. Lets see a common example of the compiling procedure: These programs are split into pieces for easier design and maintenance as each is a specialized program on its own. In many cases, the same program can be used for different programming languages. One disadvantage of running different tools will take a longer time than running one bigger program because there is a need to send information between programs.

Continue reading

Sensing Sound Wave with microcontroller

A sound wave can be sensed by using a sound sensor. If you are designing a robot, sometimes it is useful to enable sensing of sound. Then you can program your robot to follow your voice commands. In some cases, sound wave sensors are used as collision sensors. A sound wave sensor is a microphone. The microphone is a device that converts sound pressure into electric signals. Let’s see how sound waves can be sensed. As we already know, the sound is a complex signal which consists of multiple different frequency waves. One sound wave can be represented as sin or cos signal: When many of such waves are summed (s called harmonics), we can represent any analog signal- any shape and any frequency.

Continue reading

IrDA interface for an embedded systems

IrDA is a transmission standard commonly used in computers and peripherals like mobile phones. The primary purpose of IrDA is to provide device-to-device communication over short distances. IrDA solves the problem of usage cables, which may differ from machine to machine. With IrDA, no wires are required, so this is easy to connect the same device to multiple device types like your mobile phone to laptops, other mobile phones, or PDA’s. IrDa standard requires close communication of devices. This is low power transmission. It is essential because regulations are guarding the maximum level of IR radiation that can be emitted. It is also reasonable to assume that the two devices to communicate will be physically pointed toward each other before use. And only two devices can communicate at the same time. So IrDA doesn’t have to deal with collisions. And the main thing that IrDa is simple, cheap, and requires low-cost parts. The IrDA standard specification states that supported data rates can be between 2400bps and 115.2kbps over 1-meter distances. Later standard has expanded to support 1.152 and 4 Mbps. The transmitter beam angle is from 15 to 30 degrees, and the receiver has A viewing angle of 15 degrees.…

Continue reading

Prototype board types

If you are starting to take an interest in electronics, this is a good thing to know what type of prototyping boards can be used. There can be four types of prototype boards: Solderless breadboard- where connections are made by using jumpers;

Continue reading

USB powered power amplifier for your PC

I faced this article when I was looking for a simple solution to increase the output of my PC’s integrated sound card. The sound level of it decreased, so I can’t normally listen to my headphones. So this article is about how to increase your PC sound card’s power by using a minimal amount of parts and a USB power supply. This might be a good solution for all of those who have a PC with an integrated sound card into the motherboard. The main problem is that the outputs of such sound cards are for active acoustic systems; this means that speakers must have a power amplifier built-in. If you decide to connect headphones sometimes, it might not be enough to provide the required sound level. If you are an electronics amateur, you can solve this very easily. You may build your simple power amplifier by using well known Philips operational amplifiers. Let’s say we use the TDA7053 amplifier. The TDA7053 is an integrated class-B stereo power amplifier in a 16-lead dual-in-line (DIL) plastic package, which requires a minimal amount of external parts. This is a straightforward solution for easy, quick, and quality design. One of the board solutions…

Continue reading

Set up AVRStudio to use AVR-GCC compiler

After the release of AVRStudio4, there is possible to integrate the AVR-GCC compiler into it. As you know, AVRstudio is a powerful tool that has an assembler compiler- debugger, programmer, etc. Integration of AVR-GCC makes this tool a much more powerful and more complete playground for developers. A plugin built-in AVRStudio detects the AVR-GCC compiler by itself, so you don’t have to bother how to tie them together. And here we go – full set of good tools comparable to commercial. The convenient user interface, automatic makefile generation, visual debugging by watching processors register, or even you can flash the chip. How to set up the working environment? This is simple. First of all, you have to download WinAVR20060421 and install it on your machine. Then download AVRStudio Version 4.12 and service pack 3 and install them on your PC. And… that’s it. You are set. Now open AVR Studio and select menu->Project Wizard->New project. In a Welcome AvrStudio4 Screen, select Project Type AVR GCC, enter a project name, select Create Initial file if you want to initial c file to be created. Select Create Folder to put project files in a separate folder. Enter an initial c file name.…

Continue reading

Interfacing PC keyboard to AVR microcontroller

Properties: Interface AVR to standard PC AT keyboard; Only two I/O lines were used. One line is also connected to the external interrupt pin of AVR; No external components are needed for the interface; Included C source reads from keyboard interface and converts to serial In many situations, you need some human interface for your microcontroller project. In this example is interfacing AVR microcontroller to standard PC AT keyboard described. Physically interface looks as in picture bellow: In a keyboard interface, signal lines are an open collector with pull-up resistors.

Continue reading

Clockless CPU design

Clockless CPUs are so-called asynchronous CPUs where are not clock generator needed, which clocks every synchronous operation. Asynchronous processors give results, not after a defined number of clocks, but after it finishes operations. This is a key to effective energy usage, and asynchronous processors generate less noise than synchronous. Asynchronous processors have couple advantages against synchronous: Components can run at different speeds inside a clockless CPU, while clocked CPU components are tied to a clock generator. Clockless CPU operation stages don’t depend on clocks and can be finished faster than normal, and there is no time gap between stages as there is no need to wait for the next clock cycle. For instance, it can show the operation results rather than waiting for the next clock cycle like it is in a synchronous CPU.

Continue reading

Embedded RTOS System

RTOS ( Real-Time Operating system) is a programming environment that interfaces hardware and desired tasks. RTOS usually has a built-in set of services (interfaces and functions) that allow interaction between tasks and hardware. Because most low-level functions are performed by RTOS, the realization of programs becomes much easier. What is the difference between Embedded RTOS System and a regular OS (Operating System)? The main difference is that RTOS performs tasks according to reaction time on one or another event. Many microcontrollers have the ability to support one or another Real-Time Operating System.

Continue reading