post

Ruud Baltissen: Build a KIM-1

Ruud Baltissen started the whole KIM-1 Replica world by publishing a page many years ago about Building a KIM-1
All replica’s, from the MICROKIM to the Nachbau followed his design.

Replicated here the are relevant text and schematics by Ruud.

Build a KIM-1

The goal of this project is to rebuild the KIM-1. This isn’t “Just take the schematic of the KIM and go ahead!”. The KIM-1 uses two 6530s that are custom ICs and therefore cannot be bought in any shop. This project uses replacement parts.
The troubleshooter: 6530
As said, the KIM-1 has two 6530s on board. For more info about this IC, please read about the 6530 here. Anybody who is a little bit familiar with the hardware market can tell you that you cannot buy the 6530 as a regular part. And the 6530 is a custom IC: Commodore made various types but all were branded 6530. For example, the 6530 found in the CBM 4040 drive is different from the ones of the KIM. Even the two 6530s of the KIM itself are different: in this case it is the content of the builtin ROM.
Happily enough there is another IC available that can be used as replacement: the 6532.

The 6532 has 16 I/O lines, an internal timer and 128 bytes of RAM onboard, but no ROM. For this project we’ll use an external EPROM as replacement. The pin out of the 6532 is completely different but that should not be a problem.
Another difference is that a 6532 has pin PB6 available where a 6530 hasn’t. See it as a bonus as I haven’t found any reason how it could jeopardize our project.
The 6530 can generate a IRQ but in case of the KIM-1 this feature isn’t used. The main reason is that pin PA7 is needed to output the signal and it is used for other things. The 6532 has a separate IRQ output. I used two jumpers, J54 and J5, to enable someone to use this function if needed.
The last and major difference however lays in the way the registers are selected:

function:       RS:  A6:  A5:  A4:  A3:  A2:  A1:  A0:  R/W: 
                                                            
RAM              0    x    x    x    x    x    x    x    x   
                                                            
DRA              1    x    x    x    x    0    0    0    x     A
DDRA             1    x    x    x    x    0    0    1    x     B
DRB              1    x    x    x    x    0    1    0    x     C
DDRB             1    x    x    x    x    0    1    1    x     D
                                                            
PA7, IRQ off,                                               
      neg edge   1    x    x    0    x    1    0    0    0     F
PA7, IRQ off,                                               
      pos edge   1    x    x    0    x    1    0    1    0     G
PA7, IRQ on,                                                
      neg edge   1    x    x    0    x    1    1    0    0     H
PA7, IRQ on,                                                
      pos edge   1    x    x    0    x    1    1    1    0     I
                                                            
read interrupt                                              
       flag      1    x    x    x    x    1    x    1    1     E
                                                            
read timer,                                                 
       IRQ off   1    x    x    x    0    1    x    0    1     J
read timer,                                                 
       IRQ on    1    x    x    x    1    1    x    0    1     K
                                                            
Clock / 1,                                                  
       IRQ off   1    x    x    1    0    1    0    0    0     L
Clock / 8,                                                  
       IRQ off   1    x    x    1    0    1    0    1    0     M
Clock / 64,                                                 
       IRQ off   1    x    x    1    0    1    1    0    0     N
Clock / 1024,                                               
       IRQ off   1    x    x    1    0    1    1    1    0     O
                                                            
Clock / 1,                                                  
       IRQ on    1    x    x    1    1    1    0    0    0     P
Clock / 8,                                                  
       IRQ on    1    x    x    1    1    1    0    1    0     R
Clock / 64,                                                 
       IRQ on    1    x    x    1    1    1    1    0    0     S
Clock / 1024,                                               
       IRQ on    1    x    x    1    1    1    1    1    0     T

In total 5 address lines are used, meaning 32 registers. But 11 of the 19 registers have one or more mirrors.

