User manual

Table Of Contents
510
mikoC PRO for PIC32
MikroElektronika
Available SPI Lcd8 Commands
SPI Lcd8 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. Display data RAM 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 display data RAM
_LCD_MOVE_CURSOR_RIGHT
Move cursor right without changing display data RAM
_LCD_TURN_ON
Turn Lcd display on
_LCD_TURN_OFF
Turn Lcd display off
_LCD_SHIFT_LEFT
Shift display left without changing display data RAM
_LCD_SHIFT_RIGHT
Shift display right without changing display data RAM
Library Example
This example demonstrates how to communicate Lcd in 8-bit mode via the SPI module, using serial to parallel convertor
MCP23S17.
Copy Code To Clipboard
char *text = "mikroElektronika";
// Port Expander module connections
sbit SPExpanderRST at LATD8_bit;
sbit SPExpanderCS at LATD9_bit;
sbit SPExpanderRST_Direction at TRISD8_bit;
sbit SPExpanderCS_Direction at TRISD9_bit;
// End Port Expander module connections
char i; // Loop variable
void Move_Delay() { // Function used for text moving
Delay_ms(500); // You can change the moving speed here
}
void main() {
// If Port Expander Library uses SPI2 module
// Initialize SPI module used with PortExpander