KIM-1 Nachbau

On the forum Mikrocontroller.net I found a thread dedicated to a KIM-1 replica with a twist.
Author is Manfred Langemann (manni), this page is published with his permission.

The built My-KIM computer has the following features:

  • A complete 6502 Integrated Development Environment (IDE) for writing assembler source code, including editor, assembler, debugger and EEPROM programmer, see screenshot above.
  • The hardware comes with a 6502 micro-controller, 8 KByte EEPROM, 32 KByte RAM and an I/O interface based on an Intel 8255 PPI (Programmable Peripheral Interface), offering three 8-bit ports. The audio tape interface is realised by an NE565 PLL and the RS232 serial interface is based on a MAX232 IC

Download here My-KIM – A Replica of the KIM-1 Computer Hardware / Software Documentation
with extensive doumentation of hardware, the circuit diagram and PCB in Eagle format, and software: the adapted KIM-1 monitor source and binary, Microsoft Basic KB9 adapted in source format, an EEPROM programmer and the IDE, for Windows, program.

The IDE

Manfred extended a UNIX like console assembler to a window based 6502 Integrated Development Environment (IDE), offering the following features:

  • Loading, editing and saving 6502 assembler source code files
  • Assembling the source code and generating Intel Hex files as well as List files
  • Debugging the source code including break point definitions
  • Showing and editing the total 6502 memory area
  • Flashing the binary code to an 8 KByte EEPROM

It shall be mentioned, that the assembler can only be used for the early 6502 processors, but not for the 65C02 successor, having additional instructions not supported by this assembler.

Here the German text of the forum thread.

da Winter, Corona mit sozialen Einschränkungen und Rentnerdasein auf den gleichen Wochentag fielen, habe ich beschlossen, den KIM-1 Single-Board Computer basierend auf dem 6502 Prozessor nachzubauen. Dieses Board hatte ich 1977 gekauft und mit dynamischen RAMs, Tastatur und TV-Monitor sowie Microsoft BASIC aufgemotzt. Damit war ich der einzige an der Uni, der einen eigenen Computer besaß. Die Kommilitonen durften weiterhin mit Lochkarten die CDC-6000 bestücken. Leider ist das Unikat irgendwann auf dem Wertstoffhof gelandet.

Beim Nachbau habe ich soweit wie möglich die gleichen Bauteile verwendet, jedoch mit 32 KByte RAM und 8 KByte EEPROM aufgemöbelt. Darüber habe ich eine Integrated Development Environment (IDE) zum Editieren, Assemblieren und Debuggen von 6502 Assembler Source Code entwickelt, siehe My-KIM-IDE.exe (braucht keine Installation). Mit dieser IDE kann der KIM-1 Nachbau auch im sogenannten TTY Mode betrieben werden (RS232 mit USB Adapter). Außerdem kann Microsoft BASIC in der Version 1.1 aus dem Jahr 1977 (KB9.BIN) geladen werden und die Programme können auf dem PC gespeichert werden.

Das Projekt ist im attached ZIP File vollständig dokumentiert, siehe das 60-seitige My_KIM.pdf Dokument.

Ben Eater 6502 Breadboard computer

A page on the Ben Eater 6502 Breadboard computer.

Ben Eater surprised us with his video hands-on series about a breadboard computer.

In many episodes, Ben showed how to build a very simple 6502 computer. Well explained, well executed. The result is a working computer!
You can either source the parts yourself or buy a complete kit from Ben Eater, see his website.
Make sure you buy quality breadboards.

The design is simple, and looks a lot like the early simple SBC’s on this site, and perhaps Grant’s 8-chip (or 7-chip) 6502 computer on breadboard was part of the inspiration.

tet

post

Ben Eater 6502 computer

Ben Eater surprised us with his video hands-on series about a breadboard computer.

In many episodes, Ben showed how to build a very simple 6502 computer. Well explained, well executed. The result is a working computer!
You can either source the parts yourself or buy a complete kit from Ben Eater, see his website.
Make sure you buy quality breadboards.

