7.3 mikroC Pro for PIC GLCD Library Functions

mikroC Pro for PIC language supports the 128 × 64 pixel GLCDs and provides a large library of functions for the development of GLCD based projects. In fact, there are libraries for several different types of GLCDs. In this section we shall be looking at the commonly used library functions provided for the 128 × 64 GLCDs, working with the KS0108 controller.

7.3.1 Glcd_Init

This function initialises the GLCD module. The function is called with no arguments and it must be called before any other GLCD functions are called.

The GLCD control and data lines can be configured by the user, but the 8 data lines must be on a single port. Before this function is called, the interface between the GLCD and the microcontroller must be defined using sbit type statements of the following format. In the following example, it is assumed that the GLCD data lines are connected to PORT D, and in addition the CS1, CS2, RS, RW, EN and RST lines are connected to PORT B:

img

img

7.3.2 Glcd_Set_Side

This function selects the GLCD side based on the argument, which is the x-co-ordinate. Values from 0 to 63 specify the left side of the display, while values from 64 to 127 specify the right side.

7.3.3 Glcd_Set_X

This function sets the x-axis position from the left border ...

Get Using LEDs, LCDs and GLCDs in Microcontroller Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.