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
- AVR Studio
- avr-gcc (Precompiled Binary version for Windows is called WinAVR)
- eXtreme Burner AVR
These tools must be installed and set up correctly as described in the following tutorial.
Start AVR Studio and you will be presented with the following screen.
![]() |
AVR Studio Welcome Screen |
Select "New Project"
And on the next screen ...
![]() |
Configure the Project |
Select the options as shown above.
- Project Type is AVR GCC
- Project Name is "HelloGraphics"
- Select any appropriate location for the project in your hard disk.
Now select Debug Platform as AVR Simulator and Device as ATmega32 and click Finish.
![]() |
Device Selection |
Now your project is ready. From the "Project" menu select "Configuration Options" you will be presented with the following screen.
![]() |
Configure the Project |
Select Frequency as 16000000 (16MHz) and Optimization as "-O2". Then select "Include Directories" from the left hand pane. After that select add include directory. The button is shown in the image below.
![]() |
Add new include directory |
Now select the "include" folder inside the ProGFX Folder.
![]() |
Adding New Include Folder |
Now similarly we need to add the library to our project. So go to "Libraries" section.
![]() |
Library Section in Project Configuration. |
In library section select "Add new library path". It is shown in the image below.
![]() |
Configure the Project |
Then select the "lib" folder inside the ProGFX installation.
![]() |
Adding New Library |
Now the "Available Link Objects" section will show "libgfx.a". Select "libgfx.a" and click "Add Library" button. Now click OK.
![]() |
Adding ProGFX Library |
Finally Your Project is ready!
![]() |
AVR Studio Ready For Graphical Application |
Double Click On the "HelloGraphics.c" from the project file area on the LEFT hand side of AVR Studio. You will be presented with a blank file. Just copy/paste the code given below.
/********************************************************************
Hello World Project Using ProGFX Engine. The application just prints
the text "Hello GraphicX!" at the center of 128x64 Graphical LCD
Module.
For More Information See
http://www.ProGFX.org
ProGFX makes it easy to interface graphical LCD modules with
embedded microcontrollers. Currently Atmel AVR MCUs are supported.
Latter PIC and ARM MCUs will also be supported.
Development Environment : AVR Studio v4.17
Compiler : WinAVR 20090313
Written By
Avinash Gupta
me@avinashgupta.com
********************************************************************/
#include <gfx.h>
#include <font.h>
#include <fonts/arial12.h>
void main()
{
//Initialize ProGFX Engine
GFXInit();
//Select a font
GFXSetFont(Arial12);
//Write a simple string at center
GFXCenterText("Hello GraphiX!",GFX_COLOR_BLACK);
//Update the display
GFXUpdate();
}
After entering code save the file. Then from the "Build" menu select "Rebuild All". If you did every steps carefully then the project will compile without any problem and you will be get a HEX file. The hex file is found inside the "default" folder inside your project folder. In this case the file should be "HelloGraphics.hex". You can program this hex file to the MCU using any standard ISP Programmer.
The hardware required to run this project is described in detail in the following tutorial.
After running the demo you will get an output similar similar to the images shown below.
![]() |
Atmel AVR Based Graphical LCD Demo |
![]() |
Atmel AVR Based Graphical LCD Demo |
If you get NO output on the LCD Panel then :-
- Adjust the RV1 variable resister until you get proper display.
- Confirm that HIGH fuse is programmed to C9 (HEX) and LOW fuse is programmed to FF (HEX)
- Check all connections.
- Check that 16MHz crystal is connected to AVR MCU
- Build Circuit exactly as shown in "Interfacing Graphical LCDs with AVR Microcontrollers."
About: ProGFX is a free project started by eXtreme Electronics India to promote use of graphical modules in new embedded projects. The development of ProGFX project requires money and LOTs of time. So please buy Graphical LCD Modules from our online store to help us in return. Currently these modules are only supplied within India.
Downloads
- Download ProGFX v1.00
- Download ProGFX v1.01
- "HelloGraphics.hex" this hex file is ready to burn to ATmega32
Other Parts of the Tutorial Series
- Part I - Introduction to GLCD and Hardware Setup
- Part II - Downloading and Installing ProGFX!
- Part III - Explains Graphic Primitive Functions.
- Part IV - Font and Text Handling Functions.
By
Avinash Gupta
Facebook,
Follow on Twitter.
www.AvinashGupta.com
me@avinashgupta.com

















