LCD Display circuit

An HD44780 Character LCD is a de facto industry standard liquid crystal display (LCD) display device designed for interfacing with embedded systems. These screens come in a variety of configurations including 8x1, which is one row of eight characters, 16x2, and 20x4. The most commonly manufactured configuration is 40x2 characters

Character LCDs use a standard 14-pin interface and those with backlights have 16 pins. The pinouts are as follows:

Ground

VCC (+3.3 to +5V)

Contrast adjustment (VO)

Register Select (RS). RS=0: Command, RS=1: Data

Read/Write (R/W). R/W=0: Write, R/W=1: Read

Clock (Enable). Falling edge triggered

Bit 0 (Not used in 4-bit operation)

Bit 1 (Not used in 4-bit operation)

Bit 2 (Not used in 4-bit operation)

Bit 3 (Not used in 4-bit operation)

Bit 4

Bit 5

Bit 6

Bit 7

Backlight Anode (+)

Backlight Cathode (-)

There may also be a single backlight pin, with the other connection via Ground or VCC pin. The two backlight pins may precede the pin 1.

The nominal backlight voltage is around 4.2V at 25˚C using a VDD 5V capable model.
Character LCDs can operate in 4-bit or 8-bit mode. In 4 bit mode, pins 7 through 10 are unused and the entire byte is sent to the screen using pins 11 through 14 by sending 4-bits (nibble) at a time.

Description: This routine configures the LCD. Based on the Hitachi HD44780 LCD controller. The routine will configure the I/O pins of the microcontroller, setup the LCD for 4- or 8-bit mode and clear the display. The user must provide three delay routines: DelayFor18TCY() provides a 18 Tcy delay. DelayPORXLCD() provides at least 15ms delay. DelayXLCD() provides at least 5ms delay.

Description: This routine reads an address byte from the
Hitachi HD44780 LCD controller. The user
must check to see if the LCD controller is
busy before calling this routine. The address
is read from the character generator RAM or
the display data RAM depending on what the
previous SetxxRamAddr routine was called.

Description: This routine reads a data byte from the
Hitachi HD44780 LCD controller. The user
must check to see if the LCD controller is
busy before calling this routine. The data
is read from the character generator RAM or
the display data RAM depending on what the
previous SetxxRamAddr routine was called.

Description: This routine writes a data byte to the
Hitachi HD44780 LCD controller. The user
must check to see if the LCD controller is
busy before calling this routine. The data
is written to the character generator RAM or
the display data RAM depending on what the
previous SetxxRamAddr routine was called.

Description: This routine writes a string of bytes to the
Hitachi HD44780 LCD controller. The user
must check to see if the LCD controller is
busy before calling this routine. The data
is written to the character generator RAM or
the display data RAM depending on what the
previous SetxxRamAddr routine was called.

Description: This routine writes a string of bytes to the
Hitachi HD44780 LCD controller. The user
must check to see if the LCD controller is
busy before calling this routine. The data
is written to the character generator RAM or
the display data RAM depending on what the
previous SetxxRamAddr routine was called.

Hi,
I'm always confused about 18 Tcy delay. Do I understand correctly that the DelayFor18TCY() method must skip 18 instruction clocks? If so, what about osc clock speed? That does not matter? How come?