The design is simple, and looks a lot like the early simple SBC’s on this site, and perhaps Grant’s 8-chip (or 7-chip) 6502 computer on breadboard was part of the inspiration.

Ben does a fabulous series of YouTube videos about wiring together this 6502 breadboard computer.

It really is extremely interesting and educational. I strongly recommend you watch the video series and consider supporting Ben’s Patreon.

You can buy a kit from Ben. Ben has put a lot of work into making these educational videos — I suggest you support him and his future endeavours by buying his kits from him.

To play and have some fun: visit this web browser based emulator.
Now seeing him building this computer is a lot of fun, and many have done it. Do not pay attention to the grumpy old man at a certain 6502 related forum, the design and the build videos are fine and fit for beginners. It is a 1 MHz design, so no need for ultrafast logic IC’s.

Software

Ben limits software to simple examples, like how to show characters on the LCD or receive a charater via a bitbanged serial interface.
Below I present several ways to have the computer build on a PCB and let it do something useful, first an EHBasic one , the second a Tiny Pascal/assembler. Both require hardware additions.

Enhance Move the Ben Eater design to PCB

A breadboard computer is a nice start. Making it more permanent is a better solution once the experiments and modifications and additions are done and requires a PCB. And of the many appeared.

BenEaterPCB
First a simple and basic one. On the bolwire github page you find a nice designed PCB for the basic Ben Eater design. Nice features are the extra pins at 6502 and 65C22, which make testing easy. I have a PCB and plan to build the basic Ben Eater computer on it.




build by bolwire

PCB and EHBasic by mike42

Mike42 has published many blog entries on the 6502 computer he build, starting with a standard Ben Eater design on breadboard.
He then moved to a PCB design, added address decding and added software like the EHBasic interpreter from Lee Davison.
See the blog posts for a well explained and detailed Kicad design and EHBasic adaptation, some posts linked here. He also published on github his PCB design and sources and ROM binaries.

Adding a serial port to my 6502 computer


