Reverse engineering the Digital KC 4MB mapper

Page 1/2
| 2

By Omega

Master (233)

Omega's picture

26-01-2015, 21:21

Hello fellow hardware enthusiasts,

Last weekend I've managed to repair my broken 4MB memory mapper cartridge. It failed due some kind of RAM problem so the MSX couldn't boot when it was inserted. This story is about the repair process and I hope some people find this information usefull some time in the future Smile

First of all it's usefull if you have a device to switch off a slot/cartridge because otherwise it's required to insert the cartridge in a powered system to do diagnosis. My best guess at this time was that one or more of the DRAMs had failed, so I would need to narrow down exactly which ones.

To that purpose I firstly used the tool "testmap 4.2". This revealed that the bank switching logic was working correctly, but it found an error immediately after starting the bit/address test. However the output of testmap, while showing expected value and actual value, was not specific enough: I didn't know which RAM pages were affected because the tool stops after the first error found.

So I wrote a small basic program to assist me with that. It's quick and dirty and not properly written at all, please bear with me Wink

10 'POKE&HC000,0:POKE&HF676,1:POKE&HF677,&HC0
20 DEFINT A-Z:SLOT2=&B11100000
30 OUT&HA8,SLOT2:PAGE=0
40 PRINT "page: "PAGE"   ";
50 OUT&HFE,CINT(PAGE)
60 TE=&H0: GOSUB 200
62 'TE=&HFF: GOSUB 200
64 'TE=&H55: GOSUB 200
70 PAGE=PAGE+1:PRINT:IF PAGE<255THENGOTO40
80 END
200 ADDR=&H8010:POKE ADDR,TE: RESULT=PEEK(ADDR):IF RESULT <> TE THEN BEEP: PRINT "error "HEX$(TE)" <> "HEX$(RE)" ";:ELSE PRINT "ok. ";
201 RETURN

How it works: first execute the commented line 10 pokes to relocate BASIC start address then load the .bas again. Then run and it'll switch page &H8000-&HBFFF to SLOT2 (insert mapper in SLOT2!) and cycle through all mapper pages in SLOT2 while writing and comparing a test value to each page. Lines 62-64 test with other bit patterns optionally.

This revealed that mapper pages &H0-3F were showing errors in bits 4,3,2 while all pages &H40 to &HFF were perfectly working fine. So hopefully this provided me with enough information to narrow it down to one specific DRAM.

But now.. I couldn't find schematics online for this type of mapper. So the next step was reverse engineering (part of) the schematic by continuity tracing. Here goes the results...:


hires


hires

There you go! After investigating the connections I was puzzled at first because unlike other RAM systems that I've worked on, this one did NOT select the various RAM banks using the /RAS signal. After comparing all DRAM pin signals to eachother it occured to me that this design selects the banks using the /OE and /WE pins because all address lines and /RAS and /CAS were interconeccted between all 8 DRAMs.

Thinking of it it seems like a quite genious design because this eliminates additional refresh logic to perform refresh correctly. Now the mapper can refresh all DRAMs at once using CAS before RAS or RAS only refresh. For details on DRAM refresh operation refer to here.

So I've replaced the 1Mx4 DRAM on position D0-D3 on bank 0 and voila! One fully functional 4MB mapper B-)
The actual replacement process is basic SMD soldering. The old part I've carefully cutted the legs off using a sharp blade. Trying to desolder a SOJ ic without chip-quick or hot air gun is going to damage the pcb traces, so don't even consider it. Then cleaned off the leg remains and wicked old solder and cleaned with isoprop alcohol. Then added a tiny amount of fresh solder to the pads and a generous amount of flux. Put on replacement part and drag solder the pins to the pads. Unfortunately the part moved for 0,5mm during drag soldering but all pins were making proper contact and I didnt want to risk damaging the pcb so I've left it on there a little tilted. Always check all connections with multimeter and visually for shorts or debris and clean with isoprop afterwards the excessive flux away.

Saga concluded! I hope you enjoyed it ;)

Cheers!

Login or register to post comments

By Lord_Zett

Paladin (807)

Lord_Zett's picture

26-01-2015, 21:41

nice work omega!

By Omega

Master (233)

Omega's picture

26-01-2015, 22:43

A note: The basic program assumes the system booted with RAM in slot 3, adjust the SLOT2 value to your needs Wink

By Grauw

Ascended (10819)

Grauw's picture

26-01-2015, 23:09

Nice Smile.

Omega wrote:

