LCDINIT

Top  Previous  Next

Action

Reinitialize the LCD display.

 

 

Syntax

LCDINIT

 

 

Remarks

When you use any of the LCD display routines the LCD display will be initialized automatic at startup of your program.

The LCD routines demand that the WR of the LCD display is connected to GND. When in your design the WR pin of the LCD is connected to a PIN of the micro processor, it will be high during the initialization and so the display will not be initialized properly.

The LCDINIT routine allows you to perform initialization after you have set the pin that controls WR of the LCD to 0V.

 

 

See also

LCDHEX , $LCD CONFIG LCD

 

 

Example

'--------------------------------------------------------------

'                 (c) 1995-2006 MCS Electronics

'--------------------------------------------------------------

'  file: LCD.BAS

'  demo: LCD, CLS, LOWERLINE, SHIFTLCD, SHIFTCURSOR, HOME

'        CURSOR, DISPLAY

'--------------------------------------------------------------

$sim

Rem The $sim statement will remove long delays for the simulator

Rem It is important to remove this statement when compiling the final file

 

'Config Lcdpin = Pin , Db4 = P3.1 , Db5 = P3.2 , Db6 = P3.3 , Db7 = P3.4 , E = P3.5 , Rs = P3.6

Rem with the config lcdpin statement you can override the compiler settings

 

 

Dim A As Byte

Config Lcd = 16 * 2                     'configure lcd screen

'other options are 16 * 4 and 20 * 4, 20 * 2 , 16 * 1a

'When you dont include this option 16 * 2 is assumed

'16 * 1a is intended for 16 character displays with split addresses over 2 lines

 

'$LCD = address will turn LCD into 8-bit databus mode

'       use this with uP with external RAM and/or ROM

'       because it doesnt need the port pins !

 

'----------------- these 2 lines can be used when WR is connected to P1.0 for example ---

P1.0 = 0

INITLCD

'-----------------------------------------------------------------------------------------

Cls                                   'clear the LCD display

Lcd "Hello world."                     'display this at the top line

Wait 1

Lowerline                             'select the lower line

Wait 1

Lcd "Shift this."                     'display this at the lower line