The PSION Organiser II Homepage
Technical Reference
Memory Usage
Filing System
System Timing
System Board
Power Supply Board
Interface Slots
Low Level
Comms Link
Psion Link
Utility System
LZ Passwords
System Services

Technical Reference Manual





related information:

Everything you need to know about the LCD and more...


The display used in the Organiser II models CM, XP and LA is a Hitachi LR039 Liquid Crystal Display (LCD) driven by a Hitachi HD44780 LCD controller.

It consists of two lines of 16 characters. Each character is defined by a 5 x 8 dot matrix with the 8th line normally left blank as it is used for the single line cursor.

The character generator in the LCD controller contains 192 displayable characters (ASCII values 32 to 256). There are also 8 user definable characters which are repeated twice in the character set ASCII values 0 to 7 and 8 to 15. These are called UDG 0-7.

The display on the LZ and LZ64 uses the same LCD drivers as on the standard Organiser but is arranged as 4 lines by 20 characters. The HD44780 was replaced by a customised 66780 chip to allow for foreign characters. The characters from 0 to 127 remain the same except for character 92 which is changed to a "\" character. Most characters from 128 to 255 have changed but some are left for compatibility, e.g.. character 254 is left as a space to use as a blank "non-space" character.



The LZ models maintain compatibility with 2-line Organisers by emulating the 2 line screen. Thus, there are two modes of operation: 4-line mode and 2-line compatibility mode. To simplify the writing of 2-line/4-line applications, variables are provided for the address of the screen, the mode, the number of lines and the width of the screen which are valid in either mode.

The system service DP$MSET is provided to switch between modes. Note also that existing bootable applications are automatically put into 2-line mode if they print to the screen.

In 2-line compatibility mode all existing applications should work exactly as though they are running on a 2-line Organiser. The same screen buffer (DPT_TLIN) is used when in this mode.


The LCD controller contains a control register and a data register. These are accessed via the following addresses:

$0180 SCA_LCDCONTROL The LCD control register
$0181 SCA_LCDDATA The LCD data register

The following variables are used by the display system services:

dpt_tlin16 byte buffer containing contents of top line of the display (not used in 4-line mode)
dpt_blin16 byte buffer containing contents of bottom line of the display (not used in 4-line mode)
dpb_cposCurrent cursor position (0-31, LZ: 0-79)
dpb_custCursor state (as passed in DP$STAT)
dpb_vlinUsed in view
dpb_vsizUsed in view
dpb_vdirUsed in view
dpw_spedHorizontal scrolling rate (in 50ms intervals). Delay before scrolling is four times dpw_sped
dpw_delyVertical scrolling rate.
dpw_redyDecremented every 50ms. Used for timing. See DP$WRDY.
dpa_vaddUsed in view.
dpb_sposSaved cursor position. Used by DP$SAVE and DP$REST.
dpb_scusSaved cursor state. Used by DP$SAVE and DP$REST.
dpt_save32 byte buffer containing saved display text, used by DP$SAVE and DP$REST on CM/XPs..

The following variables are only used by 4-line models. Only dpb_mode was also assigned (and zeroed) on 2-line machines. They can be read at any time but should not be written to directly (DP$MSET or DP$CSET must be used).

dpb_modeshows the display mode that is currently in operation (0 = 2-line, 1 = 4-line).
dpa_scrn contains the address of the current screen buffer
(in 2-line mode: DPT_TLIN, in 4-line mode: DPT_4LIN)
dpb_nlincontains the number of screen lines in the current display mode.
dpt_widecontains the screen width in the current display mode.
dpb_clok CLOK stores the position of the left most character of the 6 character UDG clock.
If bit 7 is set the clock will not be updated (i.e. it isoff).
dpb_cred"clock ready" flag, used to time the 1/2 second flashing of the colon. Counts down from 9 to 0 and the top bit is toggled for showing the ":" instead of an underline character.

On the LZ, DP$SAVE and DP$REST use DPT_4SAV, the 4-line save buffer, even in 2-line mode, instead of the previous DPT_SAVE which no longer exists.


The UDG clock uses UDGs 3-7 to display the digits and UDG 1 for the am/pm indicator if in 12 hour mode. The clock is always right justified in a field of 6 characters.

The system service DP$CSET, can print the clock anywhere on the screen and will initalise the updating of the clock every 1/2 second. DP$CSET can also stop the clock by preventing the updating but the UDGs will remain on the screen until they are overwritten by printing.

The clock is updated in the keyboard interrupt routine by calling DP$CPRN. Every 1/2 second UDG 5 is re-defined to achieve the flashing colon and every time the minutes change, all UDGs used for the clock are redefined