The old part I've carefully cutted the legs off using a sharp blade. Trying to desolder a SOJ ic without chip-quick or hot air gun is going to damage the pcb traces, so don't even consider it. Then cleaned off the leg remains and wicked old solder and cleaned with isoprop alcohol.

Hmm, so removing the solder with wick and then picking it up with tweezers won’t work? Anyway I’ll have to remember that. I do have a tube of chip-quick, but not the special solder alloy that Youtube tells me it needs to be used with, hm-hm.

By Omega

Master (233)

Omega's picture

28-01-2015, 17:57

Grauw wrote:

Hmm, so removing the solder with wick and then picking it up with tweezers won’t work? Anyway I’ll have to remember that. I do have a tube of chip-quick, but not the special solder alloy that Youtube tells me it needs to be used with, hm-hm.

Chip-quick IS the special solder alloy which melts at a lower temperature than regular solder and stays molten for about 10 seconds after heating. You dont need special flux with that, any injection needle type flux or flux pen will do.

If you take a look at the physical form of a SOJ package:

I've tried to wick the solder away using plenty flux + wick from the right side in the picture, but its very difficult to apply enough heat to the entire pad plus leg. And applying too much heat + mechanical force means the solder pad can let loose and that you do not want to risk..

So in the case where you're pretty sure the part is bad, cut it off! With DIP ics thats easy with a sharp cutting plier, most kinds of SMD pins can be cut with a sharp knife.
This takes only one or two minutes and is much safer to the PCB. :)

If the PCB is just some donor board you dont care about (i got the dram from a donor), you can just apply mechanical force upwards, heat the pins on either side until you hear them spring loose (or the pad breaks off) :)
The part will survive, the board not so much ;)

By Grauw

Ascended (10819)

Grauw's picture

28-01-2015, 20:23

Aha, good to know! I saw a Youtube guide where they also applied a special brittle type of solder to the contact, but maybe that was a different type of quick.

And re. SOJ; I see, I didn’t know pins like that existed, not really convenient for desoldering indeed (maybe designed to prevent it? Smile). I was thinking about SOP packages, I think those would be wick-able, at least the ones with not so many pins.

By Omega

Master (233)

Omega's picture

28-01-2015, 21:23

The ones with not so many pins also I would recommend just using a big blob of solder on either side. If no chipquick available add plenty fresh solder until there's a big blob covering all pins, then heat both sides quickly alternating until the ic lets loose without using any force Smile Or use two soldering irons. Wicking will remove surface solder but some pins would still stick to the pad, I'm afraid..

By Grauw

Ascended (10819)

Grauw's picture

28-01-2015, 21:28

A-ha, educational Smile.

By RetroTechie

Paragon (1563)

RetroTechie's picture

29-01-2015, 14:39

There's 2 capacitors missing in 1st photo (upper right part), I suggest adding those. 2x ~100 nF SMD ceramic is very much NOT excessive to filter the supply for 4 DRAMs...

Back in the days I used a sharp pocket knife to cut / work my way between pcb and J-leads (alternating between sides of each IC). Which always got IC's off in good shape. But that's for the case you want IC's and toss the pcb (DRAM module) afterwards.

For this job I'd always take the "cut IC legs and clean up remains" route. It's soooo easy to damage pcb tracks if you combine (prolonged?) heat, extra solder or wick, and mechanical force / cutting tools. Cut near where legs enter the IC body, a sharp knife will do. And certainly in this case, it's not like 1Mx4 bit DRAMs are expensive or hard to find... Smile

By Omega

Master (233)

Omega's picture

30-01-2015, 21:02

Agreed with RetroTechie Smile

*checking parts stock*
Found 100nf 1206 caps.. Will install them Smile
Strange thing is, the bottom of the PCB has no decoupling cap positions for either the DRAMS or the ttl logic. The pcb is also hand soldered, with 3 different kind of 1Mx4 DRAMs probably taken from SIMMs Wink They didnt clean off residual flux either, which i've done after taking these pics, looks so much cleaner now.

By Grauw

Ascended (10819)

Grauw's picture

12-05-2019, 20:17

Omega’s Digital KC 4MB mapper:


Grauw’s Digital KC 2MB mapper:


Note that on my mapper the labels have been filed off the ICs. Luckily this is not the case on Omega’s board, and the board layout is roughly the same so you can cross reference it. Also note that the DRAMs that Omega marked as banks 0 & 1 are missing, this is because mapper register bit 7 is fixed high on the 2MB model so it always selects the upper half.

To supplement Omega’s findings: the two 74HCT670 ICs on the back together form the mapper registers.

Page 1/2
| 2