User manual

472
mikoPascal 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
program SPI_Lcd8;
var text : array[16] of char;
var counter : byte;
// Port Expander module connections
var SPExpanderRST : sbit at LATD8_bit;
SPExpanderCS : sbit at LATD9_bit;
SPExpanderRST_Direction : sbit at TRISD8_bit;
SPExpanderCS_Direction : sbit at TRISD9_bit;
// End Port Expander module connections
procedure Move_Delay(); // Function used for text moving
begin
Delay_ms(500); // You can change the moving speed here
end;
begin
CHECON := 0x32;
AD1PCFG := 0xFFFF; // Congure AN pins as digital
text := ‘mikroElektronika’;