Hello sir,
first of all I congratulates and thank u for your great and successful contribution in the field of embedded system.
I was eagerly waiting for this project and its very nicely explained.
Sorry in advance, but I want to ask you that how actually we are writing any words in GLCD. We are directly using the library function to write anything. I want to know exactly how things are going on just like you have explained for simple LCD, if possible.
Anywayz, thank you again for your help.
Hello Sir
Is there any way to modify the pins where the GLCD must be attached, or they are harcoded in the library? I think that being able to change them will make the library a lot more powerful and used.
Thanks,
W
Hi,
Nice demo, Please show the circuit diagram also. How i do i contribute myself to publish projects in this site.
Naveen
@Naveen
First of all please read the post carefully before Posing comment. The link to circuit diagram is given in the post itself.
If you want to contribute to this site you may mail your article to the webmaster. But remember we have very strict quality assurance so your article need to be of top quality to be accepted.
hello sir,
I want to know the basics of using graphics lcd, how to handle it.If possible.
Thank u.
Do we have functions to display text from certain co-ordinates(x,y) in ProGFX library.
@Mohammed
For Text and Font handling details in ProGFX, consult this tutorial
http://extremeelectronics.co.in/avr-tutorials/handling-text-and-fonts-in-progfx/
Thankx I got it it was in the gfx.h file
but can you please explain me how to draw image using the function GFXDrawImage(UINT8 x,UINT8 y,prog_uint8_t *img)
what should be img here?
The lib file libgfx has the extension .a. how can i access this file to read the souce code of the functions. I have a windows OS.
@Kmil
Its closed source! So you cannot get the source code.
Hello Sir,
Thank you very much for these tutorials about AVR, and i have a question about this one. Can i use this ProGFX with Codevision, winavr compiler?, if yes how to do it. Thank you again for your help and your courses.
Hi Avinash ,
You have an awesome website and easily the best AVR tutorial on the internet . I have one question regarding the GLCD library . Is it possible to change the port connections ? For example , I want to connect my data pins to Port B instead of Port C . Thanx for the help !!
whether the library can be used by codevisionAVR?
@Wawak
No.
hi everybody
thanks for very useful tutorial . please dont connect AGND(pin 31) and AVCC(pin 30) otherwise you see nothing
@Reza
It is NOT correct.
you need to connect AGND and AVCC pins.
hi avinash
i just wanna know that it is necessary to connect only 16 mhz
bcoz i’m using 10 mhz
is it possible to use 10 mhz instead of 16 mhz
Hi Avinash,
i tried out your tutorial and i am getting the progfx logo as output on the GLCD but it is displaying some random signs instead of “hello graphics” afterwards..what must be the problem
try running the pre-compiled hex file. Make sure you use ATmega32 only.
Also confirm that a valid font is selected.
ohh..coz i was using an atmega16 …thankz a lot
Hi Avinash,
I am using ATmega32A, if i burn the “HelloGraphics.hex” file or any readymade hex file provided by you , I get a continuous buss from the buzzer of my development board and nothing happens on the GLCD.
Could you please help me understand why is there a problem like this ?
Did i make any mistakes?
@Hemant Jha ,
Why do u guys make me supper irritate ?
U guys now nothing about the what you are doing and then ask me silly questions!!!
If u can’t even do experiments given in this site only one that can help you is GOD !!!
You guys buy crap development board from other vendor and try to run our code !!! Go ask the guy who sold u the crap ! I don’t have free time.
Hello Avinash,
Thanks for such a cordial response. Your response says everything about you as a person. I have seen some of your posts where you have been very arrogant and harsh dealing with other people interacting with you. Yesterday when I called you at your office … you were equally rude.
Just a small word of advise which will definitely help you in future .. “People with real expertise, intellect and talent are not and need not be arrogant”.
BTW – I teach system designing to some of the worlds best technology companies that a person can think of … but I have no shame in saying that I was experimenting with GLCD for the first time and I am not a expert of the same and I dont mind saying that I dont know certain things in this world.
Thanks and Regards,
Hemant Jha
@Hemant Jha,
I cannot “please” every people every time, that was what I was taught at my school ! What ever you think of me ! I don’t like peoples creating problems out of nowhere ! Remember that not all people are compatible in this world ! I say what I like, don’t add much cheese! Bye
Sir,
I am working on a fingerprint based attendence system using SM-630 module.
I tested it successfully with atmega16 and 16×2 LCD.
Even i a made an efficient fingerprint library to interface with SM-630 module that can add,delete and store fingerprints, using Extreme UART library.
Now i am using atmega128 and graphic lcd to make it more of my Major project.
Graphic LCD Connections
=======================
Data -PORT A (D0:D7,PIN0:PIN7)
CS1- C2
CS2- C7
RST- C6
RS- C5
RW- C4
E- C3
I have made my pcb.
Please i need pro-gfx configured to upper configuration as my other pins are used for ethernet and sensor and keypad.
Kindly help.Please guide.
And there is a need of software uart library in hobby electronics for AVR,its not available online.You(avinash sir) always have made unique and easy to use libraries n tools not available online.Kindly take this into your consideration
Sir,
I have worked out whole day,as i need both two uarts on atmega128.
And the only pin that is a problem for me is PD3(TX1) connected to RS pin of graphic lcd in progfx.
Please map it to PD4 and compile new progfx library.My whole major project is now struck on this one pin.Please help.
And if you have software uart library,it would be of great help too.
Hello Sir,
While using your library,I am also trying to run ADC0.but whenever i enable adc my code is reset.can you tell what the problem is?