KIM-1

This pages describes the first Commodore computer, the KIM-1.



DISCLAIMER

  • All names with a copyright are acknowledged.
  • Some information is derived from deduction after reading a lot of documents and can be unreliable due to the lack of real proof.
  • If the reader uses information from this document to write software or build hardware, then it is on his own account. I cannot be held responsible for blowing up your computer, mother-in-law or whatever; it will always be your own fault.
  • I'm not a sexist, with 'he' and 'him' I also mean 'she' and 'her'.


Copyrights

    This page may contain material that is not mine. But the policy of TULIP, the owner of the rights of Commodore, is that they don't mind as long as it is not commercial.
    So you may copy every bit on this page for NON-commercial use but, regarding the above, I won't take any responsibility. I hope you enjoy it. If you use it, just give me at least some credit like "Stolen from Ruud" :-)




What is the KIM-1?
The KIM-1 is the first computer developed by Commodore, or better, MOS. MOS was an IC producing factory that Commodore took over to be sure of a constant supply of ICs. Commodore produced calculators before but I don't consider a calculator as a computer as long as you cannot program it. The KIM-1 has 1152 bytes of RAM, 2048 bytes of ROM and 30 I/O-lines. Some of these lines are used to steer six 7-segment LED-displays and others are used to read the little hexadecimal keyboard.
The manuals state that the KIM-1 can be connected to a serial teletyper/teleprinter in full duplex mode. The KIM-1 has the capability to adjust automatically for a wide variety of data rates. (10 CPS, 15 CPS, 30 CPS etc...) The Kim-1 is originally developed to be connected to these teletypers by means of two current-loop-connections. The used current may be 20 or 60 mA. But I can imagine that nowadays these teletypers are very hard to find. A small manual named "KIM-1 HINTS" gives us a solution in the form of a little circuit which enables you to connect a teletyper with a RS232-interface. I can hear you think: "I don't have a RS232-teletyper either!". IMHO any PC equipped with a RS232 interface and a program like PROCOMM or KERMIT should do. And what about a C64 with NOVATERM?
A computer without the possibility to load or store programs is no good at all. The KIM-1 has the ability to load and store programs on paper tape and/or cassette recorder. As papertapereaders/punchers are hard to find as well, I think the average KIM-owner is limited to the recorder.


The hardware
The well known 6502 is the heart of the KIM-1 and doesn't need any further explanation.

The 1K of RAM is realised by using eight 6102s. The 6102 is the MOS-equivalent of the 2102 which is a 1K*1 RAM.

The 6530 is a different and quite complicated story. This IC contains 64 bytes of RAM, 1024 bytes of ROM, a timer and 16 I/O-lines. For more information I advise you to read this document.

A closer look at the schematic will reveal that only 8 KB is decoded by a 74145, 4-to-10-multiplexer. This means that the whole configuration is mirrored another 7 times within the 64 KB boundary.
Within the 8 KB-boundary the system looks like this:

K0   $0000 - $03FF    1024 bytes of RAM (8*6102)
K1   $0400 - $07FF    free
K2   $0800 - $0BFF    free
K3   $0C00 - $0FFF    free
K4   $1000 - $13FF    free
K5   $1400 - $16FF    free
     $1700 - $173F    I/O, timer of 6530-003
     $1740 - $177F    I/O, timer of 6530-002
     $1780 - $17BF    64 bytes RAM of 6530-003
     $17C0 - $17FF    64 bytes RAM of 6530-002
K6   $1800 - $1BFF    1024 bytes ROM of 6530-003
K7   $1C00 - $1FFF    1024 bytes ROM of 6530-002

K0..K7 = outputline of 74145
The schematics are without the power supply or the power connector. The fact is that you have to provide your own PS that you have to connect to the applicationport. As you can see there are a lot of switches. With one exception they represent the keys. Unfortunately UltiCap denies me to name them after their real names, so I simply called them K1..K25:
        K0  = RS   = Reset
        K1  = ST   = Step

        K2  = 0
              ...
        K11 = 9

        K12 = A
              ...
        K17 = F
 
        K18 = AD   = Addressmode
        K19 = DA   = Datamode
        K20 = +    = Increment address
        K21 = GO   = Execute program
        K22 = PC   = Program Counter
        K23 = SST  = Single Step mode  (real switch)