Read:          J E J E         K E K E         J E J E         K E K E 
Write:         F G H I         F G H I         L M N O         P R S T 
R/W:           A B C D         A B C D         A B C D         A B C D         

As we can see, the last 16 registers equal the 16 of the 6530 itself. So now we have to develop some logic which will do the following:

  • The I/O of the 6532 is only visible within a range of 64 bytes
  • The first 16 bytes represent register 16 to 31
  • The next 48 bytes are mirrors of the first 16
  • Only 64 bytes of RAM are used

Conclusion:

  • Input A6 won’t be used and can be tied to GND
  • Input A4 is connected to address line A4 of the 6502 via a NAND gate.
  • The second input of that NAND gate is connected to the /CS2 input.
    The idea behind this is simple: The moment that the I/O part of the 6532 is selected, the NAND gate outputs a (H) thus selecting the wanted last 16 registers. If needed, the user can select the other 16 registers as well by connecting the second input of the NAND gate to +5V.
  • A 74LS138 enables the /RS and /CS2 lines at the right moment.

ROM and RAM
Here we have a luxury problem. We only need 2K of (EP)ROM like the 2716. The problem is that the 2716 is hard to find and more expensive then the 2764 or its bigger brothers. When we use a bigger EPROM we could tie the unused address lines to GND.
The same problem occurs with the RAM. In this case I have chosen for a 62256, a 32 KB RAM. This looks like a massive overkill but see later.
If we have to use bigger RAMs or EPROMs anyway, it is quite easy to use other parts of that chip by OR wiring the CS line with more Kx outputs of the main 74145. In case of the EPROM we also can connect switches to the surplus address lines and have the advantage of a multi-KERNAL system.

Extra address range
KIM-1 only supported an address range of 8 KB in the first place. The pin DECEN at the Userport can be used to extend that range but HAS to be connected to GND for the original configuration. The idea is that external cards can use this input to alter the range.
I added an extra 74145, IC7, and two jumpers that enable the user to make a more efficient use of the hardware. Both jumpers, J2 and J3, have to be closed to start with.
If you don’t want to use the 74145 at all, only close jumper J1.

The first thing one can do is to let the binary start at address $F800. Your self built KIM will still behave as usual. Now you can add your own RAM from address $0000 on up to $E000 and the only thing you have to do is remove jumper J2.
If you are only interested in adding RAM, a better idea is to use the original one, IC4, the 62256 32 KB RAM. You only have to remove the jumpers J13..17 and to close one or more pair of pins of jumper block J18. By closing all four pair of pins you make use of the full 32 KB.
Jumper J3 is only needed if you want to expand your self built KIM even further and want to use, for example, the $E000/$FFFF range for (EP)ROM.

Schematics of the new KIM-1

What are the major differences with the original schematic?

  • Replacement of the 6530s by 6532s.
  • Addition of two NAND gates to handle the 6532s.
  • Addition of an EPROM.
  • Replacement of the 6108 RAM ICs by a 62256 or equivalent 32K*8 SRAM.
  • Addition of a 74LS138 to decode the RAM and I/O of the 6532s.
  • The resistor for K6 has been dropped.
  • Addition of jumpers to enable the combination of other K lines.
post

KIM-1 replica keyboard

Construction of a nearly exact KIM-1 replica keyboard.

Original version: Design, images and original text in German by Ralf (ralf02, forum64.de), from the KIM-1 Aufbau anleitung, and KIM-1 Keypad by user hackup, October 30, 2022 on thingiverse

Circuit diagram of the Keyboard PCB

For the keyboard construction you need the following parts:

  • 1 3D printed keyboard frame, STL from thingiverse
  • 2 keypads with 16 keys each as shown (actually, you just need 1 1/2)
  • 1 keypad PCB, see the gerber file
  • 1 SPDT slide switch, 2.54mm pitch
  • 1 female pinheader connector, 15 pins, preferably low profile
  • 1 male pinheader, 15 pins to match the female one
  • 6 self tapping screws, 2x6mm
  • labels printed white on black for the keys E, F, AD, DA, PC, +, GO, ST, RS
  • double sided adhesive tape to glue the clips to the motherboard

