The MZ-40K kit
Written by www.sharpmz.org / Germany & Richard Cornelius / UK
Published in the SUC magazine November 2002, Volume 22 Number 3, p. 4 – 8
My MZ-40K was bought and assembled by its previous owner in 1978 for DM 229. Searches on the internet have resulted that it was also sold in Japan for the first time in May 1978 for 24,800 Yen. In both places the MZ-40K was only sold as a kit. In my German manual the assembly instructions cover 23 pages of the 68 in total, there are also detailed diagrams to make it easier.
The MZ-40K uses 4-bit technology even though the Z80-age had already begun. There are no expansion possibilities, for example like storing the keyed-in music data onto external tape. And it offers no way of learning programming languages or programming logic, or finding out how computers work. It seems possible that Sharp did not sell all the MZ-40K’s they produced.
What market was Sharp aiming at with the MZ-40K ? Someone once said to me that Sharp wanted to test the market for home computers at that time, and this machine ( which led on to the later MZ-series ) was the result. Nevertheless, was the MZ-40K a success in its time and also how does it relate to the other Sharp models manufactured at the time, the SM-B-80, which were substantially better equipped ( Z80, tape recording, PPI, plus more ) ?
The MZ-40K is currently a dedicated collectors item, because there is not a great deal you can do with it. It is very rare these days to find an MZ-40K in its original boxed kit condition and therefore if it is found in that condition it is quite expensive. Built kits in Japan and Germany appear to go in auctions for between 50 and 100 Euros, but this seems likely to rise with demand, even though it is very low technology compared with its successors.
Main features of the MZ-40K
Data entered for a tune ( called “programming” by Sharp ) may subsequentially be played via the amplifier and loud speaker. As mentioned before it isn’t possible to store this music data to any form of external medium for re-loading at a later date… so it is lost after powering off and has to be re-entered every time it is needed.
This tune can be started manually or by the built in timer. The timer can be preset and when it reaches the set time it starts either the tune or a buzzer as an alarm clock ( buzzer duration of 65 seconds ).
If you have the extra Option 1 the tune or buzzer can also be event controlled by sensors. This Option 1 may also be used to combine the timer and sensor. In this operation mode ( “Mixed mode” ) the tune starts with each sensor event, as well as with the timer. The program then ends after the “timed” tune has finished.
In addition to some electronic parts which must be assembled onto your MZ-40K, the Option 1 kit contains the following sensors: 1 floating sensor, 1 light sensor, 1 REED switch with a tiny permanent magnet and 3 micro switches.
With these sensors the MZ-40K can be controlled by various external events, e.g. Light detection or intensity, water levels etc. It is also possible to count the pulses from any micro switch or the REED switch.
The organ covers a range of 2 octaves and is played by 20 of the 22 keys on the keyboard ( single voice only ).
Option 2 enables you to have 32 keys and therefore 3 octaves of music.
The volume is controlled by a dial which also is combined with the on / off switch.
A 24 hour clock displays the time on the 4 LED’s in the format HH.MM. The ‘.’ of the display flashes once every second.
The MZ-40K can also be used to calculate telephone call charges, keys are pressed at the beginning and end of the call to start and end the timing. Once started the MZ-40K constantly displays the current charge, the charging rate for your locality must be defined before running the program, this is done by permanently soldering jumpers onto the circuit board. There are 4 jumpers and these use the 1-2-4-8 code to define the period charge in the range of 1 to 15 ( cents, pennies, whatever ).
The red LED’s have a height of 10mm and they are used to display the inputs, time, the pulses counted or “random numbers” whilst playing a game. In addition to this they can also display the contents of the RAM memory ( note data ) to enable correction if necessary.
If you have the Option 1 installed a counter can be programmed to take its input ( counting pulses ) from the REED or any micro switch. This counter can also be preset with an initial value and each increment is constantly displayed on the LED’s. With each counting pulse the stored tune is also played unless the STOP key is pressed.
Inputting data is done via a hex keyboard. This keyboard consists of 22 keys, 16 in the range of 0 – F and 6 additional function keys, which are used to start / stop a program and input / output music data.
There is also a “Game Switch” ( realized by one of the micro switches ) which is used for a dice, roulette or other games. To run a game, set data is entered depending upon which game you require. Then when the game switch is pressed this data is displayed in a very fast sequence so that when the game switch is released the LED’s display a “random” value. The player then responds by taking specific actions, according to the game instructions and the “random” value on display.
MZ-40K music programming
The data for tunes is stored in RAM, the size of which allows 127 notes maximum. Each note definition takes up 4 x 4 bits; the audio frequency occupies the first 8 bits and the note duration the remaining 8 bits. This note definition can also specify a rest or an instruction to repeat the tune a specified number of times. 36 notes over 3 octaves are available. The tempo of the entire tune can also be set either by a note definition or by keyboard function.
‘F’ selects a program for inputting of notes. <ADR> is one of the function keys on the keyboard and sets the RAM address to READ / WRITE. By F000 all the following note definitions are to be stored beginning from address 000. Possible addresses are 000 – 1FC.
The note data is then entered in the following format:
10 is the value for the note “DO” ( as DO RAY ME FA SO etc. ) in the second octave. 07 indicates that this is a quarter note, and the function key <WRITE> stores the data in RAM at the starting address 000.
Further notes are entered in a similar fashion and the end of the tune is concluded by entering EEEE <WRITE>. When the machine detects the EEEE it knows the tune has ended. The EEEE also uses 16 bits of RAM.
If a wrong note is entered this can be corrected at any time, to find the address of a note there is a table in the manual, for example, if the 108th note is incorrect then by using the table the address for this note is 1AC. In the following example the incorrect note data “1207” for the 108th note is corrected to “1404“:
F1AC <ADR> ( sets RAM address to 1AC, 108th note )
1404 <WRITE> ( overwrites memory contents with 1404 )
To check memory contents at any time without having to rewrite them the <READ> function key can be used, as shown below. Additional <READ> presses show subsequent memory addresses.
F000 <ADR> ( sets memory address to 000 )
<READ> ( reads and displays data starting at address 000 )
<READ> ( reads and displays data starting at address 004 – the second note )
The memory contents are displayed with 4 digits each time the <READ> key is pressed, however the address is not shown.
To play the tune the following is entered:
0 <ADR> ( selects the program which plays the tune immediately )
000 <WRITE> ( says that the tune data begins at address 000 )
E <ADR> ( selects the program to set the tempo )
2 <WRITE> ( tempo = 2. Possible options are 0 to F with 0 being the fastest )
0 <RUN> ( starts playing the tune )
Hardware details and Option Kits
The 4-bit CPU, an MB8843, is clocked at approximately 1.8 MHz and contains internal ROM of 1K x 8 bit. This ROM contains all the machine code routines for the keyboard control, the 8 bit counter, the LED’s, the loud speaker, telephone charging, and the 2 external RAM’s. The CPU also has its own inbuilt RAM memory with a storage capacity of 64 x 4 bits which is used to store internal data. Unfortunately it appears that there is no way to read the information from the CPU’s ROM ( MASK ROM ) which would enable us to get a complete understanding of how the MZ-40K operates. If anyone knows how to do this please let me know.
The external RAM memory consists of two chips 256 word x 4 bit, giving a total external memory of 2048 bits, which is used for the storage of notes. With this it is possible to have a 127 notes ( each note taking 16 bits of data ) and plus the terminating characters EEEE.
The keyboard has 22 keys on a 4 row x 6 column matrix. Options 1 and 2 are controlled by 2 additional port-bits ( not shown ).
The mains frequency supplied to the machine ( 50 / 60 Hz ) must be set up correctly as it is used to control the display of time and timing cycles, e.g. for the telephone call charges; this is done by inputting values via the function keys. This AC frequency is also used for the games, e.g. rolling the dice. Therefore, if the MZ-40K is to function as designed, it requires an AC power supply which is included in the kit. A DC power supply can also be used without damaging the machine but, in the absence of a reference frequency, many features will not work as intended.
This optional extra does not come as standard, and it allows the MZ-40K to be controlled by different external events. Just like the MZ-40K, it came in kit form; but I do not know what price it was initially sold for. My own machine already had this option built in by its previous owner, but he doesn’t know anything about the price at that time either.
The Option 1 can be built in into each MZ-40K which does not have it. The items in this kit consist of common commercial electronic components: 2 IC’s, 6 transistors, 1 diode array, 5 diodes, 3 resistance arrays, 2 resistors, 6 capacitors, 6 sensor sockets and 6 plugs ( all have a diameter of 2.5 mm ), 80cm solder wire, 8 wires, 3 micro switches, 1 REED switch with a tiny permanent magnet, 1 floating sensor and 1 light sensor ( my machine is missing this sensor as it was lost by the previous owner ).
The diagram of the MZ-40K and the specifications of the electronic elements including the sensors are on my site. The light sensor isn’t shown, it was misplaced by the previous owner unfortunately. PDF-formatted data sheets for almost all electronic elements of the MZ-40K are downloadable from my site.
Option 2 is an organ keyboard and enables the machine to play a total of 32 notes over 3 octaves.
( Click on the picture to view a large picture )
Like to Option 1, this option was only sold as a kit; and again I do not know the original price.
Without this kit only 20 notes can be played directly from the MZ-40K keyboard ( but all 36 notes are still available by programming ).
The manual describes the assembling and the operation of the MZ-40K very well and its two optional extras, and some further games and tunes. A reference card is attached to the MZ-40K kit, giving a recapitulatory overview of all functions, commands, and the necessary keyboard inputs. The manual shows the diagram and the layout of the Printed Circuit Board too.
Two supplementary A3-sized sheets of my German MZ-40K version give the overall instructions for the games “Car Race” and “Deer Hunt”. Therefore the instructions are written in German and the German name of the “Car Race” is “Autorennen” and the German name of “Deer Hunt” is “Grosswildjagd”.