Computers Overview
Commodore PET
Sinclair ZX80
Sinclair ZX81
BBC Micro
Sinclair Spectrum
Memotech MTX
    About
    Library
    Manuals
    Options
    Photos
    Projects
      CFX
      Hardware Hacks
      Legacy (1980s)
      MAGROM
      MTXPlus+
          Architecture
          Design Data
          Firmware
             CPU
               Clocks (PHI)
               Memory Map
               ROM
                   Boot
                   Err. Msgs
                   Features
                   Media
                   Timing
               Speculator+
             I/O
             Video
               Wait States
          Parts
          Software
      PAL Reader
      Programmers
      ReMemotech
      ReMemorizer
      SDX
    Repairs
    Software
    Tools
    User Groups
    Video Wall
Memotech CP/M
Atari ST
DEC 3000 AXP
OpenVMS
Raspberry Pi

 

 
 
 

"MTX Plus+" Firmware Features - Usage

 

The MTXPlus+ firmware includes a significant number of enhancements over the standard Memotech MTX ROMs, but supports almost all of the original ROM functions - the exception being the cassette tape functions. Refer to the standard Memotech documentation for detailed coverage of the relevant features, including :

 

Memotech Operator's Manual BASIC & Assembly Language References
SDX User's Guide SDX BASIC Disk Extensions
FDX User's Guide CP/M User Manual
   
CFX Operator's Manual Compact Flash SDX BASIC & CP/M Usage

This page describes how to use the additional features of MTXPlus+ that are not already described in Memotech or my CFX documents.


System Control Register

An 8-bit control register is used to store configuration relevant to Speculator+ (bits 0 to 3) and for the CPU clock speed selection logic (bits 4 - 7). See the Speculator+ page for details on bits 0 to 3. This register is accessed through I/O port 255 (FFh).

Bit Mapping MTXPlus+ Control Register (Port FFh)
7 6 5 4 3 2 1 0
  Description
              x
            x  
          x    
        x      
      x        
    x          
  x            
x              
Speculator+ NMI_EN 0 = disable, 1 = enable
Speculator+ NMI_SEL 0 = delayed, 1 = immediate *** not used ***
Speculator+ ZX_Mode 0 = lower 16K R/W, 1 = lower 16K R/O 
Speculator+ Wait control  
Software PHI Select LSB (See clock generation page for details)
Software PHI Select  
Software PHI Select  
Software PHI Select MSB

At Reset, the system defaults to a clock frequency of 4Mhz and bits D7 to D4 of the Control Register are cleared.


CPU Speed Detection & Control

 

When the system is booted, the MTXPlus+ support ROM runs a speed detection routine and reports the current clock speed in MHz.

 

Once the system is executing the BASIC ROM, the speed can be switched thorough software by writing to the system control I/O port (255) and additional BASIC commands can be used to read the CPU clock frequency and set the value of the internal CPU clock multiplier. The Z180S version of the CPU board supports the clock doubling features of the Z180S and starts up in un-doubled mode, see the CPU V3 page for details of the clock doubling features



CPU Clock Speed Control from BASIC

 

Description   Applies to
Report the current CPU speed and, for the Z180S only, the status of the clock multiplier USER SPEED Z80 & Z180S
     
For the Z80, the USER SPEED command can be used to set the clock rate to any 1 of the 16 available frequencies from 4 to 16 MHz. USER SPEED [int]

where int = 0 .. 15
Z80
     
For the Z180S, USER commands can be used to set the clock multiplier to half, single or double speed, they have no effect on the Z80 board where the clock multiplier does not exisit. USER HALF Z180S
USER SINGLE Z180S
USER TURBO Z180S
     

Speed Selection Using I/O Port FFh

 In addition to using the new BASIC USER SPEED command, the user can also write to I/O port 255 (FFh) directly to change the system clock frequency.


 

Real Time Clock

 

For an overview of the RTC, please see the I/O Ports page and for a full description of the RTC's registers and status bytes, see the Dallas Semiconductor DS12887 datasheet.

 

Date & Time Functions

To simplify communication with the RTC, additional commands have been added to MTXPlus+ BASIC.
Set RTC Date & Time
USER SETDATE "dd/mmyy"
USER SETTIME "hh:mm:ss"
Read RTC Date & Time
USER GETDATE  
USER GETTIME  
Update MTX Clock from the RTC
USER SETCLOCK  

 

Slow CPU Clock Source

For diagnostic purposes, it is possible to run MTXPlus+ with an ultra-slow CPU clock, this is derived from the Square Wave Output of the RTC and can be set to a range of values between 2Hz and 8,192 kHz, defined by the lower 4 bits of Status Register A. (These bits also setup the periodic interrupt rate to generate a CPU interrupt for user programs - this function is not used in MTXPlus+).

Note: Even at the maximum rate of 8Khz, the slow clock is unlikely to be useful if the only method of monitoring the system is through the normal video output. The system would be running some 500 times slower than design and take far too long to display meaningful output to the screen. The slow clock in designed to be used in tandem with the Bus Diagnostic Card, probably with a clock setting of  2 or 4 Hz.
Status Register A
Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0
UIP DV2 DV1 DV0 RS3 RS2 RS1 RS0

Status Register A Periodic SQW
RS3 RS2 RS1 RS0 Interrupt Rate Frequency
See DS12887 datasheet for all available values
0 0 0 0 None None
0 0 1 1 122.070 us 8.192 kHz
1 1 1 0 250 ms 4 Hz
1 1 1 1 500 ms 2 Hz

Status Register A is also used to start & stop the RTC and stores a flag (bit 7, read only) signifying when an update will soon occur (Update In Progress).
To update the status register, the a pattern of "010" should also be written to bits 6..4 to ensure that the RTC is running. For example, to set a 4Hz SQW frequency, a bit pattern of x0101110 should be set (46d)
Setup write to Register A
OUT 112, 10
Update SQW frequency bits
OUT 113, 46
 
 

Status Register B
Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0
SET N/A for MTXPlus+ SQWE DM 24/12 DSE

SET 0 when normal updates are occurring, 1 when setting date/time
SQWE Square Wave Enable (1 = enabled)
DM Date Mode (1 = Binary, 0 = BCD), Binary mode used in MTXPlus+
24/12 Hours format (1 = 24 hours, 0 = 12 hours), 24 hour mode used in MTXPlus+
DSE Daylight Savings Enable (1 = DST enabled, 0 = DST disabled)

 

Status Register B is used to control various RTC functions, as shown in the table above, not all are relevant to MTXPlus+.

To update the SQW enable bit, the user should first read the current value in the register to preserve the current settings before writing a new value to the register.
Bits 7, 6, 5 and 4 should be zero

Only update the SQWE bit, i.e., the new value should be the old value, 'OR'ed with 8
Setup access to Register B
OUT 112, 11
Read current register value
LET X = INP (113) (e.g. x =2)
Setup access to Register B
Only update SQWE (bit 3)
e.g. OUT 113, (2+8)
 
 
 

 

 

 

 

 

mailto: Webmaster

 Terms & Conditions