Mikroelektronika MIKROE-350 Data Sheet

Page of 526
Glcd_Init
220
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroBasic PRO for AVR
CHAPTER 6
Prototype
sub 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
dim GLCD_DataPort           as byte at PORTC
GLCD_DataPort_Direction 
as byte at DDRC
dim GLCD_CS1 as sbit at PORTD.B2
GLCD_CS2 
as sbit at PORTD.B3
GLCD_RS  
as sbit at PORTD.B4
GLCD_RW  
as sbit at PORTD.B5
GLCD_EN  
as sbit at PORTD.B6
GLCD_RST 
as sbit at PORTD.B7
dim GLCD_CS1_Direction as sbit at DDRD.B2
GLCD_CS2_Direction 
as sbit at DDRD.B3
GLCD_RS_Direction 
as sbit at DDRD.B4
GLCD_RW_Direction  
as sbit at DDRD.B5
GLCD_EN_Direction  
as sbit at DDRD.B6
GLCD_RST_Direction 
as sbit at DDRD.B7
// End Glcd module connections
...
Glcd_Init()