Datasheet

Glcd_Init
236
MIKROELEKTRONIKA - SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroPASCAL PRO for AVR
CHAPTER 6
Prototype
procedure Glcd_Init();
Returns Nothing.
Description
Initializes the Glcd module. Each of the control lines is both port and pin config-
urable, while data lines must be on a single port (pins <0:7>).
Requires
Global variables :
- GLCD_CS1 : Chip select 1 signal pin
-
GLCD_CS2 : Chip select 2 signal pin
- GLCD_RS : Register select signal pin
- GLCD_RW : Read/Write Signal pin
- GLCD_EN : Enable signal pin
-
GLCD_RST : Reset signal pin
- GLCD_DataPort : Data port
- GLCD_CS1_Direction : Direction of the Chip select 1 pin
-
GLCD_CS2_Direction : Direction of the Chip select 2 pin
- GLCD_RS_Direction : Direction of the Register select signal pin
- GLCD_RW_Direction : Direction of the Read/Write signal pin
-
GLCD_EN_Direction : Direction of the Enable signal pin
- GLCD_RST_Direction : Direction of the Reset signal pin
- GLCD_DataPort_Direction : Direction of the Data port
must be defined before using this function.
Example
// Glcd module connections
var GLCD_DataPort : byte at PORTC;
GLCD_DataPort_Direction : byte at DDRC;
var GLCD_CS1 : sbit at PORTD.B2;
GLCD_CS2 : sbit at PORTD.B3;
GLCD_RS : sbit at PORTD.B4;
GLCD_RW : sbit at PORTD.B5;
GLCD_EN : sbit at PORTD.B6;
GLCD_RST : sbit at PORTD.B7;
var GLCD_CS1_Direction : sbit at DDRD.B2;
GLCD_CS2_Direction : sbit at DDRD.B3;
GLCD_RS_Direction : sbit at DDRD.B4;
GLCD_RW_Direction : sbit at DDRD.B5;
GLCD_EN_Direction : sbit at DDRD.B6;
GLCD_RST_Direction : sbit at DDRD.B7;
// End Glcd module connections
...
Glcd_Init();