(I would advise to not use the WD65C51, but an older 65(C)51, since the WD part has a serious bug, and the trick to work with it wastes many CPU sycles.

6502 computer – from breadboard to PCB

Upgrades and improvements to my 6502 computer

G-Pascal for Ben Eater’s 6502 board

On-board assembler, tiny Pascal, and text editor for Ben Eater’s board.

Nick took the G-Pascal compiler for C64 and Apple II and enhanced it with assembler and line editor for the Ben Eater 6502 board.
To make the software fit in to the 32K ROM he made some hardware enhancements.

Ben Eater’s board suggested hardware modifications


Github with all software and documentation

Includes:

  • A 6502 assembler which lets you try out your assembler programming without having to keep removing the EEPROM chip and programming it externally. The assembler supports:
    • The documented WD65C02 instruction set, with all operand modes

    • Full expression evaluation of operands, with operator precedence, parentheses, bitwise operations and so on.

    • Relocation of the output to any memory address (ORG directive)

    • Support for debugging using breakpoints (BRK instruction)

    • Here is “hello world” in assembler:

            jmp begin   ; skip the message
      
      hello asciiz "Hello, world!"
      
      begin:
            lda #<hello
            ldx #>hello
            jsr print
            rts
      
    • Detailed notes about the assembler.

  • A “tiny” Pascal compiler (G-Pascal) which allows you to program the board in a high-level language. Whilst there are limitations in what can be done in a few KB of memory, the compiler supports:
    • CONST, VAR, FUNCTION and PROCEDURE declarations

    • Local declarations (functions and variables within functions, etc.)

    • Recursive function and procedure calls

    • Arithmetic: multiply, divide, add, subtract, modulus

    • Logical operations: and, or, shift left, shift right, exclusive or

    • INTEGER and CHAR data types. (Integer are 3 bytes and thus range from 8388607 to -8388608)

    • Arrays

    • Interface with any memory address by using the MEM and MEMC constructs (to peek and poke memory locations)

    • Built-in functions to write to the LCD display.

    • Built-in functions to do pinMode, digitalRead and digitalWrite, similar to the Arduino. These interface with any available ports on the VIA chip.

    • Here is “hello world” for the LCD display:

      begin
        lcdclear;
        lcdwrite ("Hello, world!")
      end.</code>

      And for the serial monitor:

      begin
        writeln ("Hello, world!")
      end.
    • Detailed notes about the compiler .

  • A text editor for keying in programs. It supports:
    • Loading and saving (via the RS232 interface)
    • Inserting and deleting lines
    • Find and replace
    • Detailed notes about the editor and how to load and save source.
    Available actions:
    
    List/SAve   line_number_range
    Delete      line_number_range
    Insert/LOad after_line
    Find        line_number_range /target/flags
    Replace     line_number_range /target/replacement/flags
    
    Help
    INfo
    Memory      first_address last_address
    Compile/Syntax/Assemble
    RUn/DEBug/Trace/RESume
    Poke/Jsr/JMp
    RECover
    (Actions may be abbreviated)
    (Flags: 'I'gnore case, 'G'lobal, 'Q'uiet)
  • Support functions, such as:
    • RS232 interface for connecting a “dumb” terminal, or a PC/Mac
    • Support for the LCD interface described in Ben’s videos
    • Other support functions for use by your assembler code, such as multiplication and division, CRC calculations, binary-to-decimal conversion
    • Support for NMI (non-maskable interrupts) so that you can recover from runaway code
    • Support for I2C communication for connecting to real-time clocks, port expanders, etc.
    • Support for SPI communication for connecting to port expanders, display boards and other devices.
    • There is over 9k of space available on the EEPROM to add your own functions (over 11k if you omit the CP437 character set from it)

Both the Pascal compiler and assembler are quite fast. Any program that will fit into memory will compile in a few seconds. For example, using a 1 MHz clock:

  • A 335-line assembler program testing all opcodes assembles in 5 seconds
  • A 651-line G-Pascal program (the Adventure game) compiles in 6 seconds

Junior Computer ][ update

I reported some time ago about a new based upon the Elektor Junior design, by Jörg Walke, the Junior Computer ][.

Junior Computer ][ Main board

In the meantime the Junior ][ has grown up. A Bus card and an Interface card with a lot of functionality has been designed by Jörg, the software has also been updated with EHBasic and much more.

More information on the Junior ][ Computer can be found on the Vintage computing forum of the German “VzEkC e.V” – a club dedicated to the preservation of old computers and on the Junior Computer][ page.
The design, Gerbers, software is on the website of  Jörg Walke.

Here the foreword by Jörg (the ‘I’ is Jörg!)

In May 1980 the DIY project Junior Computer was presented in the Elektor electronics magazine.
The little single-board computer was equipped with 1 KB ROM, in which the monitor program is located, 1 KB RAM (plus 128 bytes of RAM located in the 6532 RIOT), which, according to the authors, was more than enough at the time.

At the 40th anniversary of the computer, I decided to design a version with all features I wanted for the junior back in the 80s. The result is the Junior Computer ][ described here. It has 8KB ROM and a maximum of 128KB RAM. A additional serial RS232 interface and a simple sound output (as described in Junior Computer Book 2, from page 41) are also added. A 5V plug-in power supply with 2A should be sufficient. If external hardware needs to be supplied with voltage via the expansion connector, 3 Amps is recommended.

In order to be able to address the additional memory, the originally address decoding had to be extended. This is designed in such a way that the compatibility of the computer with the original Junior is preserved. An adaptation of the original monitor ROM to match the new memory location was not necessary.

Like its ancestor, the Junior Computer ][ can be expanded with external hardware via a 64-pin connection. The pin assignment oft he bus was largely retained.
In the new version, the 16 available port lines of the 6532 are available via 20-pin connector instead of a 31-pin connector.
The circuit changes mentioned here were made exclusively by me and expressly without the prior consent of the publisher Elektor, which is hopefully forgivable after 40 years. Of course, all rights to the original circuit design remain to Elektor and the authors.

Circuit diagrams, Gerber files, ROM images and other documents of the Junior Computer ][ (including this description) can be downloaded from https://old-computer-tech.net/downloads/ .

The computer and all its documents are published under the Creative Commons Attribution 4.0 license.

Junior Computer ][ Interface board

Junior ][ Main board

Junior ][ Interface Card

Junior ][ Backplane

 

post

KIM-1 Simulator simple demo

To test my new HDMI 4K USB Video Capture I made two videos. Simulator running on one notebook, the other notebook with the HDMI capture dongle recording with OBS Studio.

Simple program
[code]
0200 a9 cd LDA #$CD
0203 8D 00 03 STA $0300
0206 4C 00 1C JMP MONITOR ; KIM monitor

KIM-1 PAL-1 KIM CLone KIM MicroKIM Reproduction resources

This page is a Work in Progress since November 2022!

The clones of the KIM-1 that appeared the last years have renewed the interest of the retro scene.

Old software is restored or typed in again and adapted to the current use of serial terminal emulators and cross assemblers instead of the hardcopy Teletype interface and native assemblers of the old days.

This site contains a lot of that material already. There I have tried to collect all older original material.

Here a link of current websites with relevant material. As usual, a list of external links always will suffer of bitrot, so please report dead links!

Netzherpes, by Nills. Very active PAL-1 user. Lots of older software newly typed in.

KIM IEC, Dave McMurtrie’s 1541 Routines for the KIM-1

See also the Nachbau KIM-1 IEC/RAM card page.

SD card on PAL-1 https://github.com/ryaneroth/sdcard6502

https://www.youtube.com/@masterhit1/videos masterhit Nils

https://www.youtube.com/watch?v=CovNzC3jdGo KIM Venture

https://www.youtube.com/watch?v=d88M8gFSzWE startrek

https://github.com/w4jbm Jim McClahanan
https://www.youtube.com/@W4JBM/videos https://www.youtube.com/watch?v=UThleUTNTBM

PAL- stores/tkoak/
https://www.tindie.com/stores/tkoak/
http://pal.aibs.ws/support

Debug packages
1541
Lilbug
Basic games

Tiny Basic

https://github.com/GrantMeStrength/KIM1

Jim

https://github.com/w4jbm/PAL-1-6502-SBC

KIM-1 Computing Focal etc

KIM-1 Computing

PAL-1 Hacks
https://github.com/kaveenr/PAL-1-HACKS

https://netzherpes.de/
https://github.com/netzherpes
https://www.youtube.com/user/masterhit1
https://drive.google.com/drive/folders/1-S3AI-qszLDSes50MERtx1RNl9KefTs7

KIM IEC

https://commodore.international/kim-iec/

CC65 pathches
https://github.com/davepl/cc65

Jeff Tranter
https://github.com/jefftranter/6502/tree/master/asm/KIM-1

Discussion forum for PAL-1
https://groups.google.com/g/pal6502

twitter friends

@LiuGN PAL-1 desigenr/tindie
@masterhit netzherpes
@Devilish_Design (KIM-1 clone)
MOS KIM-1 Reproduction Kit https://www.ebay.co.uk/itm/225209469024

http://www.corshamtech.com/product-category/kim-1-products/

Bob Applegate Corsham Technologies
https://github.com/CorshamTech
http://www.corshamtech.com/product-category/kim-1-products/

CPM-65 and Elekterminal emulator

CPM-65, a CP/M-80 like operating system for 6502 based microcomputer

Dietrich Lausberg build a Junior long ago and expanded it to quite a system. He added hardware Elektor components, floppy and hard disk drives and wrote a CP/M inspired operating system, called CP/M-65. He still uses and maintains the system!

post

CPM-65 and Elekterminal emulator

CPM-65, a CP/M-80 analogue operating system for 6502 based microcomputer

Dietrich Lausberg build a Junior long ago and expanded it to quite a system. He added hardware Elektor components, floppy and hard disk drives and wrote a CP/M inspired operating system, called CP/M-65. He still uses and maintains the system!

All software is published on his github page Dietrich-L

System Requirements

  • 6502 processor
  • at least 12 kByte RAM
  • 6532 I/O chip for the system timer (could be replaced by a 6522 or other)
  • minimal 1 Floppy drive
  • Serial I/O

The system is a heavily modified and expanded Elektor Junior Computer. For system components and memory map see below.

System Structure
CPM-65 consists of 3 layers:

  • BIOS Basic I/O system – currently 3 kB, could be reduced to 2kB by removing SCSI and I2C drivers. Drives can be A-H non consecutive.
  • BDOS Basic disc operating system – this is the CPM-65 kernal. Size 2 kB
  • CCP Console command program – a simple console which only allows to invoke CPM-65 programs. No resident commands. Size 1 kB

File and Disc Format
Filenames are CP/M-style d:filename.ext with d
Programs must have .COM as extension and are loaded to $0200 and started there.

The directory structure is CP/M-compatible and can be read with appropriate tools like CPMTOOLS

The Disc format is typically 40 tracks/ 8 sectors/ 256 byte/sector. It is defined in the BIOS. The BDOS operates on sector numbers. Maximum sector number is $800 blocks with $20 sectors = 65536 sectors á 256 bytes = 16 MBytes

Software List of CPM-65

Name		Version
ALLOC		2.8
ASM	        2.5
BASIC		1.4
BDOS		2.2
BIOS		3.0
BOOT		1.7
BOOTPROM	3.0
BROWSE		1.0
CCP	        1.5
COPY            1.4
D	        2.0
DATETIME	1.1
DEBUG		1.5
DRUCKER		1.0
DUTIL		1.5
EPROMMER	1.2
ERASE		1.5
FORMAT		2.4
FORTH		1.6a
HEXMON		1.1
I2C-UTIL	1.2
RENAME		1.1
RFILE		1.1
SCSIMGR		1.1
STEP		1.0a
SUPERTAP	1.4
SYS 		1.5
SYSGEN		1.0
TYPE		1.6
XMODEM		1.2

Programming

Available software (all written by Dietrich Lausberg)

  • Basic interpreter
  • Forth interpreter
  • Assembler for 6502

All software is supplied as assembler files to be assembled with the CPM-65 assembler.

Hardware

Dietrich Lausberg’s system now has:

  • Base Junior
  • Interface card
  • 64k Universal Memorycard
  • 8k RAM/EPROM card
  • Universal Disk Controller (Elektor Computing 6) for HD SCSI disk (SD card) and floppy disk
  • EPROMmer
  • Elekterminal

Modifications made to Elektor cards

  • The Junior basecard was mapped to 1K RAM $E000-$E3FF, RIOT at $F600-$F7FF, EPROM was converted to a 2716 and is at $F800-$FFFF
  • The Interface card is mapped 1K RAM at $E400-$E7FF, 2K RAM (6116 replacing a 2716) at $E800-$EFFF, the VIA 6522 at $F800-$F9FF.
    The tape interface is removed.
  • The 64k RAM card from Elektor 83/3-60 (Universelle Speicherkarte) with 48 k RAM (6 x 6264) is mapped to $0000 – $BFFF.
    The card has a modification, which allows the Elektor EPROMMER to take over $B000-$BFFF when present on the bus
  • The 8K RAM-EPROM card was modified to 4 x 6116 at $C000-$DFFF, 1K RAM $F000-$F3FF

All modifications in the adressing were done with the existing glue logic. I know, its a bit convoluted, but it has evolved over time – actually the last change is from 2021. The system works very stable. So the mapping does not violate the 6502 timing requrements.

The target always was to have as much consecutive RAM from zero page to HIMEM as possible. This is a bit CP/M style and makes it easy for the software to use as much RAM as it can grab until the CCP is met (cwhich is currently at $D800). CPM-65 has up to 53 kB transient memory. The largest program is BASIC, which easily assembles in the RAM to a 10 kB program with 26K to spare. Basic then has 45247 Bytes free.

Drives

  • A: and B:  2 x BASF 6108 40 Tracks double density
  • C:  Gotek with Flashfloppy V3.32 from Keir Fraser emulating another 40 tracks DD drive
  • E: and F: SCSI drive SCSI2SD V5.1 by Michael McMaster configured to emulate 2 x 16 MB harddiscs

Serial interface
Serial 1200 – 9600 Baud TTY to ELEKTERMINAL (1200 Baud) or Terminal emulator (600 Baud). As emulator TeraTerm is ued especially for file transfer via Xmodem or a a self-written ELEKTERMINAL emulator. The emulator is necessary, because some of the software, most notably the FORTH screen editor needs the very specific ELEKTERMINAL control codes.

TTY9600 Elekterminal Emulator

This program emulates the ELEKTERMINAL published by the magazine ELEKTOR in November/December 1978.

All software is published on his github page Dietrich-L

The program is written in Free Pascal and compiles in the LAZARUS PASCAL environment. The TTY5.EXE is verified to work under Windows 10 64 bit. No installation is needed, just invoke TTY5

Commands

   alt-B - Baudrate                      alt-I - info
   alt-C - COM-Port
   alt-H - help
   alt-D - debug
   alt-X - exit

Fixed parameters:

	word length = 8       
	stop bits = 1
	parity bit = none
	flow = no     

These parameters can be changed in the source code only.

ELEKTERMINAL commands
The ELEKTERMINAL uses the SF.F 96364 CRT Controller and some glue logic. The terminal displays 16 lines with 64 characters and interprets some ASCII command codes

Code 	Function
$08	Cursor <--
$09	Cursor -->
$0A	Cursor down
$0B	Cursor up
$0C	Home cursor + clear screen
$0D	Carriage Return
$1A	Clear current line
$1C	Home Cursor
$1D	Cursor to begin of line

Elektor books Junior and Computing

Added to the Elektor book pages:
– Junior Book 1 Francais
– Elektor Computing German 1-6

KIM-1 Enhancement PROM

This source for an enhancement of the KIM-1 contains Jim Butterfield’s Supertape and some other utilities and code.
The PROM is to be placed on top of memory, it contains the RESET/NMI/IRQ vectors.
The source listing for a PROM designed to enhance the KIM-1.
Written by René Vega of Detroit in September 1976. From the archives of Peter Jennings.

;	THE FOLLOWING ROUTINES MAY BE ENTERED VIA THE
;	"GO" KEY ON THE KEYPAD.
;
;	FC00 - SUPRTP - KIM CASSETTE HIGH SPEED DUMP.
;	FE3B - COMPTP - ROUTINE TO COMPARE A KIM FORMAT
;			CASSETTE WITH CONTENTS OF MEMORY.
;	FE46 - VIEWTP - ROUTINE TO LOOK AT A KIM FORMAT
;			CASSETTE WITHOUT ALTERING MEMORY.
;	FE4F - LOADTP - ROUTINE TO LOAD A BLOCK IN KIM
;			AUDIO CASSETTE FORMAT.
;	FCEA - LDSYS  - ROUTINE TO LOAD MULTIPLE BLOCKS
;			INTO MEMORY REGARDLESS OF THE ID
;			NUMBERS ON THE TAPE. UPON LOADING A
;			BLOCK THAT BEGINS AT $EF, THE
;			ROUTINE JUMPS TO ($EF).