Notice the way how the I/O- and RAM-areas are arranged within the area $1400-$17FF. If you study the schematics, you won't find any logic that takes care of it; this is done inside the 6530. Even if you forget the internal ROM for a moment, it means that you cannot exchange the 6530s with each other like for example the 6526 CIAs in a C64.
As you can see there is one undefined area (not mentioned at all in any manual): $1400 - $16FF. Exploring my KIM I found out that this area is free. You also can see that each I/O-area is 64 bytes big. In these cases there exist three mirrors of each I/O-area.

All the DOUT-lines (Data OUT) of the RAM-ICs are buffered by a tristate buffer, 74125. The schematic reveals that the RAMs do have a CS-line but as I don't have any information about these ICs, I cannot explain the extra use of these 74125-buffers.

The Reset- and NMI-input can be triggered by the user by means of a switch. A 556 takes care of debouncing both switches.

The KIM-1 can be switched to the Single Step Mode. The 6502 generates a (H) at the SYNC-output every time it fetches an opcode. This signal is used to generate a NMI. On its turn the NMI-routine interrupts the momentary program and does its job. In this case it means it runs after the executing of every single machinecode. This enables the user to see the contents of several registers, including the flags, after each step checking if they contain the value as he expected them to have. If it is the wrong value then there could be a flaw in his theory, program or even hardware.
It is obvious that the part of the KERNAL that contains the NMI-routine has to be masked out. Otherwise every opcode of this routine will trigger the NMI on its turn, causing the 6502 to start-up another NMI-routine etc... This is prevented by masking out the upper half of the ROM-area by means of a 7401. This also means we cannot single-step in this area but I only can say that we have to give the programmers of the KIM at least some credit :-)

The display and keyboard
PA0..PA6, PB1..PB4 and a 74145 are used to decode the keyboard and to activate the display. Outputs 0..2 of the 74145 control the rows of the keyboard. PA0..PA6 read the columns. When a key is pushed, and the right row is probed, then the corresponding input of port A is driven (L).
Outputs 4..9 control which one of the six 7-segments-displays will be activated by means of a transistor. PA0..PA6, now functioning in the outputmode, control which segments of that display will light up.

Connecting a cassette recorder
You can connect a normal cassette recorder to the KIM ( NO C= datasette!). A bit is stored as small beep of a certain frequency. To store a '0' the KIM stores 6 pulses 414 uSec (top-top) on tape. To store a '1' it stores 9 pulses of 276 uSec. (or ~2415 Hz / ~3650 Hz). The KIM generates the pulses himself. A simple RC-network smoothens the shapes of the pulses a little bit. To read the data the received signal first goes through a Phase-Locked-Loop circuit. This circuit measures the frequency and informs the KIM about it with sending a (L) or (H) to input PB7.

Connecting a terminal
As mentioned, you can connect a terminal to the KIM with its onboard serial interface. The source code revealed it must be one using 7 bits and no parity. The baudrate is detected by the KIM itself but I can imagine there has to be a lower- and upperlimit to the baudrate it can work with. The serial interface is of the 'current loop' type. This means that not the voltagelevel of a line defines whether a '0' or '1' is transmitted (like RS232), but if there is a current or not flowing through the circuit.
'Current loop' is often used in an industrial environment. The current is used to activate a LED inside an optocoupler that on its turn addresses the receiving device. The advantage of this system is galvanic de-coupling: seen from a electric point of view the devices aren't connected together. Electronic noise in one circuit cannot disturb another circuit.
The KIM does not use an optocoupler to detect the current. In this case the current activates a transistor which on its turn activates PA7 via a NAND-gate. This gate can be used to block the input.
The originator of a signal has also to supply the current. The KIM does simply use a resistor to limit the current. A NAND-gate with an open collector output takes care of closing or not closing the circuit. A line from the input takes care of the fact that the NAND only operates when there is no inputsignal. In this way only a half-duplex communication is possible.


The original manuals
I own an KIM-1 rev. D with the Commodore logo on it and also have the original manuals. With the exception of one, I scanned them to make them available in electronic format:


Source codes of the ROM
Available here. Because the original listings provided little, and even confusing information, I provided my own as well.


Building your own KIM-1
Can this be done? I think: YES! Why build such an old computer? Ask the guys who still fly in those WW1-planes: because it's fun!. Enough talk: read this document!



You can email me here.


[Homepage]