Tag Archives: avr studio

Handling Text and Fonts in Graphic LCD

ProGFX supports advance function to draw text on graphical LCD screen. ProGFX support multiple fonts, fonts with variable width characters, absolute pixel based positioning, and utility function to get the dimension of text in any specified font. The last feature is used to cleanly position text relative to other graphic and text objects on screen. So lets get started. First you will need a tool that will help convert any Windows Font to ProGFX compatible format. Thanks to Mr. F. Maximilian Thiele we have a great tool called Font Creator. You can download it from here. Download GLCD Font Creator It is a Java application so you need the Java Runtime to use it. Launch the app using start.bat file. You will get a screen similar to this. Font Creator Main Screen From file menu select "New Font" , and configure the New Font Dialog as follows. New Font Dialog Name = Arial12 Import Font = Arial Size =12 And click ok. From Export Menu Select "Export Font", Give it the name "Arial12.h" while saving. Create a Atmel Studio Project with GFX Support. The steps are given in the following tutorials. Hello World Project with Atmel Studio 6. Setting up ProGFX Project using AVR Studio. Name the AVR Studio Project as "FontDemo". Open the project folder in Windows Explorer (or […]

Interfacing Graphical LCD with AVR MCU – Part II

This tutorial deals with downloading and installing ProGFX graphic engine. ProGFX is a free and easy to use embedded graphic library that can control several display modules and can run on AVR, PIC and ARM MCUs. In this tutorial we will make a ProGFX graphical application with Atmel AVR ATmega32 MCU using AVR Studio and WinAVR (C Compiler). So lets begin. Downloading ProGFX engine. Please download the ProGFX engine from the following link. Download ProGFX v1.0 Installing ProGFX Engine. You need WinZIP to extract the files to your hard disk. Please extract it to root of any drive like "C:". Following Folders will be created. C:\progfx\include C:\progfx\lib Folders Created after extracting the ProGFX package Note that core of the engine is contained in two folders named "include" and "lib" but there may be some others folders too, like "Help" depending on your version of ProGFX engine. Creating a Graphical Project using AVR Studio. The basic tools required for developing with AVRs are Atmel Studio (Integrated development environment with integrated C compiler) eXtreme Burner AVR (to transfer program files to chip) These tools must be installed and set up correctly as described in the following tutorial. Creating "Hello World" project with Atmel AVR. Start AVR Studio and you will be presented with the following screen. Atmel Studio 6 Startup Screen The […]

AVR Project – Relay Timer with ATmega8 AVR MCU

Timers are widely used in industrial and domestic application for automating tasks. Microcontrollers can be used to design versatile and accurate timers with ease. Here I present a simple timer that can be used to turn on/off a load after user specified time. The Timer uses a standard 16×2 lcd module for user interface (UI). User can set the time using a 3 button keypad. After that Timer is started. While count down is in progress, the time left is displayed on screen. The program use our LCD driver library more details of which can be found in here. Use avr-gcc + AVR Studio to compile. The prototype was developed using xBoard MINI, a low cost easy to use ATmega8 development board. The program was burned to the MCU’s flash memory using eXtreme Burner – AVR Software and Hardware. A basic knowledge of working with different tools of AVR development is required, so please refer to following articles. Note: Fuse Must be set as follows, HIGH FUSE=C9 LOW FUSE=FF (Very Important) If display is blank please adjust RV1 Part List 01 ATmega8-16 PU U1 02 16×2 LCD Module LCD1 03 16 MHz Crystal X1 04 BC548 Transistor Q1 05 1N4007 Diode D1 06 4.7K Resistor R1,R2 07 10K Variable Resistor VR1 08 22pF Disk Capacitor c1,c2 09 0.1uF Disk Capacitor […]

AVR Project – Digital Stop Watch with ATmega8

Hello Friends, In this tutorial we will make a "Digital Stop Watch" using an AVR ATmega8 Microcontroller. This will help you learn many concepts like Multiplexed Seven Segment Display Interfacing Using AVR Timers Using Interrupts And many others too. The code is written in C language for avr-gcc (WinAVR) . Fig.: Digital Stop Watch Prototype Steps to Build the "Digital Stop Watch" using AVR ATmega8 MCU Make the circuit according to the schematic on general purpose PCB or a BreadBoard. Make a project in AVR Studio and add a new file to the project. Copy/paste the "c" code. Set optimization as "o2" and CPU frequency as 16000000Hz. Save and Build the project. You will get a HEX file. Burn this HEX file to an ATmega8 MCU using a tool such as eXtreme Burner AVR. Set High Fuse = C9(Hex) Low Fuse = FF(Hex). How to do this depends on you programmer software. I have use a xBoard MINI development board for fast and easy prototyping. The Displays+Transistors+Key are on the Veroboard while the Core CPU unit + power supply is in the xBoard MINI. It can be programmed "In System" over USB Port using eXtreme Burner – AVR software toolkit. Fig.: Digital Stop Watch made using xBoard MINI   How to Use the "Digital Stop Watch" When initially powered up […]

Easy 24C I2C Serial EEPROM Interfacing with AVR Microcontrollers

In this turorial we will see how we can easily interface a 24C series serial EEPROM with AVR microcontrollers. What is an EEPROM? An EEPROM is kinds of novalatile memory, that means it is used for storing digital data permanently without any power suply. EEPROM stands for Electrically Erasable Programmable Read Only Memory. The advantage of these kind of ROMs is that they can be erased Electrically to make them ready for storing new data. Compare this with a CD R disks they can be recorded only once. A small amount of EEPROM is also available internally on the AVR chips. So if the volume of data you want to store is small (say few user names and password) then you can use it. The internal eeprom makes design small and simple. But if the amount of data you want to store is large, say in order of few tens of kilobytes then you have to interface a External EEPROM chip with your AVR MCU. You can store pictures, sound and long texts in these eeproms. Their are many kinds of EEPROM chip available from many manufactures. One very common family is 24C series serial EEPROMs. They are available upto 128KB in size. They uses I2C interface with host controller (MCU) which is a very popular serial communication standard. I […]