GLCD Dev Board  

GLCD Development Board for ATmega32

Our GLCD Development Board is designed to jump start graphical LCD programming for people who do not have any previous experience in the field. The hardware is tightly integrated with all our tutorials and the ProGFX driver.

Purchase

  • Delivery in India and Abroad.
  • Online payment by Indian Cards and Netbanking.
  • Paypal payment for International Customers.
   

Login Form  

   

GLCD Programming Basics

Details

Introduction

The graphical LCD is made up of a grid of pixels. Common resolution is 128x64. That means that their are 64 horizontal lines and each line has 128 pixels. These displays are monochrome that means each pixel can either be ON or OFF. ON pixels looks dark while OFF pixels are nearly invisible. The glcd has a graphic RAM where each bit in ram corresponds to one pixel on screen. You write to the graphic RAM to modify its contents and the screen will change accordingly. The LCD module offers just that much functionality. You can't do much with that.

graphical lcd matrix

Pixel Matrix of Graphical LCD

You need a graphic library that takes high level commands like

  • Graphic primitives like line,circles, rectangle etc
  • Text Drawing
  • Image/Icon drawing.
  • Double buffering.

and changes the graphic memory accordingly. These operation requires some advance algorithms (at least from beginners point of view!). So the graphic library will help you generate complex graphical output very easily.

Pixel Addressing

The horizontal location is called the X address and its starts from the left hand side(where its value is 0) and increases as we move right. The vertical location is called Y address of pixel its starts from the top (where its value is 0) and increases as we move down. Only positive values are allowed. Pixel is always addressed by specifying its X and Y co-ordinate. It is written in form (x,y). The image below shows address of some pixels.

pixel addressing in 128x64 glcd

Pixel Addressing in 128x64 glcd

Colors

In ProGFX engine only two colors are defined they are

  • GFX_COLOR_BLACK
  • GFX_COLOR_WHITE

Most of the ProGFX functions takes pixel address and color as arguments.

Drawing A Pixel in GLCD

The function which draws a single pixel in ProGFX is called

void GFXRawPutPixel(UINT8 x,UINT8 y,UINT8 color);

The function is very simple. The first argument is the x location of pixel, the second is the y location of pixel, the third is the color of the pixel.

Example

To plot a pixel at (32,24) with black colour.


#include <gfx.h>

void main()
{
   //Initialize ProGFX Engine
   GFXInit();

   //Draw a pixel at 32,24 in Black
   GFXRawPutPixel(32,24,GFX_COLOR_BLACK);

   //Update the display
   GFXUpdate();

}

 

   
© ProGFX.org by Avinash