Hades logo    Hades applet banner

TAMS / Java / Hades / applets (print version): contents | previous | next

TinyMips with KS0108 graphics display

TinyMips with KS0108 graphics display screenshot

Description

This applet demonstrates how to control a graphics liquid-crystal display (based on the KS0108 controller chip) from the TinyMips microprocessor.

Please check the introductory applet for the introduction and description of the TinyMips processor. The hardware structure used for this applet consists of the processor, some glue logic, the liquid-crystal display component, and a single RAM component that stores both the program and the output data.

The LCD demo

Sorry, text not ready yet.

Notes:

_start:
        lui     $sp, 0x0000
        addiu   $sp, $sp, 0x1800

        lui     $gp, 0x0000
        ori     $gp, $gp, 0xb000
        jal     main
This puts the stack base at byte-address 0000.1800, shown as word-address 0000.0600 in the MipsRAM editor. The global-pointer register is initialized to a value of 0000.b000. Program code generated by gcc accesses global (static) data via a signed 16-bit16-bit offset from the global pointer. Therefore, the first global data is at -32768+gp or gp-0x8000, which in our case maps to byte address 0000.3000, shown as word-address 0000.0c00 in the MipsRAM editor. The static internal variables used by the ks0108.c display driver routines are therefore mapped at (near) word-address 0000.0c00 in the RAM.

KS0108 display controller

  00 0011 111E   E=0: display off  E=1: display on
  00 11SS SSSS   set start address 0..63
  00 01AA AAAA   set byte address 0..63
  00 1011 1PPP   set page address 0..7
  01 0000 0000   read busy flag (not implemented!)
  10 DDDD DDDD   write 8-bit data to selected address
  11 DDDD DDDD   read 8-bit data at selected address
 1xx xxxx xxxx   reset controller 

Usage

Wait until the applet is loaded. Click on the LC-display component or use the popup-menu on the LCD (popup > edit) to open the actual liquid-crystal display user-interface. Watch the program while it writes data to the display.

You might also want to open the memory-editor (via popup > edit) The memory editor highlights the last read operation in green color, and the last write operation in cyan color, which allows you to easily watch the program execution.

If you want to change the simulation speed, just select 'edit' on the clock-generator component, then edit the value of the clock-generator 'period' property, and select 'apply' (and 'ok' to close the clock-generator config dialog).

Similarly, open the TinyMips user-interface window (via popup > edit) to watch the current register values.

The binary program running on the processor was compiled and linked with the GNU gcc (2.7.2.3) and binutils cross-compiler toolchain on a Linux x86 host, with the final ELF loading and relocation done via the Hades Elf2rom tool. For details, see:

Run the applet | Run the editor (via Webstart)


Impressum | 24.11.06
http://tams.informatik.uni-hamburg.de/applets/hades/webdemos/76-mips/17-lcd/lcd_print.html