Cocoacrumbs

Cocoacrumbs

All of the buildings, all of those cars
were once just a dream
in somebody's head
Mercy Street - Peter Gabriel

Cocoacrumbs

2 minutes read

Pic 1

SSD1963 interface code for the eZ80 based Z20X computer

A minimal set of routines to initialize the SSD1963 LCD Display Controller in combination with a 7" LCD Display as used by the Z20X computer.

Inspiration has been taken from the UTFT Library.

Currently, this library allows the following:

  • Initialize the SSD1963 LCD Display Controller for a 7" LCD display.
  • Set front/background colour.
  • Clear the screen (black background).
  • Draw horizontal, vertical lines and rectangles.
  • Select a font (default fonts from the UTFT Library and an attempt to recreate the BBC font).
  • Print a character/string in any colour and position on the screen.
  • Set the Gamma curve.

Caveats

Drawing speed is rather slow due to the huge amount of bytes that need to be send to the screen. For every pixel we need to send 3 bytes (one byte each for Red, Green and Blue).

  • For a 800 by 480 LCD screen, this means that 800 * 480 * 3 = 1,152,000 bytes (> 1 MByte !) needs to be written.
  • For a 8 by 8 pixel character, this means that 8 * 8 * 3 = 192 bytes needs to be written to the LCD controller for just one character.

The library is hard coded for landscape mode. This keeps the code cleaner and easier to understand when adding new functionality.

Interfacing to the SSD1963 LCD Display Controller is achieved as memory mapped IO. The library is currently hard coded to use these addresses:

  • 0x400000 to access the command register
  • 0x400001 to access the data register You need to setup CS1 for the 0x400000 to 0x400001 memory region since the Z20X computer has the CS1 wired to the SSD1963 LCD Display Controller.

Where to find the code

You can find the code with a short sample program here.

A short video clip showing the code in action:

Recent posts

See more

Categories

About

Cocoacrumbs