Category Archives: AVR Microcontrollers

About Atmel ATMega, Attiny projects

One click project with USBasp programmer

UASBASP is very nice 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 previous article in this site or go to original site of Thomas Fischl.

USBASP_programmer.jpg

As it was mentioned mentioned USBasp has two available programming frequencies – high when jumper disconnected and low when connected. These frequencies are 375kHz and 8kHz. In order to use 375kHz speed, target MCU’s clock frequency has to be at least 1.5MHz – four times higher than SCK. If target is clocked with low speed oscillator like 32kHz then jumper has to be connected as it gives 8kHz SCK which is also 4*8kHz=32kHz.

Continue reading

Radio, alarm clock and thermometer – all in one system

Original project by: Владислав Шаповалов

Such multi-purpose device is a nice example of of using microcontroller for combined tasks. The idea of radio-clock-thermometer came up when authors car audio head-end was stolen. He decided to use what’s left left from car radio and build something nice. So the project has started.

GLCD_clock_1.gif

Continue reading

DIY AVR Graphical LCD test board

Once I’ve got several HQM1286404 graphical LCD displays around so I decided to build a prototyping board where I could easily plug LCD to it, read data via ADC and display graphs, plug keypad if needed for some menu functions. Earlier I was testing graphical LCD on prototype breadboard, but dealing with multiple wires (GLCD needs 20 of them) resulted in many failures. It is OK to do simple tasks, but more serious applications require more stable platform. So here it is:

GLCD_board.jpg

This type of GLCD is standard 128×64 pixel matrix controlled by KS0108 LCD controller. Ones I have comes with smaller non common pin-header where pins have 2mm step, so I had to draw it for Eagle library which you will find in project files. I decided to make very simple circuit so it could fit in 100x50mm single sided PCB. As base MCU I used Atmega16 which can be replaced with Atmega32 which is pin compatible with Atmega16 just have more data memory.

Continue reading

Testing AVR universal bootloader on Atmega128

After project source code is developed there is always need to flash it to microcontroller. There are few ways to program AVR microcontrollers. Usually we used to flash AVR’s with ISP adapter (or other programmer) that is not always handy especially when designing device for the end user who doesn’t have ISP adapter or doesn’t know much about flashing MCU. So it is better to flash a bootloader program AVR MCU once with programming adapter and later load firmware interactively when starting AVR.

Bootloader not only allows to update firmware without programmer but also enables to load different programs for different purposes depending on situation flexibly. But enough about this.

So my purpose today is to test AVR universal bootloader which is being developed by Shaoziyang. His purpose was to develop universal bootloader that works on different types of AVR microcontrollers with minimal code modifications. Bootloaders you can find on the Internet are mostly available for special types of microcontrollers and nobody wants to do a lot of modifications to adapt to different MCU when needed.

This AVR universal bootloader can support most types of AVR microcontrollers (Mega series), which have self-programmable capability, boot section and UART. If the device have many serial ports, you can use any one of them. Bootloader supports RS232, RS485 and RS422. It can also supports USI, SPI, I2C interface if you made some modify. This bootloader occupies less than 1k words flash maximum, and it may occupy less than 300 words minimum. The space occupied by the bootloader is relative with device type, configuration parameters, functions you select, and the optimize grade that the compiler use.

Continue reading

AVR based TDA7313 Audio processor control

Introduction

TDA7313 audio processor have been used for more than ten years in the industry because of its simplicity, functionality and good parameters like low distortion, low noise. Chip is based on BIPOLAR/CMOS technology and can be used in various applications including car radios, Hi-FI, simple mixers.

TDA7313 chip has 3 external stereo inputs, that allows to multiplex three incoming sound sources, volume control with steps of 1.25dB, Treble and BASS control, Loudness function, Each of four outputs have distinct control that allows to balance outputs. Chip can be controlled via I2C (TWI) interface.

Description

The idea of this project was to construct independent audio processor which can be embedded in any audio system with ability to control settings with simple button interface with menu preview in LCD.

Board3.jpg

 

The intent was to cover all audio-processor functionality within LCD menu.

Continue reading

Updated USBspi bridge adapter

USBspi is a general purpose SPI bridge for USB designed by ChaN. Adapted have been updated from older one by replacing older MCU to Attiny2313 and instead COM port there is USB adapter attached which works through FT232RQ USB to RS232 bridge. So writing time is faster now.

usbspi2.jpeg

Also adapter board is placed in small box because of Attiny2313 MLF package is used. Earlier version looks like this.

Continue reading

Simulate KS0108 graphical LCD with Proteus simulator

Today it is very popular to use various circuit and microcontroller simulators when developing programs. Using simulators you have several benefits comparing to real prototype boards like you don’t have to connect any hardware to test a piece of code, you don’t have to be in same place when working – you can have simulator software in Laptop and work where ever you want and of course you can see more parameters within simulator like register values, memory, signals in convenient form.

So controlling graphical LCD on simulator software like Proteus is easy task.

glcd1.jpg

Continue reading

Controlling graphical 128×64 LCD based on KS0108

HQM1286404 is pretty old graphical LCD module but it is still popular. This LCD is controlled by KS0108 lcd controller via two segment drivers. LCD backlight color is yellow-green. I think this is good choice for many projects where graphical … Continue reading

What is DebugWire interface

Debug wire is an interface which enables debugging AVR microcontrollers by using one wire. All new AVR microcontrollers with less than 16kByte memory have built in one wire bidirectional debugging interface which allows debugging devices at the real time.

Like JTAG interface DebugWIRE can handle full execution and program flow control. It also supports unlimited number of breakpoints, adjusting memory contents. Good thing is that interface doesn’t require additional pins as only RESET pin is used for debugging purposes.

debug_wire_interface.PNG

 

Continue reading

Major programmer types for 8 bit AVR microcontrollers

AVR microcontrollers have many ways to be programmed. One type adapters are used only to

program AVR memory other are used to program and debug.

AVRISP

Most known and common programming adapter is AVRISP, which is the basic tool and can be used to program Flash, EEPROM memory, most of fuses, lock-bits for probably all 8bit AVR MCU’s.

avrisp.jpg

 

Programmer connects to a computer via RS232 serial interface and is powered from target board with no need additional power supply. Programmer connects to target board via one of two headers – 6 or 10pin. AVRISP from Atmel corporation is designed to work from AVRStudio as front end software and is upgradable. However AVRISP is discontinued due to newer adapter appearance – AVRISP MKII. There are cheep third party clones available. But most of them aren’t compatible with AVRStudio, but works well with programs like PonyProg or AVRDUDE.

Continue reading

New on WinAVR Tutorial New on WinARM Tutorial