Occasionally, the clock will stop flashing, e.g.. when printing. This is because the keyboard interrupts have been disabled momentarily. The clock will not, of course, lose any time since it always gets the time from the system clock.


The following machine code program stores a pound sign in UDG 0 (ASCII characters 0 and 8). The data for the pound sign is read from address DATA.

Note that on LZ machines this task could also be accomplished by using DP$UDG, but this code will still work.

; Set LCD address to $40 the address of the first UDG.
        LDA     A,#$40          ;A is LCD address
; Wait for busy low.
        BMI     1$
; Store address
; Now store data
        LDX     #DATA
        LDA     B,#8
2$:     LDA     A,0,X
; Wait for busy low.
        BMI     3$
; Store data. (LCD address auto increments)
        STA     A,SCA_LCDDATA
        DEC     B
        BNE     2$

        FCB     6,9,9,12,8,24,31,0      ;Pattern for pound sign


This section describes the operating system calls for writing to the LCD display.


Displays or removes block or line cursor at given position.


Displays a given string at a given line. If the string doesn't fit, it starts to scroll to the right wrapping around with two spaces in between. Pressing the left and right arrow keys alters the scrolling action (this feature may be disabled). Any other key press terminates.


Prints a given number of a single character.


Outputs a single character.

Control characters ASCII 0 to 7 display the 8 user definable graphics characters.

Certain of the ASCII control characters are intercepted by this routine to control the display as follows:

808Moves cursor left 1 character.
909Moves cursor to the nearest position modulo 8.
100AGoes on to the next line.
110BMoves the cursor to the top left of display.
120CClears both lines of the display.
130DReturns the cursor to the beginning of line.
140EClears the 1st line. Cursor at top left.
150FClears the 2nd line.
1610Rings the bell.
1711Refreshes display.
1812Refreshes 1st line.
1913Refreshes 2nd line.
2014Refresh 3rd line (LZ).
2115refresh 4th line (LZ).
2216Clears 3rd line (LZ).
2317Clears 4th line (LZ).
2418Prints high dotted line (LZ).
2519Print low dotted line (LZ).
2620Clear to end of line (LZ).

On LZs, to maintain compatibility, the system service DP$EMIT will translate any characters from $80 to $A0 inclusive into a space character if the machine is running in "2-line compatibility mode".


Saves the current screen state including the cursor position.

Note that this routine should not be called unless alarms are disabled as the alarm software calls this routine as well. This is explained in the diary section. Also the pack sizing routine (PK$SETP) uses these calls when displaying "SIZING PACK B" etc.


Restores a previously saved copy of the screen

If DP$REST is called without previously calling DP$SAVE then anything can and probably will happen.


Waits until the value in dpw_redy has been decremented to 0.

Each keyboard interrupt causes dpw_redy to be decremented by 1 and as such provides a handy 50 millisecond timer. However if interrupts are switched off this routine will still work as it recognises that interrupts are off and decrements dpw_redy once every 50 milliseconds.

Note that this routine behaves as a wait on a timed semaphore. It is used extensively by the LCD driver software to provide scrolling delays.

DP$MSET (LZ only)

Sets the Operating System into 2 or 4 line mode. The following is always carried out:

  1. If the top bit of the A register is clear, the UDG CLOCK is switched off.
  2. The variable DPB_MCHK is cleared.
  3. END if the mode requested is the same as the current mode.
  4. The screen is initalised for the mode selected:
    • 2-line: clear 16 character by 2 line window with border
    • 4-line: clear entire 4-line screen.
  5. The variables DPA_SCRN, DPB_NLIN, DPB_WIDE are initialised.

DP$PVEW (LZ only)

A partial view routine. Works exactly like DP$VIEW but at the current cursor position. Any characters before the cursor will not scroll but the string will be displayed scrolling on the remainder of the line. This routine is used, for example, in CALC on the LZ.

DP$UDG (LZ only)

Defines or reads a UDG. The operating modes are:

  • Define an UDG with 8 bytes (one per pixel line).
  • Define an UDG with 5 bytes (one per pixel row).
  • Store an UDG to a buffer in 8 byte mode.

Note that interrupts are disabled in DP$UDG.

DP$CSET (LZ only)

Sets the clock-display status. Parameters specify if and where on the screen the clock will appear. The clock is printed when DP$CSET is called and is updated in the keyboard interrupt. The interrupt just re-defines the UDGs and does not write to the screen.

Note that any UDGs previously defined will be overwritten.

DP$CPRN (LZ only)

Redefines the UDGs used for the clock as the current system time.

first previous   next top