IN MEMORIAM TO SIR CLIVE SINCLAIR 1940-2021

Sir Clive Sinclair (30. July 1940 – 16. September 2021): Inventor of the pocket calculator, ZX80, ZX81, ZX Spectrum, QL.

“Once you start to make machines that are rivalling and surpassing humans with intelligence, it’s going to be very difficult for us to survive. It’s just an inevitability.” (Clive Sinclair, Wikipedia)

The ZX81 was released on 5. March 1981, 40 years ago.

Because I grew up in the 80’s with a ZX Spectrum in the circle of friends (greetings to Holger S.) and never used a ZX81 except typing on it at Horten (department store) in Aachen, I decided to build the ZXDELUXE - ZX81 clone computer building kit with SD drive sold by BudgeTronics

ZXDELUXE - ZX81 clone single board computer building kit with SD drive

There are a lot of solder connections to be made, this is a big building project. (BudgeTronics)

I ordered the kit with optional keyboard kit and internet module.

Warning: This is an advanced project you should have build various projects before building this one.

Specification

  • ZX80/ZX81 retro computer diy kit
  • Z80A CPU running at 3.25MHz
  • 6.55 MHZ Quartz
  • 32K onboard SRAM 62256
  • 64K EPROM (ROM) AT27C512R- (programmed, low-power, high-performance, OTP)
  • PIC18F452 (programmed)
  • Composite video out (NTSC/PAL)
  • 2x jack connections for saving and loading old cassette tapes (in ZX80 mode)
  • SD-card drive (ZXpand in ZX81 mode only)
  • Joystick interface
  • Internet connection (optional)
  • Plexi keyboard plate with laminated ZX81 keyboard (optional)
  • 9V/1A center tip positive power connector (9V/1A power supply not included)
  • 36 chips (LS/HC/HCT)
  • ZX80/ZX81 mode
  • Fast/Slow mode
  • Inverse / dark mode (white characters on black)
  • 22 lines x 32 columns monochrome character

"ZXDeluxe PCB"

Building

All steps are well explained in the ZXDELUXE BUILDING KIT manual.

I added an additional heat sink for the 7805 voltage regulator.

I replaced the four black rivets for the keyboard with screws to be able to change the laminated keyboard more easily.

"ZXDeluxe PCB - fully assembled"

The only “complicated” part for me was soldering the SD-card holder.

"ZXDeluxe PCB - SD-Card Soldering"

I measured all +5V and ground connections after soldering all parts in but without attaching the IC’s to it’s sockets. I also measured the resistance between +5V and ground before powering on to be sure that there is no short circuit. I attached all IC’s except Z80 CPU, PIC18F452 and RAM/ROM and powered on. On all sockets I measured the +5V and GND with a multimeter and the CLK and RESET signals with an oscilloscope.

"ZXDeluxe PCB - Z80 CPU 3.27MHz Clock (CLK) Signal"

"ZXDeluxe PCB - Z80 CPU RESET Signal"

After I checked that I did not have made any mistake I put the remaining IC’s into the sockets - you have to take care that no pins are bend. Then I set the jumpers to Z81 mode. After attaching a monitor and powering all on, I saw the startup screen and could load games from the SD-card.

"ZXDeluxe PCB - Z81 Startup"

I was very happy that all worked in the first place.

I measured a power consumption of ~250mA @ 9V while playing games.

I measured 23-25°C on the LS/HC/HCT IC’s, 28°C on the Z80 CPU and 65°C on the 7805 voltage regulator.

Conclusion: It is a very nice DIY retro computer kit for makers with some experience in soldering - because of the big amount of connections to be soldered and the small connections of the SD-card holder. It has two modes the ZX80 and the ZX81 mode so you can play with both computer versions from the 80’s.

Z80A Pins

  • CLK (6)
  • +5V (11)
  • GND (29)
  • RESET (26)

PIC18FXX2 Pins

  • +5V (11) (32)
  • GND (12) (31)
  • CLK (13)
  • CLKO (14)

KLFG Modes

  • K mode, keywords

  • L mode, letters

  • F mode, functions

  • G mode, graphics

Simple BASIC Programs

Hello

10 PRINT "HELLO"

The Character Set

10 FOR A=0 TO 255
20 PRINT CHR$ A;
30 NEXT A

Sinus Function

10 FOR X=0 TO 63
20 PLOT X,22+20*SIN(X/32*PI)
30 NEXT X

Overlay ROM Dump (first 16 bytes)

10 PRINT "ADDR";TAB 4;"BYTE"
20 FOR A=0 TO 15
30 PRINT A;TAB 4;PEEK A
40 NEXT A

Save content of the overlay ROM to SD-card

SAVE "OVROM;0,8192"

Program Area (first 16 bytes)

10 FOR A=0 TO 15
20 PRINT PEEK(16509+A)
30 NEXT A

The Answer to the Ultimate Question of Life, The Universe, and Everything

1 REM THE ANSWER IS ...
POKE 16514,1
POKE 16515,21
POKE 16516,0
POKE 16517,121
POKE 16518,129
POKE 16519,79
POKE 16520,201
PRINT USR 16514

Remarks

  • Z80 start address is 0x0000.

  • The memory from 16384 to 16508 (#4000-#407C) is reserved for system variables.

  • A BASIC program begins in memory at memory location 16509 (#407D).

  • BASIC line numbers and line length occupy 2 bytes each.

  • Each keyword in BASIC is a single byte in the ZX81 character set.

  • Long file / folder names are not supported, the maximum is 8 characters.

  • Is is not necessary to add the .P extension when loading and saving programs.

ZXpand

Commands (in K Mode)

  • CAT: Z key

  • Load: J key

  • Save: S key

  • CONFIG: Shift-G

  • DELETE: Shift-S

Firmware

  • CONFIG “V”: display the interface version string, e.g. ZXDELUXE 1.0.

  • CONFIG “M”: display the RAM mapping configuration, e.g. 8-40K or 16-48K.

  • PRINT PEEK 7679 / 10: display the revision of the overlay ROM, e.g. 6.6.

Reset Button

  • Soft: short tap resets ZX81 only, yellow LED flashes.

  • Hard: press 1.5 seconds resets ZX81 + interface controller, red and yellow LEDs flashes.

Memory Map

Address Description
E000-FFFF RAM mirror
C000-DFFF RAM mirror
A000-BFFF ROM mirror
8000-9FFF RAM
6000-7FFF RAM BASIC Program
407D-5FFF RAM BASIC Program
4000-407C RAM System Variables
2000-3FFF RAM
0000-1FFF ROM
  • 4010h (16400) VARS 2 byte address of user variables.
  • 400Eh (16398) DF_CC 2 byte address of PRINT position.
  • 400Ch (16396) D_FILE 2 byte address of display file.
PRINT PEEK 16396 + PEEK 16397 * 256 -> 16509
PRINT PEEK 16400 + PEEK 16401 * 256 -> 17302
17302 - 16509 = 793
10 PRINT "POKE MY SCREEN 4K AND UP"
20 PRINT AT 2,8;"+++"
30 PRINT TAB 8;"+ +"
40 PRINT TAB 8;"+++"
50 PRINT AT 6,0;"ENTER A CHARACTER AND NEWLINE","OR JUST NEWLINE TO STOP"
60 INPUT A$
70 IF A$="" THEN STOP
80 POKE PEEK 16396+PEEK 16397*256+109,CODE A$
90 GOTO 60

Problems

SAVE

I have the problem that the SAVE command of a little BASIC program saved only a 0 bytes file to the SD-card sometimes. I will update this post when I have found the problem.