Programming AVR ADC module with avr-gcc

Most AVR microcontrollers have Analog to Digital Converter (ADC) integrated into to chip. Such a solution makes embedded designers’ life much easier when creating projects and programming them. With no need for external ADC, PCB takes less space, easier to create programs – it saves time and money. As an example, let’s take the Atmega8 microcontroller, which has up to 8 ADC inputs, most with a 10-bit resolution(excluding ADC4 and ADC5 inputs that are 8-bit). All features of AVR internal ADC can be found on official ATMEL AVR datasheets, but most important to mention are: ±2 LSB accuracy – so measurements aren’t very accurate. If AREF voltage is 5V, then the error may reach ±0.04V, but this is still good results for most of the tasks; Integral nonlinearity ±0.5 LSB; Conversion speeds up to 15kSPS at maximum resolution. This is far not enough for 20kHz audio signal sampling.

Continue reading

Batteries and cell characteristics

Batteries are a cheap, small, and relatively safe way of having a portable energy source. There are many types of batteries with different characteristics and uses. Probably many of you heard the terms battery and cell referring to the same. But from a technical perspective, these are different things – a cell is a single unit that houses a single chemical reaction and produces electricity. At the same time, a battery is a pack of cells. Nominal cell voltage and battery voltage For instance, a single AA battery can be called a cell because this is a single unit where a single chemical reaction generates a voltage of 1.5V. Still, car lead-acid battery has six cells producing 2.0V each while all battery produces 12V. The first important thing to remember is that a single cell can produce a specific nominal cell voltage that depends on a chemical reaction. In contrast, the battery voltage is a combined voltage of multiple cells connected in series (or parallel).

Continue reading

AVR internal oscillator jitter research

If you go to the AVR site and open an AVR application note AVR053, you will notice different RC oscillators installed into AVR chips during history. In the table, you can see tunable oscillator versions and their features. Simply speaking, each new version of the oscillator introduces better features and improvements. But is it true? ChaN has done exciting research on this oscillator version. He tested the output signal with fixed width and measured timing fluctuations of it. And he found out that the RC generator frequency slowly fluctuates during the time. Of course, RC oscillator fluctuations are not a problem as this type of clock source isn’t stable. In time-critical applications, it is better to use crystals. But the most exciting thing is that newer versions of tunable oscillators were generating much more jitter than older ones.

Continue reading

One click project with USBasp programmer

UASBASP is an efficient programmer for Atmel AVR microcontrollers that works under multiple operating systems, including Linux, Mac OS X, and windows. How to assemble this simple programmer read the previous article on this site or go to the original website of Thomas Fischl. As it was mentioned, USBasp has two available programming frequencies – high when the jumper disconnected and low when connected. These frequencies are 375kHz and 8kHz. To use 375kHz speed, target MCU’s clock frequency must be at least 1.5MHz – four times higher than SCK. If the target is clocked with a low-speed oscillator like 32kHz, then the jumper has to be connected as it gives 8kHz SCK, which is also 4*8kHz=32kHz. Building and preparing this programmer should not be a problem as it uses very few components. If you use 6 PIN ISP programming header, then you need a 10 to 6 adapter — Flash Atmega8 with the newest firmware found on the authors’ site. Right now latest firmware is 2007-10-23. For other details, read in the readme file.

Continue reading

Embedded Technology and the Modern Market

Embedded electronics refer to devices that can be embedded into something. They are add-ons that increase the functionality of the device in which they have been integrated. Embedded electronics can do more, and shortly, it can change the way people sell products and handle business. The Importance of Technology in Business To maximize profits and to increase production but, at the same time, to maintain a competitive price, industries from all sectors of the market rely on technology to reduce the cost incurred during business operations. Modern technology could maximize production and profit by freeing people from repetitive and laborious work and put them in places where their skills and intellect would matter. Technology makes it possible to mechanize and accelerate production, lower the cost, reinforce control mechanisms, speed up delivery, and make goods and services available to more people. These advantages also mean better, cheaper and safer products and services for the end-users.

Continue reading

Ocean Embedded Electronics Systems

Embedded systems for ocean applications comprise small, function-specific computers designed to operate in the rough environment of open water, withstand both pressure and weather, and use as little energy as possible. While the development of such technology has been ongoing for a long time, research and implementation have been stepped up due to the increased demand for ocean-based monitoring and warning systems; this demand results from the 2004 tsunami disaster. Embedded systems are also being developed for tidal power generation purposes as well as improvement of navigation systems aboard ocean-going vessels.

Continue reading

Robotic Assistance for the Disabled

Embedded devices, particularly digital ones specially designed to assist individuals with disabilities, are often seen as the next step in that particular field of technology.  Such embedded devices generally have several advantages over the previous wave of embedded devices that have monitoring functions, control capabilities, and the ability to access and use communication protocols like the internet.  The modern embedded applications devices do not stop monitoring, tracking, and relaying information; they almost always directly assist the user, such as a prosthetic limb or a personal transport assistance vehicle.

Continue reading

Bi-color LED indication

Bi-color LEDs are the same LEDs as uni-color, just there is more than one LED housed in one package. Bi-color LEDs may have two or three leads depending on the intentional connection method. Three lead LEDs have a common cathode lead to which both LEDs are connected internally. To tun one of the LEDs or at the same time, connect the cathode to the ground via a current limiting resistor which value is equal to one LED required limiting. Of course, you can connect current limiting resistors to each of the anodes and control current individually. Then you can apply power to one of the anodes or both at the same time to have bi-color amber illumination.

Continue reading

Using NVRAM in embedded projects

NVRAM(Non-Volatile Random Access Memory) is one of the non-volatile memory selections. This may be an alternative to EEPROM to back up the memory. NVRAM chips can be used for nonvolatile memory storage with many benefits comparing to EEPROM. The main benefit is that NVRAM chips work like static RAM. They are RAM; they contain a lithium cell battery for retaining RAM contents when the main power is switched off. The backup memory can store contents as long as the battery provides power. NVRAM chips don’t require much power; backup can be guaranteed for up to ten years. For instance lets take Dallas NVRAM chip DS1225.

Continue reading