The keyboard PCB has to be gold plated (ENIG). With tin-plated PCBs the contact from the keys is not reliable.

Downloads made available by Ralf:

First dismantle the two keyboards and cut the two rubber contact mats as seen in the next picture. Keys 0-0 and A-D have the right lettering, make the other with a letter printer white on black.

Place the keycaps in the 3D printed case:

Now solder the slide switch and the pinheader on the PCB. Cut the rubber mat on the location of the slide swithc. Put the mat in the 3d printed case and fix with 6 screws:

Next place the four M3 screws in the holes in the PCB and the parts in the case. Now place the PCB on the 1 pin pinheader and fix the four screws with washers from the bottom.



The two reds are only for decoration, to make it look like as on the KIM-1.

Next photos credit to Bigby (of forum64.de):

post

Nachbau eines KIM-1

Ralf (Ralf02, forum64.de) started a thread on the forum64 called Instandsetzung und Nachbau eines Kim-1 in March 2022. 99 pages of designs and discussions and contributions by many in the thread delivered a working KIM-1 that is closer to the original KIM-1 than any KIM-1 replica designed. A great achievement and a well deserved compliment to Ralf and the thread authors!

The work of Ralf is not limited to the KIM-1 replica itself. He also designed a KIM I/O module and a 1541 IEC/RAM/ROM module.
Noteworthy is the replica of the KIM-1 keypad.

On the following pages these boards are introduced.

The most current version of the ‘Nachbau’ is on the formu64.de thread.

KIM-1 Replika

Colin Wolf (C. W. (chefkoch) ) posted a thread in 2021 on mikrocontroler.net showing a KIM-1 Replika he had build.
A KIM-1 with the dimensions and layout of the original KIM-1! OF course he used 6532 instead of the 6530-002 and -003, so a ROM was needed. To preserve the layout, this ROM was hidden as daughterboard on the back. The daughterboard also has the extra decoding circuit required for the 6532s. A very elegant solution!

He showed these photos on the post:
Read here more about the design and more photos by Wolfgang Robel.

KIM-1 Replika

Colin Wolf (C. W. (chefkoch) ) posted a thread in 2021 on mikrocontroller.net showing a KIM-1 Replika he had build.
A KIM-1 with the dimensions and layout of the original KIM-1! OF course he used 6532 instead of the 6530-002 and -003, so a ROM was needed. To preserve the layout, this ROM was hidden as daughterboard on the back. The daughterboard also has the extra decoding circuit required for the 6532s. A very elegant solution!

The text by Colin on the post:
Hallo *,

wie bereits in dem Thread Beitrag “Fotos KIM-1 rev. F oder G”
angekündigt war ich dabei einen KIM-1 nachzubauen. Nach einigen
lehrreichen Stunden CAD-Fleißarbeit ist es nun vollbracht.

Es lebt!

Die beiden 6530 wurden durch 6532 ersetzt. Für die Umkodierung wurde der
Vorschlag unter
http://retro.hansotten.nl/6502-sbc/6530-6532/kim-1-6530-replacement/
benutzt und als Huckepackplatine realisiert. Der komplette
Funktionsumfang mit Audio- und Fernschreiberinterface ist also
vorhanden.

I have received the circuit diagrams in PDF format and publish here with permission by Colin Wolf:
KIM-1 Circuit diagram
Daugther board

He showed these photos on the post:


Wolfgang Robel build a KIM-1 Replika with PCBs from Coloin Wolf. On his website he shows the build process and the working end result.

Photos reproduced here with permission from Wolfgang Robel. As you can see the end result is great, though he had to deal with broken 6532s from China and broken 2102 SRAM ICs.































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.
Read here about the KIM computer which 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




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