This library provides some functions for interfacing graphic LCD's that uses KS0108 controller, such as "Top way displays", The following functions are available:
* 8 – bit vertical column is accessed at once. Example:glcd_clear(); //clear GLCD glcd_puts(str,0,0,0); //Put an English string at column 0,row 0 glcd_puts(str2,40,3,0); //put another English string at column 5**,row 3 delay_ms(1000); //wait a second glcd_off(); //Turn off display delay_ms(1000); //wait a second glcd_on(); //Turn on display delay_ms(1000); //wait a second glcd_clrln(0); //Clear the first line glcd_puts(ArStr,120,0,1); //Put an Arabic string at column 15,row 6 glcd_puts(ArStr2,120,6,1); //Put another Arabic string at column 15**,row 6
** To calculate x parameter for a column: column number X 8
How to use the library:1. Download "ArEnGLCDLib.zip", and extract it.
2. Copy “glcd.h”
and “font.h” into your project’s directory 3. Include “glcd.h”, you don’t have to include “font.h”; it will be included automatically. 4. Strings to be displayed on the GLCD must be stored in a string variable e.g. unsigned char str[] = "WELCOME"; 5. Specify a 8 – bit port for data transmission, set the DDR of this port to 0xFF (i.e. output), and assign this port to the constant DATAPORT in “glcd.h” (line 8). e.g : #define DATAPORT PORTD 6. Specify pins for EN, RW, RS, CS2, and CS1, set them all as outputs, and assign the selected pins to the corresponding variables in “glcd.h” (lines 9 : 13). e.g. : #define CS1 PORTC.4 #define CS2 PORTC.3 #define RS PORTC.2 #define RW PORTC.1 #define EN PORTC.0 7. Specify the number of columns and rows, by assigning values to the constants cols and rows in “glcd.h” (lines 6, 7). e.g. :
#define cols 128; #define rows 64; 8. Enjoy using the functions shown in the table. Please don’t forget to specify the language, 0 for English, and 1 for Arabic, as illustrated in the table.
Project and Simulation files:How can I change the font ?
For any feedback, please contact me at:
Thanks, Osama Salah Eldin http://sites.google.com/site/osamaslab |
