Tuesday, March 26, 2019

Solder On! and KIM-2e Addressing

I wish I had fun things to report, but I am just doing tons of point to point soldering on the SUPERPROTO card, and the Keypad/LED main board.

Keypad/LED main board

In the meantime, I can describe some of the theory behind how the KIM-IIe card should work (click below to see the gorey details).

The address decoding in the KIM-2e is very similar to the KIM-1, except as indicated. First, KIM-1 addresses are not decoded until enabled by a 74LS175 flip-flop at Apple IIe address $C00n0 (n representing the slot # where the KIM-2e is located). The initial address decoder is a 74LS138, as used in several KIM-1 revivals. It enables the secondary decoder which is a 74LS145 as used in the KIM-1. In the KIM-1 the 74LS145 decodes memory as 8 blocks of 1K, labeled K0-K7. Now, you would probably never want a peripheral card to interfere with the Apple II's access to K0-K3 which are important memory locations, including zero page. So, instead of decoding A10-A12, the secondary decoder decodes A9-A11, and A12 is instead used as a positive enable for the primary decoder. The benefit is that we decode 8 blocks of 512 bytes (1/2 K), skipping the Apple II's K0-K3. Then, joining K4_LO, K4_HI, K5_LO, K6_LO, K6_HI, K7_LO, and K7_HI gives a ROM enable signal (if I get time to add the ROM), and K5_HI is the 6532 RIOT's low chip enable. When the ROM enable or 6532 chip enable are active, the onboard Apple IIe RAM is inhibited by pulling the !INHIBIT line low. As a result the KIM-2e will have an address map like this (the ROM will be in Apple II RAM for now):

  
Apple IIe
RAM, I/O, ROM
FFFF
"K" PAGE    2000

K7
31
30
29
28
   KIM
ROM
-002
(Apple IIe RAM)
1FFF


1C00

K6
27
26
25
24
   KIM
ROM
-003
(Apple IIe RAM)
1BFF


1800

K5_HI
23
22
   KIM 6532
RAM, I/O, Timer
17FF
1600
K5_LO
21
20
   Application
ROM (in RAM)
15FF
1400

K4
19
18
17
16
   Application
ROM
(Apple IIe RAM)
13FF


1000
  
Apple IIe RAM
0FFF
   0000

The 6532 RIOT at K5_HI is addressed the same as the KIM-1's 6530 RRIOTs, but we can take advantage of the lower half of K5 (K5-LO, 1400-15FF) for more application ROM. Compare this to the KIM-1 memory map:

...and you see that the important addresses are all the same, and we get a bonus 1.5K of application ROM decoded at K5_LO and K4.

This leaves us with 3 more flip-flops in the 74LS175 that can be addressed to swap in 8 (2^3) alternative 4K blocks of the 32K 27C256 ROM as provided by the SUPERPROTO card. This only wastes 4K of ROM (512*8) (where K5_HI is located) and saves us at least one IC to simplify the addressing.

Finally, I installed a jumper so that you can select which of the KIM's 6530's is being replaced by the one 6532 on the KIM-2e. This allows you to select if the 6532 is used for Application I/O or KIM-1 I/O (keyboard and display). This jumper selects whether to use A6 or an inverted A6 as the 6532's positive chip enable signal.

Shout out to Hans Otten and his awesome retro computing site with great KIM-1 User Manuals that I have been constantly using for reference.

No comments:

Post a Comment