Working with the LCD

Top  Previous  Next

At this time, the EM2000 only supports one LCD controller IC: SSD1964. Moreover, only one specific configuration is supported:

Data bus width is 8 bits

Color depth is 24 bits

 

Line mapping is fixed, so changing the value of the lcd.iomapping property will have no effect on the operation of the driver.

Here is how to connect the lines of the SSD1964 (or an LCD panel based on this IC) to the EM2000:

Connect the data bus lines DB7-0 to GPIO lines 32-39 (port 4).

Connect the RST line to GPIO44.

Connect the RS (command/data) line to GPIO43.

Connect the WR line to GPIO42.

Optionally connect the RD line to GPIO41 (this line is not used on the current driver version but may be used in the future).

Connect the CS line to GPIO40.

Note that most LCD panels have a dedicated pin for controlling the backlight. If your LCD panel has such a line, connect it to any suitable line of the EM2000 and control it from your Tibbo BASIC/C code.

 

RST, RS, WR, RD (if used), CS, and backlight GPIO lines must be enabled in your Tibbo BASIC/C code.

To complete the initialization process you must also set the correct LCD resolution (lcd.width, lcd.height) and enable it (lcd.enabled= YES).

Here is the complete initialization code:

 

Tibbo BASIC:

'backlight

io.num=LCD_BACKLIGHT 'you can select any line to control the backlight

io.enabled=YES
io.state=LOW 'assuming that LOW state turns the backlight ON
 
'RST
io.num=PL_IO_NUM_44
io.enabled=YES
 
'DC
io.num=PL_IO_NUM_43
io.enabled=YES
 
'WR
io.num=PL_IO_NUM_42
io.enabled=YES
 
'RD (currently unused by the driver)
io.num=PL_IO_NUM_41
io.enabled=YES
 
'CS
io.num=PL_IO_NUM_40
io.enabled=YES
 
lcd.width=320
lcd.height=240
lcd.enabled=YES