X-GLCD Library |
X-GLCD library for mikroBasic, mikroPascal and mikroC Please read all details before using this library !!! XGLCD library is aimed at providing a solution to break the limits of GLCD lib provided by MikroElektronika. GLCD Lib is constrained by the physical structure of K0108/K0107 GLCD controllers. In these controllers, the screen is split on two sides. You can think of a 128*64 LCD as a 1024 byte memory, every bit of which is visible. The display is split logically in half. It contains two controllers with controller#1(Chipselect1) controlling the left half of the display and controller#2 (Chipselect2) controlling the right half. Each controller must be addressed independently. Each half consists of 8 horizontal pages which are 8 bits (1 byte) high. The page addresses, 0-7, specify one of the 8 pages. That is illustrated in the drawing below. Below are the KS0108 & HD61202 commands. These controllers do not have text capability and the commands are few and simple.
Y address (0-63Y address counter designates address of the internal DDRAM. An address is set by instruction and is increased by 1 automatically by read or write operations of display data. Y address 0 is the leftmost bayt, and Y address 63 is the rightmost byte of a page. X address (0-7): This is the page address and has no count function. Display start line (0-63): The display start line register specifies the line in RAM which corresponds to the top line of LCD panel, when displaying contents in display data RAM on the LCD panel
The GLCD Lib from MikroElektronika let you:
X-GLCD lib breaks all these limitations. It let you
Understand the Export Filter for mikroBasic, mikroPascal and microC: This filter let you convert any font you created (even from scratch or imported an existing Windows font) to constant tables needed by MikroElektronika compilers.
This filter is easy to use, just select the tab corresponding to your favorite language (mikroBasic, mikroPascal or mikroC) and the source code is automatically generated for you.
BUT !!!!!!!!!!!!!!!!!
Fonts Bigger thant 8 bits height: For fonts Bigger than 8 bits (height): The use of X-Glcd Library is mandatory to be able to draw them on GLCD (see X-GLCD section for usage guide).
For fonts with height less or equal to 8 bits: These fonts can be rendered using either MikroElektronika GLCD lib, or X-GLCD lib. GLCD lib is a bit quicker than X-GLCD lib when rendering these fonts.
So Why use X-GLCD lib with fonts with height less or equal to 8 bits ? Simply because
X-GLCD lib usage guide: X-GLCD lib provide 3 procedures very similar to the original GLCD Lib provided by MikroElektronika. xGLCD_Set_Font() xGLCD_Write_Char() xGLCD_Write_Text() the parameters are absolutely the same as GLCD lib equivalent functions/procedures.
IMPORTANT NOTES :
X-GLCD lib aims at hiding the physical structure or hardware GLCD. So the big difference between X-GLCD and GLCD is the fact that for coordinates (X, Y) passed as parameters to each procedure (xGLCD_Write_Char( ) and xGLCD_Write_Text( )) are the logical coordinate you want to use on the screen. That means that the X coordinate is between 0..127 and the Y coordinate is between 0 to 63.
If you want to write a char at position X=69 and Y=72 you have only to call xGLCD_Write_Char(myChar, 69, 72)
With X-GLCD Lib You do not have to worry about pages or sides. All is done automatically for you.
The future of XGLCD lib: A full rewrite of XGLCD lib is planned (may be in pure ASM) to make it more user friendly and more quicker. The fonts needed by XGLCD lib will contain pre-computed jump tables so that only really use bytes in each char are stored in the table, this will compress the font tables by more than 50% and make selection of chars quicker. Support of Bitmaps, icons and symbols drawing will also be added. The new XGLCD lib will not be based on GLCD Lib. It will be really standalone and will offer functions for Lines, polygons, and other stuff. Also, addressing the hardware registers of the graphical controller will make it really quicker.
|