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

 

Working with simulator is easier because you don’t have to wary much about additional pins, like MCU power pins, crystals or other protection circuits. You just need to connect control lines and LCD power pins. Thats it. Define microcontroller Clock frequency in Atmega8 symbol and load program file(.hex) by browsing to it in same component meny. And then you can run program. Proteus simulator have KS0108 based 128×64 graphical LCD(LGM12641BS1R) which works as my real GLCD(HQM1286404 ), just in simulator pins are ordered differently than in real one.

Fabian Maximilian Thiele library have also powerful character control functions. First of all Just download GLCDFontCreator2 java program where you can fetch fonts from Windows system and generate fonts for graphical LCD.

Font_creator.jpg

 

Font creator generates convenient file .h with all font data which can be read by program functions.

First of all in the program you have to include font file .h or multiple files.

#include “SC.h”

Then you have to select font which will be used currently:

ks0108SelectFont(SC, ks0108ReadFontData, BLACK);

And then you can simply put tech on the LCD screen with simple command:

ks0108Puts(”scienceprog.com”);

Or if you want from flash memory:

ks0108Puts_P(PSTR(”Test Fonts”));

You can also draw various graphic with functions built in library:

//round rectangle

ks0108DrawRoundRect(5, 5, 117, 20, 8, BLACK);

//line

ks0108DrawLine(5, 50, 122, 50, BLACK);

//circle

ks0108DrawCircle(25, 55, 5, BLACK);

And even more.

glcd2.jpg

 

Project files and for example above and Proteus model you can download here: GLCD example with fonts

Blogsphere: TechnoratiFeedsterBloglines
Bookmark: Del.icio.usSpurlFurlSimpyBlinkDigg
RSS feed for comments on this post
 |  TrackBack URI for this post

New on WinAVR Tutorial
Running TX433 and RX433 RF modules with AVR microcontrollers,
Sometimes in embedded design you may want to go wireless. Might be you will want to log various readi …
Programming AVR ADC module with WinAVR,
Most of AVR microcontrollers have Analog to Digital Converter (ADC) integrated in to chip. Such solut …
New on WinARM Tutorial
What are differences between WinARM and WinAVR,
Everyone who is working with AVR microcontrollers knows this powerful tool – WinAVR (http://win …
LPC2000 watchdog timer,
As in all microcontrollers watchdog timers purpose isto reset microcontroller after reasonable amount …

One Response to “Simulate KS0108 graphical LCD with Proteus simulator”

  1. Electronics-Lab.com Blog » Blog Archive » Simulate KS0108 graphical LCD with Proteus simulator Says:

    [...] KS0108 graphical LCD with Proteus simulator - [Link] Filed in Software, Mcu, [...]

Leave a Reply