Skip to main content

128 x 64 Graphics LCD Display Interfacing with ATMEGA32 Library from Scratch



            Yes I am diving little into traditional stuff, still its interesting to try something from scratch. While working on some hi-tech stuff where we mostly don't care about writing something from scratch as its time consuming. Now a days platforms like arduino are concentrating on Application, they are not meant to use to understand the hardware peripheral. In fact I never tried it though ;). I know there are lots of example available online regarding this graphics LCD. This LCD I selected is HDG128x64F, which is more or less what is conventionally used, but I found some differences as in column addressing method. I got datasheet about HDG128x64F here, where I can only find some commands which are more or less similar to that of 16x2 LCD except RAM addressing method. To start working on this I preferred using Proteus Simulation software to make it more flexible in terms of Hardware.

Note - This software I tried with Proteus not on actual hardware. Put comment below if you find it difficult on actual hardware.

Hardware - 

Following is the circuit you can try in proteus


To interface this Graphics LCD I used ATMEGA32 as many people love to do hobby stuff on AVR and me too :D. Few problems I encountered while displaying any sort of character on display. One is that the addressing for column e.g. 0 starts from top right corner rather than left top corner. Second, I found that whenever I was writing the RAM address was auto increment from right to left than left to right, which is kind of weird operation.To make it work I made changes in software. If anyone of you have encountered/ or know solution on this you are welcome to comment. Following are the command codes for display



Software - 

       In the current software version I have only concentrated on displaying fonts. Before character I had decided to display image but anyway that is not a hard job as only I have to fill  RAM buffer with image pixel data, hence I worked on displaying characters. Thanks to Andy Gock's font header file here. I used this fonts file directly in order to display it on GLCD.


You can find this lib on my github repository. Download code
Comment below if any suggestions/ help.

Regards,
Shrenik.


Comments

  1. Contrast pin 3 should be connected through middle pin of 10k POT and two ends of POT should be connected with pin18 (i.e. -10V) and VCC (5V).

    ReplyDelete
  2. Is the codes works on the LCD display?.Thank you for sharing the circuit images and the hardware used for this experiment.The Embedded Software Development Services are really looking forward to generate new devices with the help of embedded software engineers.The work you had shared here is really appreciable.

    ReplyDelete

Post a Comment

Popular posts from this blog

How to interface USB modem to ARM board (for android or linux)

How to interface 3G usb modem to any ARM (Android / linux ported) Board.  Hi I am now going to provide quick steps to interface the 3G usb modem to linux/ Android SBC which i have tried during my try which is successful one . More and more USB devices when plugged in for the first time they act like a flash storage and start installing the driver from there. After installation (and on every consecutive plugging) the driver switches the mode internally, the storage device vanishes (in most cases), and a new device (like an USB modem) shows up.       Few modems (Huawie) most of time they do not need to switch from mass storage to usb modem mode. When you connect that modem to USB port then it will be detected as ttyUSB (3 ttyUSB ports are detected). Otherwise you need to switch the mode of usb modem by using usb_modeswitch utility (I am giving examples of idea modem / reliance modem which are from Huawei and a dlink 3G modem which requires usb modeswitch). Follow the steps to

Interfacing M45PE16 SPI Flash to ATMEGA32

       As many people need some sort of storage in their embedded project, they prefer to use SPI flash. Hence I decided to try this interfacing with ATMEGA32 microcontroller. This SPI flash is 16Mb flash, works on SPI interface. You can reuse below code if you want to integrate this flash to your project. I tested this code using proteus simulation, you can also test and comment. Features of M45PE16- 16Mb of page-erasable Flash memory Page size: 256 bytes Sector erase: 512Kb 75 MHz clock frequency (MAX) In current interfacing I only did Page Write/ Read API's. The SPI needs to configure in Mode 0, and Master at Microcontroller side as given in code below. The result or Page read bytes are displayed over terminal using UART. Code- M45PE16.c /*  *  *  *  Created on: Apr 18, 2014  *      Author: Shrenik Shikhare  *      File: M45PE16.c  *      Discription: Interfacing M45PE16 SPI Flash to ATMEGA32  *      Copyrights(C)-April 2014  */ //#define F_CPU 10000