The mikroC Pro for PIC language provides a library of LCD functions for the HD44780 type controller. The library functions are based on using 4-bit interface. A list of the offered functions and their usage are described in this section.
This function initialises the LCD module and it must be called before any of the other LCD functions are called. The function is called with no arguments. Before the function is called, the interface between the microcontroller and the LCD must be defined using statements of the following format:
The configuration above assumes that the connection between the LCD and the microcontroller is as follows:
This function displays text on the LCD starting from specified row and column positions. Both string variables and literals can be passed as a text.
This function displays text at the current cursor position. Both string variables and literals can be passed as text.
This function displays a single character at the specified row and column positions. Both variables and literals can be passed as a character.
This function displays a single character at the current cursor position. Both variables and literals can be passed as a character.
This function sends a command to the LCD. A list of the valid commands is given in Table 6.5.
LCD Command | Purpose |
_LCD_FIRST_ROW | Move cursor to the 1st row |
_LCD_SECOND_ROW | Move cursor to the 2nd row |
_LCD_THIRD_ROW | Move cursor to the 3rd row |
_LCD_FOURTH_ROW | Move cursor to the 4th row |
_LCD_CLEAR | Clear display |
_LCD_RETURN_HOME | Return cursor to home position, returns a shifted display to its original position. DDRAM is unaffected. |
_LCD_CURSOR_OFF | Turn off cursor |
_LCD_UNDERLINE_ON | Underline cursor on |
_LCD_BLINK_CURSOR_ON | Blink cursor on |
_LCD_MOVE_CURSOR_LEFT | Move cursor left without changing DD RAM |
_LCD_MOVE_CURSOR_RIGHT | Move cursor right without changing DD RAM |
_LCD_TURN_ON | Turn LCD display on |
_LCD_TURN_OFF | Turn LCD display off |
_LCD_SHIFT_LEFT | Shift display left without changing DDRAM |
_LCD_SHIFT_RIGHT | Shift display right without changing DD RAM |
The mikroC Pro for PIC LCD functions will be used in Chapter 11 when we develop LCD based projects.
18.222.230.126