Hades logoHades applet banner
TinyMipsWithRam: KS0108 graphics display

applet icon

The image above shows a thumbnail of the interactive Java applet embedded into this page. Unfortunately, your browser is not Java-aware or Java is disabled in the browser preferences. To start the applet, please enable Java and reload this page. (You might have to restart the browser.)

Circuit Description

This applet demonstrates the TinyMipsWithRam (on-chip memory) and a graphics liquid-crystal display (based on the KS0108 controller chip). See here for the previous applet with the standard TinyMips and an external MipsRAM. Again, the on-chip memory improves simulator performance quite a bit, because all instruction fetches and many load and store instructions (except for the actual I/O operations) just access the internal memory.

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:

Print version | Run this demo in the Hades editor (via Java WebStart)
Usage | FAQ | About | License | Feedback | Tutorial (PDF) | Referenzkarte (PDF, in German)
Impressum http://tams.informatik.uni-hamburg.de/applets/hades/webdemos/76-mips/27-lcd-onchip/lcd.html