6.7 mikroC Pro for PIC LCD Functions

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.

6.7.1 Lcd_Init

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:

img

img

The configuration above assumes that the connection between the LCD and the microcontroller is as follows:

img

6.7.2 Lcd_Out

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.

img

6.7.3 Lcd_Out_Cp

This function displays text at the current cursor position. Both string variables and literals can be passed as text.

img

6.7.4 Lcd_Chr

This function displays a single character at the specified row and column positions. Both variables and literals can be passed as a character.

img

6.7.5 Lcd_Chr_Cp

This function displays a single character at the current cursor position. Both variables and literals can be passed as a character.

img

6.7.6 Lcd_Cmd

This function sends a command to the LCD. A list of the valid commands is given in Table 6.5.

img

Table 6.5 Valid LCD commands.

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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.230.126