RRIOT testing Breadboard Test for 6530-002

This article is written by Jeff M. Nay, about his experiments to restore a KIM-1 to working order, testing the 6530-002 RRIOT with his own KIM-1.
The challenge was to address the second 6530-002 in this setup at another address then the onboard 6530-002 RRIOT.
The experiment was a success, the 6530-002 is indeed in a bad state, the ROM is corrupt and it had to be replaced.

The KIM-1, from a friend, was in a bad state. The repair was a success also. He was able to get this old KIM-1 working again, after only having to replace, the 6502 CPU, the 6530-002 RRIOT Chip with a Corsham 6530 Replacement board, all 8 Memory Chips and the U17 7406 inverter.

Read more in the group: KIM-1 – Google Groups

Breadboard Test for 6530-002

Attach Breadboard to working KIM-1, using Expansion Port and using K4 and K2 from Application Port (Corsham Application Board)
NOTE: Turn all SW1 switches on CORSHAM Board Off (Or data will repeat at K1,K2,K3,K4)

I started by wiring the data lines on the 6530 to the expansion board pins 15-8.
Then the address lines to pins A-L.
Now it is just a matter of wiring the control lines correctly.

  • I have phase 2, pin 3 of the 6530 going to pin U of the Expansion board (Yellow)
  • I have pin 4 (RSO) of the 6530 going to (K4) of my Corsham Application Board – (Don’t forget pull up resistor) (Blue)
  • I have RES pin 16 of the 6530 wired to pin 7 (RST) of the Expansion board
  • I have pin 18, (CS1) on the 6530. Going to (K2) of my Corsham Application Board – (Don’t forget pull up resistor) (White)
  • I have Power going to pin 20 and Gnd going to pin 1

You should be able to read ROM at $1000

Looking below at the data sheet, where the address of the I/O and RAM are determined by A9-A6. This means it is not hard set for $1700 or $1740.
K5 ($1400) + A9-A6 determines where the IO of both 6530s will start and end.

I ended up using K2, which starts at $0800 + A9-A6 means my I/O registers should start at $0B40 for the 6530-002 or $0B00 for the 6530-003
I also use K4 for the ROM section of the 6530-002 which starts the ROM section at $1000


Onboard 6530s
6530-003

A9+A8 = 1100000000 = 300H to 1100111111 = 33FH
(K5) $1400+$300 Start the IO for 6530-003 at $1700.
(K5) $1400+$33F End the IO for 6530-003 at $173F

6530-002

A9+A8+A6 =1101000000=340H to 1101111111=37FH
(K5) $1400+$340 Start the IO for 6530-002 at $1740
(k5) $1400+$37F End the IO for 6530-002 at $177F

Bread Board 6530-002
6530-003

A9+A8=1100000000 =300H to 1100111111=33FH
(K2) $0800+$300 Start the IO for 6530-003 at $0B00.
(K2) $1400+$33F End the IO for 6530-003 at $0B3F

6530-002

A9+A8+A6=1101000000=340H to 1101111111=37FH
(K2) $1400+$340 Start the IO for 6530-002 at $0B40
(K2) $1400+$37F End the IO for 6530-002 at $0B7F


This is the ROM of 6530-002 breadboard being accessed at $1000 (85)

The now working KIM-1:

 

post

Books for the 6502: KIM-1 and more

KIM-1, AIM-65, SYM-1 and other 6502/65C02/65C816 related books.

A mix of English, German and Dutch books.

On my bookshelf I have quite a collection of books on the 6502 family.

Note that manuals and books that come with systems are shown on the pages of the corresponding system!

Microprocessor Systems Engineering
R.C. Camp, T.A. Smay, C.J. Triska
AIM 65 System 65 parts
6502 Software Gourmet Guide and Cookbook
6502 Users Manual
AIM 65 Laboratory Manual And Study Guide
Anwendunsgbeispiele fûr den Microprozessor 6502
Microprocessor_Fundamentals KIM-1
Best of Micro Volume 1 1978
Best of Micro Volume 2 1979
Best of MICRO 3, AIM 65 SYM-1 KIM-1 part June 1979 May 1980
Compute’s Machine Language for Beginners
Compute’s The Second Book of Machine Language
Programming a Microcomputer 6502
Programmieren von Mikrocomputern CPU 6502 (Skriptum)
How to Build a Microcomputer .. and really Understand It!
Mikrocomputer ohne Ballast
Micro Principles KIM-1 user guide chapter 8
Digitaalschakelen met de KIM-1
6502 Assembly Language Programming
6502 Programmieren in ASSEMBLER
Microcomputer Experimentation with the MOS Technology KIM-1
6502 Machinetaal Subroutines
6502 Assembly Language Subroutines
Microcomputer experimentation with the AIM 65
Machine Language Programming Cookbook part 1
Machine Code for Beginners
Microcomputer Systems Principles Featuring the 6502 KIM
Beyond Games: System Software for your 6502 Personal Computer
Assembly Language Programming
Using 6502 Assembly Language
6502 Machine Code for Humans
Programming the 65816 including the 6502, 65C02 and the 65802
Programming the 65816 including the 6502, 65C02 and the 65802
Forth Programming
Programming the 65816
Programming and Interfacing the 6502 with Experiments
Synertek 1981-1982 Data Catalog
Synertek DataBook 1983
Third Book of OSI
TSC 6502 Games Package 1
TV Typewriter Cookbook
Zaks 6502 Anwendungen
6502 Games
6502 Applications
Advanced 6502 Programming
Fortgeschrittene 6502 Programmierung
Programmierung des 6502
Programming the 6502
6502 Applications book
Programmeren van de 6502
Microprocessor Interfacing Techniques
Microprocessor Concepts and Applications
Publisher: Lab-Volt
6502 Assembler-Kurs für Beginner
6502 Machine Code For Beginners
A low-lvel language for use on the MOS 6502 Microcomputer
6502 Microcomputer Programmierung
Programmieren in Maschinensprache 6502
The Giant Handbook of Computer Projects
First Book of KIM
The First Book of KIM-1 in PDF format
The First Book of KIM-1, part in text format
The First Book of KIM-1 in HTML format
Sources of The First Book of KIM-1 in source and papertape format, Jeff Tranter
First Book of KIM-1 for SYM-1
Rockwell Produktübersicht in deutsch
Rockwell Microelectronic Data Devices Catalog 1979
1981 Rockwell Electronic Devices Division Data Book
1984 Rockwell Data Book
1985 Rockwell Data Book
1987 Rockwell Controller Products Databook

Commodore Chessmate: a 6530 computer

The Chessmate is a 6530 – KIM-1 like computer. Keyboard, LED display are used as in the KIM-1. Peter Jennings, who designed this chess computer with Commodore, build upon his Microchess 1. from the KIM-1, and used the extra ROM space to enhance it to Microchess 1.5: more chess features, a chess clock, sounds, dedicated keys, status LEDs.

The 6530-024 delivers the I/O and timer and RAM used by the Chessmate, the RRIOT ROM is not used by the main ROM. The dumped ROM of the 6530 (see below) contains no recognizable data or program,

It will not be that difficult to ‘clone’ this chess computer with the information here. A 6532 can easily take the role of the 6530. A 6502 instead of a 6504, same SRAM< a 2732 or similar ROM. The ROMs  are dumped, both for an Chessmate and a Novag Chess Champion MK I

Schematic, user manual, dumped ROMs here.

Commodore Chessmate: 6530-024 RRIOT

The Chessmate is a 6530 – KIM-1 like computer. Keyboard, LED display are used as in the KIM-1. Peter Jennings, who designed this chess computer with Commodore, build upon his Microchess 1. from the KIM-1, and used the extra ROM space to enhance it to Microchess 1.5: more chess features, a chess clock, sounds, dedicated keys, status LEDs.

The 6530-024 delivers the I/O and timer and RAM used by the Chessmate, the RRIOT ROM is used by the main ROM as a Chess openings book.

It will not be that difficult to ‘clone’ this chess computer with the information here. A 6532 can easily take the role of the 6530. A 6502 instead of a 6504, some SRAM, a 2732 or similar ROM. The ROMs are dumped, see below.

On this page:

My Chessmate


