CONFIG LCD

Top  Previous  Next

Action

Configure the LCD display.

 

 

Syntax

CONFIG LCD = LCDtype

 

 

Remarks

LCDtype

The type of LCD display used. This can be :

40 * 4, 40 * 2, 16 * 1, 16 * 1a,  16 * 2, 16 * 4, 16 *  4, 20 * 2 or 20 * 4 , 40 * 4a or NHD0420

Default 16 * 2 is assumed.

The 16 * 1a LCD display is a special one. It is intended for the display that has the memory organized as 2 lines of 8 characters.

 

The 40 * 4a LCD display is also a special one. It has two ENABLE lines.

The CONFIG LCDPIN directive must be used to configure the second E line:

CONFIG LCDPIN = PIN , E1 = Pin, E2 = pin, etc.

 

To select between E1 and E2 you need to set the B register.

Mov b,#0   'selects E1

Mov b,#1   'selects E2

 

LCD with a constant will work and also with strings.

To call the low level routines :

Mov a,#2  ; code into acc

Mov B,#0  ; or use Mov b,#1

Acall LCD_CONTROL  ; call routine

 

To send data use the low level routine  WRITE_LCD instead of LCD_CONTROL

 

Most LCD routines will work with the 40*4a display but some will fail. In that case you need to use the low level ASM routines as shown above.

 

The NHD0420 is added in version 218. It is an I2C based LCD. See also the provided sample 89c51rd2-lcd-i2c.BAS.

 

 

Example

REM Sample for normal displays

CONFIG LCD = 40 * 4

LCD "Hello"                'display on LCD

FOURTHLINE        'select line 4

LCD "4"                'display 4

END