Technical specifications

  • MOS MPS 6504 1 MHz 4 KB ROM 320 bytes RAM total
  • 6530-0024 RRIOT (of which I/O lines, timer and 64 bytes RAM are used, ROM has data as chess openings book
  • 256 SRAM (2x 2111)
  • 4K ROM (6332), early models have 2x 2K ROMs
  • Display: Four 7 Segment LED type (which indicates either the move or the time)
  • 19 membrane keys
  • LEDs for Check, Chessmate, or whether the computer is playing black or white
  • Eight skill levels
  • Piezo loudspeaker for 14 Electronic sounds
  • Built-in chess clock
  • The computer has 32 International standard openings in its memory and tries to follow them for 16 moves
  • Chessmate plays black or white
  • Can verify position of pieces at any stage of the game
  • En passant and castling
  • Playing strength (DWZ/ELO): ca. 1050

Related, identical specifications and hardware, and the same software, images below:

  • Novag Chess Champion MK II (A)
  • Novag Chess Champion MK II (B)
  • TEC Schachcomputer

Memory map (deduced from disassembled source and hardware schematic, note that for the 6504 this is collapsed to the smaller address space 0000-1FFF. The software is written for the 6502 though!
$0000 – $01FF RAM 256 bytes, stack and zeropage mirrored
$8B00 – RRIOT I/O
$8B80 – RRIOT RAM 64 byte
$8C00 – $8FFF RRIOT ROM
$F000 – $FFFF Main ROM

Manuals and ROM dumps

Commodore Chessmate manual
Another Commodore Chessmate manual
ROMs of early Commodore Chessmate, in two 2K parts
and later main 4k ROM and the 630 024 RRIOT ROM
ROMs of Novag Chess Champion MK II
(Main 4k ROM and 630 024 RRIOT ROM, identical to Commodore ROMs!
Novag Chess Champion MKII manual
Partially commented source by me of the ROM of the Chessmate


Notes on the 6530 024 RRIOT

Michael Gardi helped me discover the following about the use of the RRIOT in the Chessmate, comments added to the source:
1. The timer is used for the random selection of openings.
CKINT = $8B0E
F38D AD 0E 8B LDA CKINT
2. The openings are stored in the RRIOT 1K ROM at $8C00
3. The RRIOT Timer is also used to implement the CHESSmate chess clock mode, see the source.

Opening book deciphered

The Chessmate chooses at random an opening from the opening book, which is in the 1K ROM of the 6530 024 RRIOT.
The first thing that pops out is that 28 of the 32 openings start with either D2-D4 (10) or E2-E4 (18). That explains the very high percentage of the time that these occur when openings are randomly selected. The Operation Instructions explicitly states that CHESSmate chooses one opening at random and tries to follow it for 16 moves

Micheal Gardi deciphered the coding of the openings:
There are 32 bytes for each opening representing 16 moves. Even bytes represent start positions and odd bytes represent end positions. A pair of bytes make a move. Moves alternate between white and black starting with white. Each byte represents a position on the chess board. The high nibble is the rank (row 1-8) and the low nibble the is the file (column A-H).


col_table = ['H','G','F','E','D','C','B','A']
row_table = ['1','2','3','4','5','6','7','8']

with open("Opening Book.bin", 'rb') as f:
    buffer = f.read()
   
    # For each line.
    ent_file = []
    even = 0
    address = 0x8C00
    for i in range(0,len(buffer),2):
        if i % 32 == 0:
            ent_file.append("\n")
            ent_file.append(hex(address))
            ent_file.append(": ")
            address += 32
        # Assume bytes are contiguous.
        if (even % 2) == 0:
            ent_file.append(col_table[buffer[i]&0x0F]+row_table[buffer[i]>>4]+"-"+
                            col_table[buffer[i+1]&0x0F]+row_table[buffer[i+1]>>4] +", ")   
        else:
            ent_file.append(col_table[7-(buffer[i]&0x0F)]+row_table[7-(buffer[i]>>4)]+"-"+
                            col_table[7-(buffer[i+1]&0x0F)]+row_table[7-(buffer[i+1]>>4)] +", ")
        even += 1     
    ent_file.append('\n')
    
    # Output the result.
    with open("Opening Book Dump.txt", 'w') as f:
        f.write(''.join(ent_file))

Running that code delivers this

8c00: E2-E4, E7-E5, G1-F3, B8-C6, B1-C3, G8-F6, F1-B5, F8-B4, E1-G1, E8-G8, D2-D3, D7-D6, C1-G5, B4-C3, B2-C3, D8-E7
8c20: D2-D4, D7-D5, C2-C4, D5-C4, G1-F3, G8-F6, E2-E3, E7-E6, F1-C4, C7-C5, E1-G1, A7-A6, D1-E2, B8-C6, B1-C3, C5-D4 
8c40: F2-F4, D7-D5, E2-E3, G8-F6, G1-F3, C7-C5, B2-B3, E7-E6, C1-B2, B8-C6, F1-B5, C8-D7, E1-G1, F8-D6, D2-D3, D8-C7 
8c60: E2-E4, E7-E5, F1-C4, G8-F6, D2-D4, E5-D4, G1-F3, F6-E4, D1-D4, E4-F6, C1-G5, F8-E7, B1-C3, C7-C6, E1-C1, D7-D5 
8c80: E2-E4, C7-C5, G1-F3, B8-C6, D2-D4, C5-D4, F3-D4, G8-F6, B1-C3, D7-D6, F1-E2, G7-G6, C1-E3, F8-G7, E1-G1, E8-G8 
8ca0: E2-E4, C7-C5, B1-C3, B8-C6, G2-G3, G7-G6, F1-G2, F8-G7, D2-D3, E7-E6, C1-E3, D7-D6, G1-E2, C6-D4, E1-G1, G8-E7
8cc0: E2-E4, E7-E5, G1-F3, B8-C6, F1-C4, F8-C5, C2-C3, G8-F6, D2-D4, E5-D4, C3-D4, C5-B4, B1-C3, F6-E4, E1-G1, E4-C3 
8ce0: G1-F3, G8-F6, C2-C4, C7-C5, D2-D4, C5-D4, F3-D4, E7-E6, B1-C3, F8-B4, C1-D2, E8-G8, E2-E3, B8-C6, F1-E2, D7-D5 
8d00: E2-E4, E7-E5, G1-F3, G8-F6, F3-E5, D7-D6, E5-F3, F6-E4, D2-D4, D6-D5, F1-D3, F8-D6, E1-G1, E8-G8, C2-C4, C7-C6 
8d20: D2-D4, G8-F6, C2-C4, E7-E6, G2-G3, D7-D5, F1-G2, D5-C4, D1-A4, B8-D7, A4-C4, A7-A6, G1-F3, B7-B5, C4-C6, A8-A7
8d40: E2-E4, G8-F6, E4-E5, F6-D5, D2-D4, D7-D6, C2-C4, D5-B6, F2-F4, D6-E5, F4-E5, B8-C6, C1-E3, C8-F5, B1-C3, E7-E6 
8d60: D2-D4, F7-F5, C2-C4, E7-E6, G1-F3, G8-F6, G2-G3, F8-E7, F1-G2, E8-G8, E1-G1, D7-D5, B1-C3, C7-C6, C1-F4, D8-E8 
8d80: E2-E4, E7-E5, G1-F3, B8-C6, F1-C4, G8-F6, D2-D4, E5-D4, E1-G1, F6-E4, F1-E1, D7-D5, C4-D5, D8-D5, B1-C3, D5-A5 
8da0: D2-D4, G8-F6, C2-C4, E7-E6, B1-C3, F8-B4, D1-C2, B8-C6, G1-F3, D7-D6, C1-D2, E6-E5, A2-A3, B4-C3, D2-C3, D8-E7 
8dc0: E2-E4, B8-C6, D2-D4, D7-D5, E4-D5, D8-D5, G1-F3, E7-E5, B1-C3, F8-B4, C1-E3, C8-G4, F1-E2, E8-C8, E1-G1, D5-A5 
8de0: D2-D4, D7-D5, C2-C4, E7-E6, B1-C3, G8-F6, C1-G5, B8-D7, G1-F3, F8-B4, C4-D5, E6-D5, E2-E3, C7-C5, F1-D3, D8-A5
8e00: D2-D4, D7-D5, C2-C4, C7-C6, G1-F3, G8-F6, B1-C3, D5-C4, A2-A4, C8-F5, F3-E5, B8-D7, E5-C4, D8-C7, G2-G3, E7-E5
8e20: E2-E4, E7-E5, G1-F3, B8-C6, F1-B5, D7-D6, D2-D4, C8-D7, B1-C3, G8-F6, E1-G1, F8-E7, F1-E1, E5-D4, F3-D4, E8-G8 
8e40: D2-D4, D7-D5, C2-C4, E7-E6, B1-C3, C7-C5, C4-D5, E6-D5, G1-F3, B8-C6, G2-G3, G8-F6, F1-G2, C5-D4, F3-D4, F8-C5 
8e60: E2-E4, E7-E5, G1-F3, B8-C6, F1-B5, A7-A6, B5-C6, D7-C6, D2-D4, E5-D4, D1-D4, D8-D4, F3-D4, C8-D7, B1-C3, E8-C8 
8e80: D2-D4, C7-C5, D4-D5, D7-D6, C2-C4, G7-G6, B1-C3, F8-G7, E2-E4, G8-F6, F1-E2, E7-E6, C1-G5, E8-G8, G1-F3, E6-D5 
8ea0: E2-E4, E7-E5, G1-F3, B8-C6, D2-D4, E5-D4, F3-D4, G8-F6, B1-C3, F8-B4, D4-C6, B7-C6, F1-D3, D7-D5, E4-D5, C6-D5 
8ec0: D2-D4, G8-F6, C2-C4, G7-G6, B1-C3, F8-G7, E2-E4, D7-D6, F2-F3, E7-E5, D4-D5, E8-G8, C1-G5, H7-H6, G5-E3, F6-H5 
8ee0: E2-E4, C7-C6, D2-D4, D7-D5, B1-C3, D5-E4, C3-E4, C8-F5, E4-G3, F5-G6, H2-H4, H7-H6, G1-F3, B8-D7, F1-D3, G6-D3 
8f00: D2-D4, G8-F6, C2-C4, E7-E6, G1-F3, B7-B6, G2-G3, C8-B7, F1-G2, F8-E7, E1-G1, E8-G8, B1-C3, F6-E4, D1-C2, E4-C3 
8f20: C2-C4, G8-F6, B1-C3, E7-E6, E2-E4, C7-C5, G1-F3, B8-C6, D2-D4, C5-D4, F3-D4, F8-B4, D4-C6, D7-C6, D1-D8, E8-D8 
8f40: E2-E4, E7-E5, G1-F3, B8-C6, F1-B5, G8-F6, E1-G1, F6-E4, D2-D4, F8-E7, D1-E2, E4-D6, B5-C6, B7-C6, D4-E5, D6-B7 
8f60: E2-E4, E7-E6, D2-D4, D7-D5, B1-C3, G8-F6, C1-G5, F8-E7, E4-E5, F6-D7, G5-E7, D8-E7, D1-D2, E8-G8, F2-F4, C7-C5
8f80: E2-E4, E7-E5, D2-D4, E5-D4, D1-D4, B8-C6, D4-E3, G8-F6, B1-C3, F8-B4, C1-D2, E8-G8, E1-C1, F8-E8, F1-C4, D7-D6 
8fa0: E2-E4, E7-E5, D2-D4, E5-D4, C2-C3, D4-C3, F1-C4, C3-B2, C1-B2, G8-F6, B1-C3, B8-C6, G1-F3, F8-B4, D1-C2, D7-D6 
8fc0: C2-C4, E7-E5, B1-C3, G8-F6, G1-F3, B8-C6, E2-E3, D7-D5, C4-D5, F6-D5, F1-B5, D5-C3, B2-C3, F8-D6, D2-D4, C8-D7 
8fe0: E2-E4, E7-E5, G1-F3, B8-C6, F1-B5, A7-A6, B5-A4, B7-B5, A4-B3, C6-A5, B3-F7, E8-F7, F3-E5, F7-E7, D2-D4, G8-F6

Chessmate emulator by Stephen Crane

An emulator with the look and feel of the Chessmate by Michael Gardi

Images of Chessmates

My Commodore Chessmate.

My Chessmate


Photo by Commodore International Historical Society on twitter @commodoreihs

Photo by Commodore International Historical Society on twitter @commodoreihs

On this early Chessmate two ROMs were used, each 2K. The TTL IC on the top right was added manually and wire wrapped, the wires running from it to the ROM selection inputs.

Boxes

Photo by Michael Gardi

Novag Chess Champion MK II A and B


TEC Schachcomputer

KIM-1 Diagnostic board

Dwight Elvey designed and programmed a diagnostic board for the KIM-1, to determine what might be wrong with the KIM-1
The board switches off the 6530 ROMs and one can run tests on teh onboard ROM, looking for for defective RAM, defective LED display, defective 6530 ports.

Here I present the complete design of the board, with help and permission of Dwight Elvey, Santo Nucifora and Liu Ganning.

KIM-1 Diagnostic board

Dwight Elvey designed and programmed a diagnostic board for the KIM-1, to determine what might be wrong with the KIM-1
The board switches off the 6530 ROMs and one can run tests on the onboard ROM, looking for for defective RAM, defective LED display, defective 6530 ports.

Here I present the complete design of the board, with help and permission of Dwight Elvey, Santo Nucifora and Liu Ganning.

Debug board connected to a KIM-1 (Photo by Santo Nucifora)

Triggered by post on twitter by Santo Nucifora (snuci) showing the results of his tests on his impressive KIM-1 collection, I connected to Dwight Elvey for permission to publish the design files.
Alas, Dwight did not have the circuit diagram, only the pcb drawings and binary of the ROM. With the aid of Santo Nucifora the instructions and sources of the debug board pack surfaced and the circuit could be reconstructed.

Debug board in action, defective transistors at LED display (Photo by Santo Nucifora)

Debug board in action,KIM-1 is healthy! (Photo by Santo Nucifora)

In November 20121 Liu. the designer of the PAL-1, asked help with his defective KIM-1, it was dead. So I gave him all the information I got from Dwight and he recreated the circuit, made a PCB and started testing his kIM-1.

Here a redrawn and slightly modified circuit diagram by Jonathan Levine:

From the vcfed.org forum, notes by Dwight Elvey

I’ve (Dwight) been debugging my KIM-1 and while doing so, hopefully helping others. What does one do when it doesn’t work? One can check some obvious places like the clock signals, reset pulse, interrupts and sync signal. Beyond that there is little that one can do with the monitor code dead. The problem could be any of the chips, from the simplest 7404 to one of the RRIOT chips. I’ve always said that one should write code and use an EPROM to test the functions of the board. Now I’m putting actions to these words. First one needs to create a place to put an EPROM if there is no socket. That is what I did for the KIM1. I have created a small board with a minimum of parts on a prototype board.

A little about the circuit. It is designed to run with a minimal amount of the KIM computer working. The processor has to be able to execute code and access the data but and addresses. The code I’ve written also expects the KIM’s address decoder chip to be functioning. In order to work, the debug board uses both connectors for signals. The expansion connector is mostly used but three signals are needed from the application connector. You’ll need 2 44 pin connectors.
The board disables the KIM’s ROM and takes over boot. One typically the sets the reset vector to $0C00 and assembles the code there (in other words the the reset vector need to be at $0FFC as the EPROM will be seen at $0FFFC as well as $0FFC, being dual mapped. In fact the EPROM will also be mirrored at every 1K if A15=1. This can be useful if KIM’s addresses decoder doesn’t work.
There are 2 LEDs on the debug board. One LED is on if it sees a access to the 1K space at $0C00 to $0FFF. It is not a fool proof indicator but if lit generally indicates that code is executing.
It can only be reset with the reset signal ( RS on the keyboard ). The other LED is a status light. It can be turned on and off from code. A write to $1000 of the D0=1 will turn it on and a write with D0=0 will turn it off. It provides a minimal feedback until KIM’s 7 segment LEDs are found to be functional. It also is needed to verify that the 1K RAM at address 0 is functional.
The RAM is needed to be able to use the stack and any zero page address. It can also be use to just blink to make sure a long running test is still working.

Downloads

Instructions

(from file DBINSTR.TXT)

Diagnostic Debug for the KIM-1 and 6530 to 6532 adapter
The diagnostic EPROM can hold up to 16 1K diagnostic or other programs.
Most of these diagnostic programs are intended to take over reset from 
the onboard ROMs in order to run various diagnostic test on the KIM-1 
hardware.
The control of which to boot from is controlled by the DB switch.
With a working monitor, it can be run by opening the DB switch.
The Diagnostic Debug board is also used to initialize the EEPROM on 
the 6530 to 6532 adapter with either the code for -002 or -003 ROM 
data. When the switch on the Diagnostic Debug board has the DB 
position turned on, the boot vevtors come from the EPROM on the 
Diagnostic Debug board.
Any 1K address above 8000H will be decoded from the 1k block selected
by the switch S0 to S3. Note that the switch between DB and S0 is not
used.
These 1k blocks are always decoded from 8000H as long as the DB switch
is on. This takes over the interupt and boot vectors.
There is always a 1K block decoded at 0C00 to 0FFF as well. This is 
available, even if booted from the monitors ROM, regardless of the DB 
switch position.
The main thing the DB switch does is allow the boot to happen from the
Diagnostic Debug EPROM rather than from a possibly defective -002
monitor ROM.
Each 1K test block is intended be run in sequence. This allows one to
test and diagnose a single area of the KIM-1 at a time. 
Many test depend on the passing of the previous test. An obvious 
example is if there is a RAM failure the display test is likely to
fail as well.
A failure of a later test may not be a positive indication that the
failure is what the test is testing for if a previous test has failed.
One should diagnose and repair the earliest test first.
Test 0  Flash
Switch setting:
DB on
--
S0 on
S1 on
S2 on
S3 on
This is a minimal test of the processor. All it does
is slowly flash the Green LED on the diagnostic board.
It is initiated by the reset switch, on the keyboard of the KIM-1
( RS ).
This test only uses the processor, addresss decoder and data bus.
If it fails to run. It will be a problem in one of these areas.
This test does not use any of the RAM in either the 2102s or in
either of the 6530 RAM areas. It only uses a few instructions and
is not a complete CPU diagnostic.
Remember the processor includes clocks and reset vector and possible
MNI stuck.
As a bonous some of the extra space has the program Astroids from the
First Book of Kim. It the normal KIM-1 monitor is running, one can
play if by setting the same switches as Flash except DB to off.
set the address at 0E00 and GO.
Use 0 and 3 to move your space ship to avoid the astroids.
Test 1  RAMTEST
Switch setting:
DB on
--
S0 off
S1 on
S2 on
S3 on
This test does a simple stuck at test of the RAM by writing and
reading 055H and 0FFH to each location in the 2102 RAM array. 
A passing indication is that the Green LED will blink at about 1
seconds rate for 8 time then on the 9th it will stay lit.
Should there be a failure the Green LED will blink out the failing
bit number. A 1 second blink indicates a good bit and a short blink
indicates a failed bit. After the 8th blink it will stay unlit.
If all the bits fail it may be an address decoder problem.
A single bit failure is likely a single RAM or the bus buffer.
The blink code starts with bit D0 and blinks through to D7.
This test does not test or use the 6530/2 RAM for vaiables during the 
test, other than the RAM it test. It only runs
in the processor's internal registers. This is not easy to do
for a 6502. This is the reason it doesn't also indicate the failed
address as well as the bit. This would likely need the variable space
that is under test.
Once this test passes, later test will assume that the RAM
on Page0 and Page1 are functional and use them as most 6502 programs
do.
There are still possible address errors that RAMs can have.
This test is initiated by the RS reset button on the keyboard.
As an example, a long-long-short-long-long-long-long-long
blink code would indicat that bit D2 was failing. In other
words the blink code is D0 first to D7 last. With the board
such that the key board is on the lower right, the RAM
chips blink from top to bottom for the blink codes. Each blink is
one RAM chip position.
Test 2  Display
Switch setting:
DB on
--
S0 on
S1 off
S2 on
S3 on
This test the displays. It will also flash the green LED just in case
the display isn't working so that you know that the test is running.
It sequences 0000 00 to FFFF FF. Not much else to say here.
Test 3 KeyBd
Switch setting:
DB on
--
S0 off
S1 off
S2 on
S3 on
This is used to test the keyboard. It test all the buttons.
Pressing RS will restart the test. ST will light the green
light ( use RS to turn it off if you like ).
The other keys will display the row and column for each button.
Refer to the schematic for a reference.
As an example, the E button will display 2 G.
Try each switch from 0 to GO to see what unique combination
is created. This test is run with the small, on/off, switch
on the keyboard in the OFF position.
This switch can be tested by using the single step function
as described in the KIM-1 Users manual, with the normal KIM-1
monitor.
Key table:
ROW  COL
0   0    G
1   0    F
2   0    E
3   0    d
4   0    c
5   0    b
6   0    A
7   1    G
8   1    F
9   1    E
A   1    d
B   1    c
C   1    b
D   1    A
E   2    G
f   2    F
AD  2    E
DA  2    d
PC  2    A
+   2    c
GO  2    b
Test 4 CRC2
Switch setting:
DB on
--
S0 on
S1 on
S2 off
S3 on
This test the ROM data for -002. It will flash the CRC generated
from reading the entire ROM. It should read C219. It does this
in a continuous loop. That is why the display flashes, because
it is rerunning the CRC code and not updating the display.
Any erratic value could be an indication of ROM failue.
Test 5 CRC3
Switch setting:
DB on
--
S0 off
S1 on
S2 off
S3 on
This test the ROM data for -003. It is the same as CRC2 but the
CRC numbers are 5EA4 instead, for the -003 chip.
Test 6 64RAM2
Switch setting:
DB on
--
S0 on
S1 off
S2 off
S3 on
This test the 64 bits of RAM in the -002 6530 chip. It uses the
March C algorythm. This is a very good test. If it passes, it says
'Good'. If it fails it says 'Bad nn' Where the nn indicates the
bad address. Say it displayed Bad C9'. That would indicate that the
address 1700 + C9 = 17C9 failed. Make sure to start the test from a 
clean reset by pushing the RS when changing the debug switches or
when powering up.
Test 7 64RAM3
Switch setting:
DB on
--
S0 off
S1 off
S2 off
S3 on
This test the 64 bits of RAM in the -003 6530 chip. It uses the
March C algorythm. This is a good test. If it passes, it says
'Good'. If it fails it says 'Bad nn' Where the nn indicates the
bad address. Say it displayed 'Bad 92'. That would indicate thath the
address 1700 + 92 = 1792 failed. Make sure to start the test from a 
clean reset by pushing the RS when changing the debug switches or
when powering up.
Test 8 EEPROM2
DB on
--
S0 on
S1 on
S2 on
S3 off
This is not really a test. This is code to program the EEPROM on
the -002 adapter module. The EEPROM on the adapter is not programmed.
this must be done on the KIM-1 by this program.
Install the adpater observing the proper orientation with the KIM
powered off.
The yellow jumper is for the -002 decode. It must be intact. The red
jumper enables EEPROM programming.
Set the switches as above and hit the RS button then power up. 
This loads the programming code into RAM. Make sure to
do a clean reset (RS) after setting up the switches for this code.
The programming code is loaded into RAM in a millisecond or so. The
only indication is that the RED LED will be lit.
The image for the EEPROM is a full 1024 bytes and the diagnosic code
window in memory is only 1024 bytes. It is not possible to have the
programming code and the ROM image in the same debug switch settings.
Once the code is in RAM, it waits for you to select the ROM image
by the debug switch settings.
You do this by changing the Debug switches to:
DB on
--
S0 off
S1 on
S2 on
S3 off
Make sure the upper left keyboard switch is in the off position.
Now press the ST button. This causes a NMI interrupt that starts
the programming cycle.
The green light should flash quickly. This indicated that the programming
is continuing OK.
If the Green LED then goes off, the programming is complete.
If the Green LED comes on steady, the programming has failed.
It would be wise to test that the EEPROM is working. Hold the RS
button down and set the DB to off. Releasing the RS should start the
normal KIM-1 monitor( it usually requires the AD or some switch
selected to determine user input source.
If it is working, it is wise to now cut the red wire loop at the end
of the adapter board ( only the red wire the other is -002/-003 select ).
This blocks the accidental writes to the EEPROM. I recommend leaving
a little wire as you might want to change the programming at some
future time.
Test 10 EEPROM3
DB on
--
S0 on
S1 off
S2 on
S3 off
This is not really a test. This is code to program the EEPROM on
the -003 adapter module. The EEPROM on the adapter is not programmed.
this must be done on the KIM-1 by this program.
Install the adpater observing the proper orientation with the KIM
powered off.
The yellow jumper is part of the decode for -003. The yellow jumper
must be cut for -003 location. The red jumper enables programming.
Set the switches as above and hit the RS button then power up. 
This loads the programming code into RAM. Make sure to
do a clean reset (RS) after setting up the switches for this code.
The programming code is loaded into RAM in a millisecond or so. The
only indication is that the RED LED will be lit.
The image for the EEPROM is a full 1024 bytes and the diagnosic code
window in memory is only 1024 bytes. It is not possible to have the
programming code and the ROM image in the same debug switch settings.
Once the code is in RAM, it waits for you to select the ROM image
by the debug switch settings.
You do this by changing the Debug switches to:
DB on
--
S0 off
S1 off
S2 on
S3 off
Make sure the upper left keyboard switch is in the off position.
Now press the ST button. This causes a NMI interrupt that starts
the programming cycle.
The green light should flash quickly. This indicated that the programming
is continuing OK.
If the Green LED then goes off, the programming is complete.
If the Green LED comes on steady, the programming has failed.
It would be wise to test that the EEPROM is working.
You might run CRC3, Test 5 to verify or check the values
through the KIM-1 monitor.
It is wise to now cut the red wire loop at the end of the adapter board.
This blocks the accidental writes to the EEPROM. I recommend leaving
a little wire as you might want to change the programming at some
future time.
-003 EEPROM code has a large blank portion of code space near the
end. You might want to want some special code that is always resident
that you could put it this space. It is starting at 1A96 and ending
at 1BF9. This is 356 bytes for a small perminent piece of code.
Of course any change to the -003 EEPROM will also change the CRC3
results. It is wise to write it down to ensure it you still have
a -003 valid test.
This is all the test in Debug EPROM. The remaining switch locations
are available for other use. If you want the KIM-1 to boot to this
code make sure to put the reset vector at the end of the 1K block.
With the DB swith to the on position and a RS reset, it will run
the EPROM code. It can be run at 0C00 to 0FFF or at FC00 to FFFF.
If the DB switch is off, code on the EPROM must be started from
the KIM-1 monitor. It will only be seen at 0C00 to 0FFF and is
not seen in the upper memory window as it would be to boot to
the debug code.
There are 4 completely unused 1K blocks left in the debug EPROM. Also
if you look at each of the test, you'll note that most of the test only
use a small portion of the 1k block. One can always add one's code
in one of these blank areas. Just remember that the code will be
offset into the 1K window starting at 0C00.
Before adding of edition the debug EPROM, make sure to make a copy
of the original EPROM.
The unused bytes, of the debug 1K blocks are all 00s so the entire
EPROM would need to be erased and editied in an external image of
the EPROM before writng an new code.
The unused 4 1K block are 0FF and can be programed without erasing
the EPROM.

6530-004 Dissected

>This page about the 6530-004 dissection is about a transistor level dissection of the 6530-004 (TIM edition), brought to you by Frank Wolf and Dieter a.k.a. ttlworks. Frank Wolf and http://retro.hansotten.nl/6502-sbc/tim-6530-004/6530-004-dissected/

post

6530-004 dissected

This page about the 6530-004 dissection is about a transistor level dissection of the 6530-004 (TIM edition), brought to you by Frank Wolf and Dieter a.k.a. ttlworks. Published, as before at the 6502.org forum, with permission by Frank Wolf and ttlworks.

Contents

EagleCAD schenatics archive download

Imported in Kicad, exported as SVG images on this page:

The 6530 was used in the KIM-1, in Commodore disk drives, and in pinball machines.

The 6530 RRIOT (RAM, ROM, IO, Timer) is a special chip in the 6502 family.

6530 contains 64 Bytes of RAM, 1kB of mask programmed ROM, two 8 Bit IO ports, and a Timer.
//Timer is an 8 Bit down counter with pre-scaler factors 1, 8, 64, 1024.
It also contains a mask programmed address decoder.

The idea at MOS Technology was, that a microcontroller could be built from just two chips: 6502 plus 6530.
And that up to seven 6530 (each chip containing a different address decoder and different ROM contents)
could be used in a 6502 system.

And that’s where trouble starts:
Because of custom address decoder and custom ROM contents, when replacing a defective 6530, you can’t just buy any 6530, plug it into the socket and hope that it works. Even replacing a 6530 with a 6530 pulled from another socket from the same PCB probably won’t work.

It has to be a 6530 which fits to a specific socket on a specific PCB, and you need to look out for obscure chip markings and part numbers.




6532 seems to be based on the 6530, it lacks the address decoder and the ROM, but it has 128 Bytes of RAM.
6532 was used in the Elektor Junior computer and in the Atari 2600.

6530 contains some circuitry you probably won’t expect to see in other 65xx peripheral chips (except for 6531 and 6532).

When I was a kid, I did two layer PCB layouts on transparent foil with tape and rub-on dry transfers,
and I think I know how the game goes when things are starting to get a bit dense and complex.

The 6530 chip layout has that “hand routing smell” all over, it’s incredibly dense/compact and complex,
and I feel a need to salute to the designers (Bill Mensch et al.): it truly is a beautiful/amazing work of art.

Again: my thanks to Frank Wolf, because not many out there could polygonize a beast of that sort.

Now for some oddities of that 6530 “Wolpertinger”:
RESET is fully asynchronous, it’s not sampled with the clock.
PHI2_in has 30pF typical input capacitance, because it directly and unbuffered feeds quite some circuitry on the chip.
Signals from PA0..7 and PB0..7 are not latched at PHI1, the CPU reads them directly.

Bus interface uses fully static latches for data writes, but read data bus uses a dynamic pre-charge mechanism.
Bus interface uses fully static latches for the address, IO logic uses fully static register Bits,
and the logic which sits in between and controls said IO logic uses dynamic latches.

//That mix of static and dynamic logic started to make me wonder,
//at which point of the 6530 design phase the specification for the 6502 bus timing had rolled out.
//It would be interesting to read a “the making of the 6530” story.

Some features:
PA0 and PB0 have push/pull outputs for driving Darlington transistors etc.
PA1..PA7 and PB1..PB7 have open_drain outputs with integrated pull-up resistors.
However, there is a mask programmed option to disable the PB5 and PB6 output drivers
and to use PB5 and PB6 as inputs for the address decoder.
PB7 is supposed to be used as a Timer underflow IRQ# output, and it lacks the pull-up resistor.

Note:
For consistence with Frank’s notation, low-active signals are named foo#, not /foo.

Orientation for all the chip pictures: A5 and R/W# pads are North.

0 cheat sheet

A very simplified schematic to give an overview about what came out during the dissection.

Note:
Latches labeled FSTL are fully static transparent latches (built around a RS flipflop).
Latches not labeled FSTL are dynamic transparent latches (just a FET switch plus some trace capacitance).

A picture of the 6530 silicon, with the interesting areas marked according to the cheat sheet.

Don’t worry because the RAM and the ROM lack any details in the cheat sheet and in this picture,
we are getting there later.

Just as a reference, another picture of the 6530 silicon without the markings.

1 Clock generation

Nothing special in there.

However, it should be noted that PHI2_in also directly and unbuffered drives quite some circuitry on the chip.

6530 PHI2_in has 30pF typ. input capacitance, for a NMOS 6522 20pF typ. would be normal.

When using multiple 6530 (or 6532) chips in a system,
it probably would be a good idea to keep an eye on the total capacitive load of the 6502 PHI2 output driver
(and on the 6502 propagation delay PHI0_in to PHI2 output, which might be different for rising and falling edge of the clock).

2 RESET

The low-active RES# signal from the pad goes through an inverter, then through a non-inverting super buffer,
and becomes the high_active RES signal (which puts the chip into a RESET).

Note, that the 6530 RESET is fully asynchronous, and not sampled with the clock.
Means, a glitch on RES# to logic low level at any time most likely will cause a RESET.

RES clears the PRA and PRB IO port data registers.
RES clears the DDRA and DDRB IO port data direction registers, configuring the PA0..7 and PB0..7 IO port pins as inputs.

But be aware: RES [b]does not[/b] affect the timer, the Timer Interrupt flag, the pre-scaler, and the pre-scaler factor.

RES makes sure that PB7 is not pulled low while RES is active.
RES also sets the latch for the PB7 interrupt generation to “disabled”.
But if there is something like an accidental Timer read during the RESET sequence of a 6502,
A3i could enable PB7 interrupt generation, and then there might be a falling edge on PB7 in the wrong moment…
For more details, please see “16) Timer control”.

3 RS0

RS0 is an address decoder input signal.

The high-active RS0 input is sampled with PHI1 into a fully static transparent latch,
which gives out the low-active RS0i# signal that goes to the address decoder PLA.

//’i’ like in ‘Input’.

4 A0

Like RS0, high-active A0 from the pad is sampled with PHI1 into a fully static transparent latch.
A special thing is, that the latch feeds push/pull output drivers which generate
the low-active A0i# and the high-active A0i.

When taking a look at the chip layout, it appears that big transistors are located between the address pads.
They somehow look like output drivers (for external signals) to be found in other chips,
but they are driving the internal address lines inside the chip instead.

I think it’s a good/clever idea to re-use an output driver structure/topology for driving internal address lines
to deal with the capacitances build up by the RAM and ROM address decoders.


5 A9

Since the A9 input buffer circuitry layout is different from A0,
I felt a need to take a closer look at it,
but from the logic design point of view the input circuitry for A0 and A9 is identical.

Layout of the A1..A5 input circuitry is identical to A0.
Layout of the A6, A7 input circuitry is identical to A0, but it’s mirrored to make better use of chip space.

Layout of the A8 input circuitry is a variation of A9.

Now for a list of signals generated by the A0..A9 output drivers:
West to East: A0i#, A0i; A1i#, A1i; A2i#, A2i; A3i#, A3i; A4#i, A4i; A5i#, A5i; A6i, A6i#; A7i, A7i#; A8i, A8i#;

North to South:
A9i,
A9i#

6 CS1 latch

The CS1 latch is a fully static transparent latch, which samples PB6 at PHI1,
and gives out the high_active CS1 signal to the address decoder PLA.

Similar to the CS1 latch,
the CS2 latch also is a fully static transparent latch, which samples PB5 at PHI1,
and gives out the high_active CS2 signal to the address decoder PLA.

Both latches are located between the RES# pad and the RAM block


7 R/W#

R/W# (high=read, low=write) is sampled with PHI1 into a fully static transparent latch,
which feeds a push/pull driver generating W/R# (high=write, low=read)

8 DB7

Overview:

DB0..7 external data bus pads (high_active).

Internal write data bus D0..7w# (low-active) when writing registers.
//Internal write data bus D0..7w (high_active) is generated by super buffers located South in the IO logic block.

Internal read data bus D7r# (low-active) when reading registers.
//The read data bus is pre-charged during PHI1 with FETs located South in the Timer block.

Layout for the DB0..6 circuitry is pretty similar to DB7, so we only take a look at DB7.
On the input side, the high_active DB7 pad is sampled with PHI2_in into a fully static transparent latch,
which feeds a push/pull driver generating the low-active D7w# signal for the write data bus.
//Note, that the PHI2_in signal controlling the DB0..7 latches comes directly and unbuffered from the PHI2_in pad.

On the output side, the low-active OE_DB# control signal enables the inverting DB7 push/pull driver
which takes the low-active D7r# signal from the read data bus and emits it in high_active form
on the external DB7 data bus pad.


9 PB7

PB7 is an open drain IO port signal, which lacks a pull-up resistor.

In addition to being an IO port signal,
it also works as a (low-active) Timer overflow interrupt output,
supposed to be tied to the IRQ# pin of a 6502.

The PB7 pull-up resistor (FET) is present in the chip layout,
but the diffusion layer between the pull-up and VCC is cut.
I think that’s because if the PB7 pads of multiple 6530 chips are tied to IRQ#,
and every 6530 would have a PB7 pull-up resistor,
the resulting impedance of all the PB7 pull-up resistors in parallel on the IRQ# line
would be too low for a 6530 PB7 output driver to pull down IRQ# to a logic low level.
Not much to say on the output side:
if PB7o# is high OR IRQ is high, the output driver pulls PB7 low.
//For logic high level, you need to add an external pull-up resistor between PB7 and VCC.

In the IO logic block, PB7o# is the output of a NOR gate fed by data bit PRB7 and data direction Bit DDRB7#.
If PRB7=0 (data Bit low) and DDRB7=1 (PB7 is output), PB7o# is high, and PB7 is pulled to GND.

The high_active IRQ signal is generated in the Timer control block.
//IRQ can be enabled/disabled with A3 during Timer reads/writes.
If it’s enabled AND if the Timer Interrupt flag is set, IRQ is high, and PB7 is pulled to GND…
…by ignoring the PRB7 and DDRB7 Bits.
On the input side, the PB7 pad signal goes through two inverters, becomes PB7i and goes to the IO port logic,
IO port logic places it in inverted form on the D7r# read data bus when reading data register PRB,
we are getting there later.

Note, that the PA0..7 and PB0..PB7 input signals are not latched at PHI1, the CPU reads them directly,
we are getting there later, too.

10 PB6

PB6 pad also feeds CS1 latch, PB6 pad also feeds CS2 latch,
CS1 and CS2 are used in the (mask programmed) address decoder PLA of the chip we had dissected,
and as a mask programmed option the metal trace between PB5,PB6 pad and PB5,PB6 driver is cut.
//You don’t want the chip to be able to remove itself from the system by disabling its own chip select.

PA1..7 and PB1..6 pad circuitry is pretty similar to PB7.
They are open drain outputs with pull-up resistor (FET).
So we just focus on PB6:
On the output side, if PB6o# is high, and if the metal trace wouldn’t be cut, the output driver would pull PB6 low.

In the IO logic block, PB6o# is the output of a NOR gate fed by data bit PRB6 and data direction Bit DDRB6#.
If PRB6=0 (data Bit low) and DDRB6=1 (PB7 is output), PB6o# is high.
On the input side, the PB6 pad signal goes through two inverters, becomes PB6i and goes to the IO port logic,
IO port logic places it in inverted form on the D6r# read data bus when reading data register PRB,
we are getting there later.

Note, that the PA0..7 and PB0..7 input signals are not latched at PHI1, the CPU reads them directly,
we are getting there later, too.

11 PB0

PA0 and PB0 have a pull-up resistor (FET),
but unlike PA1..7 and PB1..7, PA0 and PB0 have true push/pull output drivers.

PA0 and PB0 are meant to source 3mA for driving darlington transistors and such.

PA0 and PB0 circuitry layout is different to make better use of chip space,
but electrically they are identical, I checked.
So we now focus on PB0.
On the output side:

PB0 output driver is enabled by DDRB0=1 (when PB0 is configurated as an output).
PRB0# which goes into the output driver is the low-active output signal of the PRB0 data register Bit.

When DDRB0=1:
If DDRB=1 and PRB0=0 (PRB0#=1), the output driver pulls PB0 low.
If DDRB=1 and PRB0=1 (PRB0#=0), the output driver pulls PB0 high.
And that’s all there is to it.
The input side is more complicated:

There is a danger that the voltage at PB0 doesn’t reach logic high level
when the PB0 driver has to source a lot of current.

That’s why we have sort of a 2:1 multiplexer controlled by DDRB0 (data direction register Port B).
The multiplexer generates PB0i, which goes to the IO port logic,
IO port logic places it in inverted form on the D0r# read data bus when reading data register PRB,
we are getting there later.

If PB0 is configurated as an input, PB0i is generated from the PB0 pad.
If PB0 is configurated as an output, PB0i is generated from the data register Bit PRB0.
//I’m simplifying things a bit here.

Note, that the PA0..7 and PB0..7 input signals are not latched at PHI1, the CPU reads them directly,
we are getting there later, too.


12 PLA

(mask) programmed logic array (PLA), also known as “the address decoder”.
Mask programmed as in “customer specific”.

It decides, where ROM, RAM and IO (including Timer) show up in the 6502 address space.

Located high up North, between A5 pad and R/W# pad.

Basically, we have three NOR gates:
One for selecting ROM: fed by CS1, CS2, RS0i. //CS1#, CS2#, RS0i# respectively.
One for selecting RAM: fed by CS1, CS2, RS0i, A6..9i. //CS1#, CS2#, RS0i#, A6..9i# respectively.
One for selecting IO: fed by CS1, CS2, RS0i, A6..9i. //CS1#, CS2#, RS0i#, A6..9i# respectively.

Where CS2 is supposed to be A12, CS1 is supposed to be A11, and RS0 is supposed to be A10.

//The A0..9 input buffers emit A0..9i (high_active) and A0..9i# (low-active).

We have three inverters, generating CS1# from CS1, CS2# from CS2, and RS0i from RS0i#.
For those who are new to the game:

In the polygonized chip picture, red is diffusion layer, green is PolySi layer, blue is metal layer.
Where ever green crosses red, that’s the active region of a FET, and green is the Gate of that FET.

So the PLA was mask programmed by changes in the diffusion layer.


13 some logic

A tangled mass of logic gates located North East from the RAM, between RAM and ROM.

It generates ROM# (low-active) from ROM (high-active), RAM# from RAM, IO# from IO.

Also, it generates RAM_W (high_active), the RAM write enable signal,
which is 1 when PHI1=0 (what is different from “when PHI2=1”), AND when RAM is selected, AND when W/R#=1 (write).

Also, it generates OE_DB_R (high-active), which is 1 when ROM OR RAM OR IO is selected, AND when RES is inactive, AND when W/R=0 (read).

In 14 IO control, there is a NAND gate fed by OE_DB_R and PHI2_in which generates the low-active OE_DB# signal.
OE_DB# enables the DB0..7 output drivers.


14 IO control

The IO control block is located below the South East corner of the RAM, East of the IO logic block.
It generates the read/write control signals for the IO logic.

First, we have a PLA like structure (containing 8 NOR gates), which is enabled when IO#=0 and A2i#=1.
According to A0i, A1i and W/R#, it generates 4 read signals and 4 write signals.
The 4 read signals from the “IO control PLA” are sampled with PHI1 by dynamic transparent latches.
The latch outputs then control FET switches, a closed switch puts PHI2 on the read control lines for the IO logic.
IO read control signals are all high_active: R_PRA, R_DDRA, R_PRB, R_DDRB.

Note, that there are 4 switches West of of the IO logic, wich tie these 4 IO read control signals to GND during PHI1.
The 4 write signals from the “IO control PLA” are sampled with PHI2 by dynamic transparent latches.
A latch output goes through an inverter, then together with PHI2_in into an “open collector” NOR gate.

Means if a write signal from the “IO control PLA” latched at PHI2 is high, AND PHI2_in is low,
the NOR gate stops pulling the IO write control signal to GND, which then is pulled to high by a pull-up resistor (FET).
IO write control signals are all high_active: W_PRA, W_DDRA, W_PRB, W_DDRB.

Note, that there are 4 switches West of the IO logic, which tie these 4 write control signals to GND during PHI2_in.

The trick is, that the data from DB0..DB7 is sampled into static transparent latches during PHI2_in = HIGH.
The latches place D0..7w# on the write data bus.
The IO registers are written with this data [b]during PHI2_in = LOW.[/b]

//This is something you probably won’t expect to see in a 65xx peripheral chip…
Decoding:
IO has to be selected, A2i has to be 0.

According to A0i, A1i and W/R#, we have:

00 read: during PHI2=high: R_PRA
01 read: during PHI2=high: R_DDRA
10 read: during PHI2=high: R_PRB
11 read: during PHI2=high: R_DDRB

00 write: during PHI2_in=low: W_PRA
01 write: during PHI2_in=low: W_DDRA
10 write: during PHI2_in=low: W_PRB
11 write: during PHI2_in=low: W_DDRB
Also, West in the IO control block we have a single NAND gate.
When OE_DBR (mentioned in “13) some logic”) is high AND PHI2_in is HIGH,
it sets the low-active OE_DB# signal to low.

OE_DB# enables the DB0..7 output drivers.

15 IO logic

IO logic block is located East of the PB0, PB1 buffers/drivers and West of the IO control block.

South in the IO logic block, we have eight inverting super buffers, which generate D0..7w (high_active) from D0..7w# (low-active).

Since the layout for the IO block Bits is more or less identical, we just focus on the IO logic for Bit 7.

Output side:

PRA (write) is data register for port A output (PA0..7).
DDRA (write) is data direction register for port A, if a Bit is 1 this means the according PA0..7 pin is configurated to work as an output.

The PRA, DDRA register Bits are static RS flipflops, which are cleared during RES=high.
Note, that RES (high_active) is the inverted signal from the RES# pad (low-active), not sampled by any clock, take care.

When one of the IO the write control signals W_PRA, W_DDRA, goes high, D0..7w and D0..7w# are fed to both transistors of a RS flipflop in the according register Bit by FET switches.
And yes, that’s “differential” signals and two FET switches per register Bit.

For PA1..7, we have seven NOR gates which generate PA1..7o# signals, telling the output drivers to pull PA1..7 to GND,
when a PRA register Bit is 0 and the according DDRA register Bit is 1 (when PA1..7 is configurated as an output).
//pull-up resistors (FETs) to VCC are pulling PA1..7 to high when the output drivers are not pulling PA1..7 to GND.
Since the PA0 output is a true push/pull driver, it lacks the NOR gate.
See “11) PB0”, which discusses the PA0 and PB0 driver/buffer circuitry.

For port B, the game is similar, just with PB0..7, PRB and DDRB.
But in the chip we had dissected, the PB5 and PB6 drivers were disabled because PB5 and PB6 were used as inputs for chip select signals.
Also, PB7 can be used as #IRQ output, and in this case the Timer control block overrides PRB and DDRB when generating an interrupt on PB7.
Note, that PB7 lacks the pull-up resistor (FET), means one has to add an external pull-up resistor for a logic high level on PB7.
Input side:

When reading DDRA, the DDRA register Bits are placed on the read data bus D0..7r# in inverted form by FET switches, and that’s all there is to it.

The signals from the PA1..7 pads are buffered as PA1..7i.
When reading PRA0..7, we have eight “open collector” NAND gates which pull the read data bus D0..7r# low
if the according DDRA Bit is low (PA1..7 configurated as an input, that is) and PA0..7i is high.

For PA0i it’s a bit different:
If PA0 is configurated as an input, PA0i comes from the PA0 pad.
If PA0 is configurated as an output, PA0i comes from the PRA0 register Bit.
For details, again please see “11) PB0”, which discusses the PA0 and PB0 driver/buffer circuitry.

For Port B, the game is similar.
65xx peripheral chips usually sample port input signals during PHI1, but the 6530 doesn’t.
6530 just places the signals from the IO port on the DB0..7 CPU data bus, the 6502 samples DB0..7 at the falling edge of PHI2, and that’s it.
That’s not good for signal integrity.

[i]See, many years ago I had built counters for incremental encoders at work with XC95108 CPLD chips.
Out of paranoia, I had tied three counters to one encoder, and after some hours of operation all of them counters had a different value.
For position control in machine engineering, that’s not good.

I had tried a lot of different things:
– creative placement of capacitors of different size into the power supply, active/passive termination of the clock signal,
– filtering the signal inputs with shift registers and whatnot…
What eventually had fixed the problem was running the counter with the non_inverted clock,
and putting flipflops controlled by the inverted clock into the input signals.
Sounds familiar when talking about PHI1 and PHI2… but I’m getting off topic.[/i]

Whether you want to have transparent latches sampling PA0..7 and PB0..7 during PHI1 or not
when building a TTL or FPGA implementation of the 6530, that’s your decision.


16 Timer control

The Timer control block is located North of the DB3, DB4 drivers/buffers, East from the Timer block.

Also, we have a little bit of logic for Timer Interrupt flag and PB7 IRQ generation West from the Timer block,
which technically also belongs to the Timer control block.
Address decoding:

To make things simple:
We have three NOR gates, which generate three high_active control signals when PHI1 is low
(what is different from “PHI2 is high”) AND when IO is selected AND when A2i is high.
R_TMR (read Timer) when A0i is low AND W/R# is low (read).
R_IRQ (read Timer underflow Interrupt flag) when A0i is high AND W/R# is low (read).
W_TMR (write timer) when W/R# is high (write). //Note: A0i doesn’t matter here.

R_TMR and W_TMR are switched to GND by FETs during PHI1:
For R_TMR, one FET located West from the Timer block.
For W_TMR, one FET located West from the Timer block, and another FET located in pre-scaler counter Bit 0.
Predivider control:

We have a predivider, basically a ten Bit down counter running at PHI2_in speed,
which is cleared when writing the Timer by W_TMR.
//Predivider counter Bits change with PHI2.

We have three latches for the pre-scaler factor, written with W_TMR.
Depending on A0i and A1i, only one of the latches can be set to 1, default is 0.

00: PRE1=1, PRE8=0, PRE64=0. No predivider, Timer is running at PHI2_in speed.
01: PRE1=0, PRE8=1, PRE64=0. Predivider factor 8, Timer is running at PHI2_in/8.
10: PRE1=0, PRE8=0, PRE64=1. Predivider factor 64, Timer is running at PHI2_in/64.
11: PRE1=0, PRE8=0, PRE64=0. Predivider factor 1024, Timer is running at PHI2_in/1024.

Active predivider counter Bits:
Three when PRE8=1.
Six when PRE64=1.
Else, all of the ten predivider Bits are active.

In the predivider block, we have a ten input NOR gate which generates the IS0 signal.
If IS0 is high, all of the active predivider counter Bits are zero. //I’m simplifying things a bit here.

Timer control:

We have a Timer, basically an eight Bit down counter,
read with R_TMR, written with W_TMR,
Timer Bits change with PHI2.

The low-active CEN# signal enables Timer counting.
If PRE1 is high, CEN# always is active, and the Timer is running at PHI2_in speed.
;
IS0 is sampled with a transparent latch at PHI1,
means that if IS0 was high in the previous PHI2_in cycle, CEN# is active for the current PHI2_in cycle.
;
If the Interrupt flag is set, CEN# is active: the timer is running at full speed.
;
W_TMR also puts CEN# active, and I don’t know why,
because the Timer counter circuity ignores CEN# when W_TMR is active.

The Timer uses a carry lookahead mechanism for the lower 5 Bits,
that’s why we have that Tcin5 signal, we are getting there later in “18) Timer”.
Timer underflow Interrupt flag and IRQ generation:

6530 Interrupt flag basically is a RS flipflop built from two NOR gates.

Timer Bit 7 carry output TC# (low-active, signaling Timer underflow, changes with PHI2) is sampled with a transparent latch during PHI1.
TC# is active, when the (decrementing) Timer is at $00 in the current PHI2_in cycle (and will roll over to $FF in the next time).

If TC# was active in the previous PHI2_in cycle, the latch output does set the 6530 Interrupt flag (through an inverter)
during PHI1 in the current PHI2_in cycle.

We have another transparent latch, which samples the Interrupt flag during PHI2.
If the output of that latch is active, three things will happen:
;
CEN# is active, the Timer counts a step during the current PHI2_in cycle.
;
If the PB7 IRQ output is not disabled, AND RESET is not active,
the IRQ signal goes active during PHI2 of the current PHI2_cycle and tells the PB7 driver to pull PB7 to GND.
//If PB7 is tied to the IRQ# input of the 6502, this signals a 6530 Timer underflow IRQ# to the 6502.
;
When the Interrupt flag is read by R_IRQ during PHI2, read data bus D7r# is pulled low,
means the 6502 sees DB7 ‘1’ what indicates that the 6530 Interrupt flag is set.
//read data bus D0..7r# lines which are not pulled to GND during PHI2 give us ‘0’ on DB0..7.
//That’s why DB0..6 are ‘0’ when reading the Interrupt flag.

The Interrupt flag is cleared in the current PHI2_in cycle by reading/writing the Timer (if R_TMR OR W_TMR goes high).
Now for the last part: disabling PB7 IRQ.

We have a latch which samples A3i# during Timer reads (R_TMR=high) OR Timer writes (W_TMR=high).
The output of that latch gives us the signal IRQ_DISABLE.
If IRQ_DISABLE is high, IRQ is disabled, and the Timer Interrupt flag won’t cause that PB7 is pulled low.

When reading/writing the Timer,
A3i=0 disables and A3i=1 enables PB7 IRQ generation during PHI2 in the current PHI2_in cycle.
Also, the Interrupt flag is cleared in the current PHI2_in cycle.

Note, that the PB7 IRQ generation ignores the PRB7 and DDRB7 IO register Bits.

Also note, that RESET does not affect the 6530 Interrupt flag, Timer, pre-scaler, and pre-scaler factor.

RES makes sure that PB7 is not pulled low by IRQ while RES is active.
RES also sets the latch for the PB7 interrupt generation to “disabled”.

But if there is something like an accidental Timer read during the RESET sequence of a 6502,
A3i could enable PB7 interrupt generation, and then there might be a falling edge on PB7 in the wrong moment…

If PB7 is tied to IRQ# of the 6502, there is no problem, because the 6502 does not mind an active IRQ# during its RESET sequence.

If PB7 is tied to NMI# of the 6502, there is a problem, because a falling edge on #NMI in the wrong time might disrupt the 6502 RESET sequence.
And that the RES# input of the 6530 is not synchronized with a clock actually makes things worse, because the 6502 _does_ synchronize its RES# input with a clock.

For more info, please read [url=http://archive.6502.org/datasheets/rockwell_r6530_r6532_timer_interrupt_precautions.pdf]Rockwell 6532 timer interrupt precautions[/url].

17 Predivider

The predivider is located between the ROM and the DB1, DB2 drivers/buffers,
East from the Timer control block.

Basically, it’s a 10 Bit down counter, and the carry is inverted with every Bit.
Counter Bits change with PHI2.

We have a 10 input NOR gate, it generates the IS0 signal (high_active), which indicates that the active predivider Bits are zero.
Actually, the NOR gate is just a metal trace connected to a pull-up resistor which is located in predivider Bit 0,
and there is a FET switching that metal trace to GND in every predivider counter Bit if said Bit is not zero…
…but before we are getting to the details:

The predivider breaks in three parts:
Bit 9..6 (five Bits) are controlled by PRE64 and PRE8.
Bit 5..3 (three Bits) are controlled by PRE8.
Bit 2..0 (three Bits) are free running.

If PRE64 and PRE8 are low, all of the 10 predivider counter Bits are active, what gives us a predivider factor of 1024.
If PRE64 is high, only Bit 5..0 of the predivider counter Bits are active, that’s six Bits, what gives us a predivider factor of 64.
If PRE8 is high, only Bit 2..0 of the predivider counter Bits are active, that’s three Bits, what gives us a predivider factor of 8.

However, if a predivider counter Bit is “active”, this just means that the IS0 NOR gate is sensing said counter Bit.

For even predivider counter Bits, the input of the IS0 NOR gate is just disabled, but the Bits still are able to count.
For odd predivider counter Bits, the counter Bit really is cleared.

It isn’t that bad, because when the Timer is written with W_TMR is high, all of the predivider counter Bits are cleared.
And the only way to change the pre-scaler factor (signals PRE64 and PRE8, that is) is to write the Timer.

Note: predivider counter Bit 0 contains a FET switching W_TMR to GND during PHI1, this already was mentioned in “16) Timer control”.

18 Timer

The Timer is located North of the DB7..5 drivers/buffers,
West from the Timer control block.

Basically, it’s an 8 Bit down counter, and the carry is inverted with every Bit.
Counter Bits change with PHI2.
It uses a carry lookahead mechanism for the lower 5 Bits, basically a six input NOR gate.
Note, that the NOR gate FET for every odd Bit is located in the next higher Bit.

Timer control block enables Timer Bit 0..5 counting with CEN# (low-active).

A dynamic transparent latch (located in the Timer control block) samples CEN# during PHI2.
If the output of that latch is low, AND if Timer Bits 0..4 are zero, the output of the six input NOR gate
Tcin5 (high_active Timer Bit 5 input carry) is high, what enables counting for Timer Bits 5..7.
The low-active TC# signal is the output carry of Timer Bit 7,
it tells the Timer control block about a Timer underflow.
//When the (decrementing) counter is $00, and wants to roll over to $FF in the next time.

If R_TMR is high, Timer contents are placed on the (low-active) read data bus D7..0r# by FET switches.

If W_TMR is high, Timer is written with the write data bus.
Even Bits are written with low-active data, odd Bits are written with high_active data, take care.
//The inverting super buffers for the write data bus which generate D0..7w from D0..7w# are South in the IO logic block,
//which is located North from the Timer. This already was mentioned in “15) IO logic”.

Note, that there are FETs West of the Timer block, which are switching R_TMR and W_TMR to GND during PHI1,
this already was mentioned in “16) Timer control”.
Dynamic pre-charge mechanism for read data bus:

There are eight pre-charge FETs South in the Timer block.
During PHI1, the FETs are active, acting as “pull-up resistors” for the read data bus D0..7r#.
Due to the bus capacitances, D0..7r# remain high during PHI2 (if PHI2_in doesn’t get too slow, that is).

During PHI2, the pre-charge FET switches are open,
and everything connected to the read data bus can pull the charge on the read bus lines to GND.

Short form:
The read data bus is low-active, and pre-charged to VCC during PHI1,
so if a read data bus line isn’t pulled to GND during PHI2, it keeps the charge.
And that’s why Bits on the read data bus default to ‘0’ on DB0..7 for the 6502.

19 RAM

6530 contains 64 Bytes of static RAM.

From North to South,
we have the RAM address decoder, the column select signal drivers, then the RAM cells,
then the FETs which discharge the colum select signals by switching them to GND during PHI1.

North in the RAM block, the column address decoder is fed by A0..3i (A0..3i# respectively).
It contains sixteen 4 input NOR gates.
Note, that the pull-up resistor for every NOR gate is not tied to VCC directly/permanently, but only during PHI1.
To be more precise, we have FET switches controlled by PHI1, and the impedance of a FET is working as a resistor.
//From West to East, the NOR gates check from 0000 to 1111, it’s linear.

South from the column address decoder, we have the column select signal drivers:
Sixteen transparent latches, sampling the outputs of said NOR gates during PHI2,
control sixteen FET switches, which connect one of the sixteen column select signals to PHI2.
Means, only one column select signal is active at a time.

At the Southern corner of the RAM block, we have FETs switching all of the column select lines to GND during PHI1.
RAM cells are organized in eight parts, for D0..D7,
starting with D0 South of the column select signal drivers, followed by D1, and so on.

In each of the eight D0..D7 RAM cell areas, we have RAM cells arranged in a “4 rows and 16 columns” pattern.
//That’s 64 RAM cells in total for every Bit on the data bus.

Each RAM cell contains a conventional RS flipflop (built from two FETs and two pull-up resistors (FETs)),
plus two FET switches (controlled by the column select signals) connecting the RS flipflop to the row signals
RAM_ROW and RAM_ROW# during PHI2.

At the Western corner of the RAM block, we have pre-charge FETs switching the RAM_ROW and RAM_ROW# signals
for every line of RAM cells to VCC during PHI1, switches have an impedance which makes them act like pull-up resistors.
//That’s 8*4*2 = 64 pre-charge FETs in total for 64 Bytes of RAM.

RAM cells are read/written only during PHI2.

East of the column decoder plus drivers, we have the row decoders plus drivers,
and except that they are fed with A5i and A6i (A5i# and A6i# respectively),
conceptually they are not much different from the column decoders plus drivers.

They control 4:1 multiplexers East of the RAM cells.
For every Bit on the data bus, we have two 4:1 multiplexers,
one connecting the RAM_ROW signals from four rows of RAM cells to the read/write driver/buffer of a data Bit,
the other connecting the RAM_ROW# signals from four rows of RAM cells to the read/write driver/buffer of a data Bit.

//One row has 16 RAM cells.

Note, that the multiplexers are just FET switches, and that signals can go through said switches in both directions.

To be more precise:
When reading RAM cells, signals from the RAM cells to the read buffers go through the multiplexers from West to East.
When writing RAM cells, signals from the write drivers to the RAM cells go through the multiplexers from East to West.

According to A5i and A6i, the multiplexers are selecting the rows in the pattern:
00
01
11
10
But since all of the RAM cells are identical, we can safely ignore this.

Now for the read/write drivers/buffers.

West of the multiplexers we have the RAM cells, East of the multiplexers we have the read/write drivers/buffers.
At the read/write driver/buffer side of the multiplexers, we have two FETs,
precharging RAM_ROW and RAM_ROW# of said read/write drivers/buffers to high during PHI1.

On the write side, we just have a “differential” push/pull line driver, fed by a Bit on the write data bus D0..7w (high_active).
The driver outputs are enabled when RAM_W is high, during PHI1=0 (what is different from “PHI2=1”),
setting the RAM_ROW and RAM_ROW# signals of the selected row of RAM cells through the two 4:1 multiplexers.
;
PHI1 and PHI2 are not overlapping, the line driver outputs are enabled during PHI1=0,
so that RAM_ROW and RAM_ROW# at the RAM cells are valid before the rising edge of PHI2.
//The RAM cells connect to RAM_ROW and RAM_ROW# during PHI2.

On the read side, we have a RS flipflop which is brought into a controlled state during PHI1,
and flipped (or not flipped) by the RAM_ROW# signals from the RAM cells during PHI2.
;
The side of the RS flipflop which is switched to GND during PHI1 goes through an inverter,
then into a two input NOR gate together with RAM# (low-active RAM enable signal which changes during PHI1).
The output of that NOR gate drives a FET which pulls a Bit on the read data bus to GND, and that’s all.
;
To be more precise:
The output FET can’t pull a Bit on the read data bus to GND during PHI1,
because the side of the RS flipflop that goes through an inverter into the NOR gate controlling the output FET
is switched to GND during PHI1.

20 ROM

6530 contains 1024 Bytes of mask programmed NOR ROM.


From North to South,
we have the ROM address decoder, the column select signal drivers, then the ROM cells,
then the FETs which discharge the colum select signals by switching them to GND during PHI1.

North in the ROM block, the column address decoder is fed by A0..5i (A0..5i# respectively).
It’s a PLA like structure of 64 six input NOR gates.
Note, that the pull-up resistor for every NOR gate is not tied to VCC directly, but only during PHI1.
To be more precise, we have FET switches controlled by PHI1, and the impedance of the FETs is working as a resistor.
//From West to East, the NOR gates check from 000000 to 111111, it’s linear.

South from the column address decoder, we have the column control signal drivers:
64 transparent latches, sampling the outputs of said NOR gates during PHI2,
control 64 FET switches, which connect one of the sixteen column select signals to PHI2.
Means, only one column select signal is active at a time.

At the Southern corner of the ROM block, we have FETs switching all of the column select lines to GND during PHI1.

//The game isn’t much different from what we had in the RAM block so far.
ROM cells are organized in eight parts, for D0..D7,
starting with D0 South of the column control signal drivers, followed by D1, and so on.

In each of the eight D0..D7 ROM cell areas, we have 16 mask programmed NOR gates, one gate per row,
with up to 64 inputs each (which connect to the high_active column select signals).
Mask programmed means, that an input transistor of the NOR gate connecting to one of the 64 column select signals
is present or missing.

Mask programming was done by changes in the diffusion layer, like in “12) PLA”.

If the transistor in a NOR gate connecting to a column select signal is present,
said NOR gate emits 0 when the column select signal goes active (high) during PHI2.

Transistor present: Data Bit is 1.
Transistor missing: Data Bit is 0.


Like in the column address decoder, the (up to) 64 input NOR gates don’t have a pull-up resistor
which is tied to VCC directly/permanently, but only during PHI1.
To be more precise, we have 8*16 = 64 FET switches controlled by PHI1,
the row pre-charge FETs, and the impedance of the FETs is working as a resistor.

If you take a closer look at the PLA like structure of the column address decoder,
and rotate it by 90 degrees clockwise, it looks pretty much like the ROM cells, doesn’t it ?

East of the column decoder plus drivers, we have the row decoders plus drivers,
and except that they are fed with A6..8i (A6..8i# respectively),
conceptually they are not much different from the column decoders plus drivers.

They control two 8:1 multiplexers West of the ROM NOR gates per Data Bit.
Each of the 8:1 multiplexer inputs is fed by the outputs of 8 ROM NOR gates.

The outputs of the two multiplexers go into another 2:1 multiplexer controlled by A9i (and A9i# respectively),
which then gives the signal to a read buffer for every Bit on the data bus.

Note:
The multiplexer for the second 8 rows of NOR gates has the inputs in reversed order.
From North to south, the selection of ROM NOR gates according to A6..9i actually is:
0000 up to 0111, and then 1111 down to 1000.

Now for the ROM read buffers.

The game is very similar to the read buffers in the RAM.

Outputs of the two 8:1 multiplexer and the 2:1 multiplexer are pre-charged by FET switches
(with some impedance to make them work as pull-up resistors) during PHI1.

Again, we have a RS flipflop which is brought into a controlled state during PHI1,
and flipped (or not flipped) by the output of the 2:1 multiplexer during PHI2.
;
The side of the RS flipflop which is switched to GND during PHI1 goes through an inverter,
then into a two input NOR gate together with ROM# (low-active ROM enable signal which changes during PHI1).
The output of that NOR gate drives a FET which pulls a Bit on the read data bus to GND, and that’s all.
;
To be more precise:
The output FET can’t pull a Bit on the read data bus to GND during PHI1,
because the side of the RS flipflop that goes through an inverter into the NOR gate controlling the output FET
is switched to GND during PHI1.
Just one more word about the output FETs of the RAM and the ROM, switching the read data bus to GND.

It’s an incredibly compact design, and for most of the Bits on the read data bus,
the output FETs of the RAM and the ROM are close together, forming a big NOR gate.

Letter from Bill Mensch on the creation of the 6530

Bill Mensch wrote:
I would be happy to contribute some commentary concerning the creation of the 6530 at MOS.

What are you interested in other than it was the second chip for the combination of the 6502 for use in control systems.
The KIM-1 was a reference design/use case for bothe the 6502 and the 6530, actually two of them.
One 6530 was for the “Teletype Input Monitor (TIM)” and the other one was for the “Keypad Input Monitor (KIM)”.

It was first demonstrated along with the 6501/6502 at the WESCON ’75.
The 6502 and 6530 were ment to compete with the $29 Intel 4040 two chip controller combo.

The actual design was important for the introduction of the 6502.
I and a team of three mask designers Harry Bawcom, Mike Jaynes and Sid Holdt created the 6530.
The timer design was patented and used on the 6530, 6531 and 6532 chips.

Chuck Peddle and Wil Mathys contributed the system level applications concepts and requested the features.
We were a small team. I was the semiconductor design and architect engineer.
The 6530 followed many of the design concepts of the 6820/6520/6821/6520 concepts for IO and interrupt features.

The 6522 followed the 6520/6530/6532 designs at MOS.

Ray Hirt was the project lead on the 6532.
The 6532 RIOT design was basically to remove the ROM and add another 64 bytes of RAM for a total of 128 bytes.
I was the microprocessor design manager at this time replacing Rod Orgill who had left MOS to work at NCR in Colorado Springs, CO.
Rod didn’t work on any of the IO chips, just the 6501/6502.

Ray, Rod, sometimes Wil and I shared many a pitcher of beer at many lunches after the 6502 and 6530/32 were completed before Rod left for Colorado.
These are fond memories of my time at MOS.

Let me know if you have any questions.

Best,
-Bill

6530-004 decapped

EagleCAD schenatics archive download

Imported in Kicad, exported as SVG images on this page:

Logic concept

Clock Generator

Reset
RS0

A0

A9

CS1 Latch

RW
< PB7 driver/buffer a href="http://retro.hansotten.nl/wp-content/uploads/2021/11/6530-004_dissect_9-6530-004_dissect_9.svg">


PB6 driver/buffer

PB0 driver/buffer

PLA

Some logic

I/O control

I/O logic, Bit 7

Timer control

Predivider

Timer (don countyer)

RAM row buffer/driver

ROM

KIM 6530 to 6532

Replace the 6530-002 and -003 in a KIM-1: a KIM-1 clone.

The base for all ‘modern’ KIM clones, KIM reproductions, MICRO KIM, PAL-1 and more.

Credits to Ruud Baltissen for the idea and details. ‘I’ means Ruud in this page!

RRIOTs are mask programmed for address selection, choices are:

Pin 18 PB6 or CS1
Pin 19 PB5 or CS2
Pin 17 PB7 can have a pullup
ROM selection on RS0, CS1 und CS2 s
RAM on RS0, CS1, CS2, A9, A8, A7 and A6
I/O on RS0, CS1, CS2, A9, A8, A7 and A6
See the various 6530/6532 datasheets for (some) more detail.

The troublemaker: 6530, detailed background information

The KIM-1 has two 6530s on board. For more info about this IC, please read the datasheet. Anybody who is a little bit familiar with the hardware market can tell you that you cannot buy the 6530 anymore. Happily enough there is another IC available which you could call its brother: the 6532. The 6532 has 16 I/O-lines, an internal timer and 128 bytes of RAM on board, but no ROM. The internal ROM of the 6530 can be selected independently from the I/O. So 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.

The next difference is the fact that the 6532 has a separate IRQ and PB7 line. As we will see, the functionality of both lines is the same as with the 6530. To create the same circumstances we only have to connect them together.

The third difference is the availability of PB6 with a 6532. See it as a bonus as I haven’t found any reason how it could jeopardize our project.
The fourth difference is that it is possible to generate an interrupt depending on the behaviour of PA7. But this is an option, which is out of function by default after a reset.

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 6532 is only visible within a range of 128 bytes
  • The first 16 bytes represent register 16 to 31
  • The next 48 bytes are mirrors of the first 16
  • The last 64 bytes appear as RAM

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 an inverter.
  • A 74LS138/74LS08 construction or equivalent enables the RS- and CS-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 expansive then the 2764 or its bigger brothers. When we use a bigger EPROM we only have to tie the unused address lines to GND. The same problem occurs with the RAM.

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. (Don’t forget the address lines!) In case of the EPROM we also can tie switches to the surplus address lines and have the advantage of a multi-KERNAL system.

Schematics of the new KIM-1

What are the major differences with the original circuit:

  • Replacement of the 6530s by 6532s.
  • Replacement of the 6108 RAM-ICs by one 6264 or equivalent 8K*8 SRAM.
  • Adding an EPROM.
  • Adding a 74LS138 to decode the RAM and I/O of the 6532s.
  • Combining K6 and K7 to one line, dropping the resistor for K6.
  • Adding jumpers to enable combining other K-lines as well.

You may notice that Ruud did not change things which are more or less obvious like replacing the clock circuit by a module or replacing the various 74XX TTL-ICs by their LS or HCT equivalents.

6530’s KIM-1 specification

(Thanks to J Coville)
Back in the day, a designer ordering a custom 6530 would have to specify certain parameters in addition to the ROM contents. During my KIM-1 restoration effort, I found a datasheet for the Synertek version of the part. The datasheet has quite a bit of information describing how to provide the ROM contents. There is also a form for “Additional Pattern Information” (tables to describe the desired chip-select and addressing information). They look like this:

Chip Select Code (Check one square in each block)

CS1
PB6
CS2
PB5
Pull-up on PB7
YES
NO

ROM/RAM/I-O SELECTS (Specify H or L or N (don’t care) in each box.)

RS CS1 CS2 A9 A8 A7 A6
ROM Select N N N N
RAM Select
I/O Select

As best as I can determine, the designers of the KIM-1 filled out the tables for the RRIOTs like so:

6530-002:

CS1 X
PB6
CS2
PB5 X
Pull-up on PB7
YES
NO X
RS CS1 CS2 A9 A8 A7 A6
ROM Select L H N N N N N
RAM Select H L N H H H H
I/O Select H L N H H L H

6530-003:

CS1 X
PB6
CS2
PB5 X
Pull-up on PB7
YES
NO X
RS CS1 CS2 A9 A8 A7 A6
ROM Select L H N N N N N
RAM Select H L N H H H L
I/O Select H L N H H L L

In a KIM-1, K5 is asserted low by addresses 1400-17FF. It is connected to the CS1 lines of both the 6530-002 and 6530-003. A9 and A8 need to be 1 for all I/O and RAM, and A6 and A7 determine which chip and I/O or RAM you get:

0001 0111 00XX XXXX = 1700 – 173F = 6530-003 I/O
0001 0111 01XX XXXX = 1740 – 177F = 6530-002 I/O
0001 0111 10XX XXXX = 1780 – 17BF = 6530-003 RAM
0001 0111 11XX XXXX = 17C0 – 17FF = 6530-002 RAM

The RS lines are connected to different select lines, K6 for 6530-003 and K7 for 6530-002, this gives:
0001 10XX XXXX XXXX = 1800 – 1BFF = 6530-003 ROM (1k)
0001 11XX XXXX XXXX = 1C00 – 1FFF = 6530-002 ROM (1k)

All these values agree with the KIM-1 memory map documentation.

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 = output lines from 74145