Tuesday, March 27, 2018

Sega CD Model 2 Repair Notes

From time to time I like to fire up my disc based systems to keep the grease viscous and make sure everything is in good working order.  Well last night I fired up my Model 2 Sega CD and discovered that all was not well.

The disk tried to spin up and this horrible grinding and scraping noise came from the drive.  After several attempts the disk finally loaded, but it was painful and I shut it off immediately to prevent damage.  I managed to do some damage getting the silly thing apart, but everything is back in working order now.

Problem: Grinding

The grinding noise from a Sega CD Model 2 is evidently a pretty common issue.  There's a laser limit switch which the system uses to tell that the laser assembly has reached the center of the CD spindle.  Over time this switch stops working as desired.  The switch is essentially just two thin strips of copper inside a plastic shell.  When the sled touches the switch, the two strips are supposed to make contact and inform the mechanism to stop the motor.  Most people seem to think this switch gets bent out of shape from repeated use, and they will gently "bend" it back into place so it begins working again.  While that definitely works, I believe oxidation is also a factor, so I also used a pipette to drop a dab of Deoxit into the switch for good measure. 

Solution

Gently bending the limit switch "forward" for a few seconds and applying a drop of Deoxit cured the grinding problem.


Problem: Scraping

After I got everything back together and got the drive spinning again, I noticed there was a persistent scraping/scuffing noise.  At first I thought this was some issue with the magnetic clamp on the drive door.  (There's a circular magnet on the door which helps to lock the CD in place when the door is closed).  With the top of the CD unit removed and the magnetic clamp attached independent of the door, everything seemed to work normally, however when I reassembled it, the scraping persisted.  I eventually noticed that if I held the unit upside down while it was reading the disc, that the noise disappeared.  Upon closer examination, the CD drive landing was almost flush with the disc well.  This was causing the disc to scrape the well.  I noticed too late it was scratching the disc - my copy of Ecco Tides of Time now has a ring scratched in it :( It was also causing the magnetic clamp to scrape inside its assembly.  The problem was caused by the four rubber shock dampening grommets that hold the CD drive in place.  They were simply too old and had mostly collapsed, causing the CD assembly to sit too low.  Since I could not find replacements for them, I did the next best thing and rigged it.  

Solution

I cut some crude plastic washers out of some large heat shrink tubing and placed them on top of each of the four shafts that hold the drive in place.  This gave the collapsed rubber grommets enough support to lift the drive correctly. When it was reassembled the drive plane was now sitting about 2mm above the disc well, giving the disc plenty of clearance to spin freely.  In hindsight, I think leaving a disc in the drive may have contributed to the collapse of the original grommets, so I would recommend leaving the disc drive empty when not in use.


Problem: Door Switch

I'm not sure if this one is self-inflicted or not, but when I got everything apart, the door switch was twisted.  My recommendation here is to always take the top of the unit off with the door open.  Doing so with the door closed means that the top is contacting the door switch as you're working it off.  The reason I'm not sure if I did this was because the bend looked old, if that makes any sense.  

Solution

I ended up removing the clear plastic cover of the door switch and gently bending everything back into place. (To remove the cover you need to use a thin tool like a small screwdriver shaft to press the back of the cover forward while you pull it up away from the board).  It took quite a lot of trial and error to get it bent back to working normally again, so, like I said, always take the top off with the door open.


Problem: The System says "Checking Disk" but the drive is lifeless

This happened sort of in the middle of all of the troubleshooting and taking apart and putting back together.  The short version of the story is that the "Checking Disk" message appears when the system cannot communicate with the drive.  About the only way to tell this is what's going on is that "Checking Disk" stays on the screen even when the door switch indicates that the drive door is open (so it shouldn't be checking anything).  It took me a little while to figure out what had happened, but the system was extremely dusty when I disassembled it.  Evidently a piece of fuzz had gotten into the connector and was preventing good contact.

Solution

I ended up blasting the ribbon connector slots on both the mainboard and the CD drive with Deoxit and allowing them to dry completely (about 5-10 minutes).  After reconnecting everything the system started telling me to close the drive door again - which meant it was talking to the CD drive again.

Friday, March 16, 2018

Review: NESRGB Mod on an AV Famicom

Short story long, most 80's and 90's era game consoles used off-the-shelf integrated circuits for video/picture processing, and most of those integrated circuits generated RGB as well as composite video.  As a result, even when the console manufacturers didn't bother to connect the RGB lines, RGB could still be enabled by tapping the RGB lines from the IC directly and connecting an amplifier to drive them.  The best example of this is the Turbo Duo/PC Engine Duo.

When it comes to the NES/Famicom, things become a bit more interesting.  Nintendo used a custom "PPU" chip to drive video, and as a result, RGB is not exposed, and can't simply be "tapped and amplified".

Enter the NESRGB.  Rather than trying to tap RGB from somewhere on the board, the NESRGB actually hijacks the entire PPU chip. You literally have to desolder the PPU from the board and place a device in between it and the system.  I mean, look at this thing, it's crazy.



NES RGB Mod - the whole light-green PCB in the middle with all of the wires coming off of it is the mod.  It's about 1/3 the size of the whole mainboard!

My grasp of the science going on with this thing is somewhat rudimentary, but the gist of it is that the NESRGB board is intercepting certain signals from the CPU and generating its own picture in RGB space.

Which Console To Mod?

The NESRGB kit is pretty universal, so it can be applied to pretty much any version of Famicom/NES that I'm aware of.  I made my decision based on two things.

1. I did not want to cut plastic.  The NES does not have a suitable port to output RGB.  The common solution to this is to add such a port.  Classically this has meant drilling a hole and mounting a mini-din 8, but more recently this has shifted towards installing a multi-out matching the SNES/N64/Gamecube port to maintain compatibility with existing cables.  While this is a good solution, it still involves cutting plastic.

2. The Famicom has additional sound capabilities not enabled in its international counterparts.  I'm fuzzy on the specifics, but certain games contain their own sound chip used to add additional channels of "high quality" sound.  There aren't a ton of games that have it but it's used by some major ones like Doki Doki Panic (the original game from which the western version of Super Mario Bros. 2 was made), Zelda No Densetsu (The Legend of Zelda), Akumajou Densetsu (Castlevania III: Dracula's Curse).

So I settled on the AV Famicom, because it's the only one of any of the versions of the console which already uses the Nintendo multi-out connector, and it happily happens to support the FM sound from the cartridge.

The Instructions

https://etim.net.au/nesrgb/installation-famicomav/

Tim Worthington - the guy who developed the NESRGB mod, has put up very nice instructions on his website.  This is the most complex mod I've ever attempted in terms of invasiveness and the sheer number of points that have to be touched. For the most part the instructions are great.  Just read them thoroughly...

RTFM

The first problem that I encountered was my own failure to read the instructions.  One of the very first things you need to do after desoldering the PPU from the board is fitting an IC socket in its place.  Before actually soldering anything together, you're advised to insert pin-strips into the adapter board and then plug them into the socket - by waiting to solder anything until it's all pushed together, you make sure the pins are properly aligned for when you need to unplug and replug the board into the socket later.  The problem is that there are two different kinds of pin strips provided - round ones and square ones.  You want to solder the round ones to the adapter board in this step, but the square ones come taped to the adapter board - which confused me.  This took me a while to figure out but it was clearly spelled out in the instructions.

Palettes? What?

A palette in this context is the complete set of colors that the NES can produce.  There are a total of 64 colors in that palette.  Because the PPU is generating these colors internally in composite space there is no (good) direct translation to RGB.  The actual values of those colors have to be reverse engineered.  My understanding is a little fuzzy on what the specific challenges are but the short version is that games don't look right if the pallet isn't right, and it's difficult to get RGB to match the look of the original composite output of the NES.  Because opinions vary on the correct approach, the NESRGB provides multiple options and comes with a switch which you can wire up to change between three pre-loaded palettes.

The Business End

The instructions are a little vague when it comes to wiring up video output connections and what cables to use.

TTL vs 75 ohm (What Cables You Can Use)

The instructions make reference to the need to use Gamecube SCART cables.  This was not explained very thoroughly, but it basically comes down to the signal strength being driven on the output lines.  My understanding of this is also somewhat limited but from what I've been reading, TTL is a lower voltage output level, whereas "75 ohm" describes a higher voltage output level.  The SNES outputs video at the higher voltage level, so it's necessary to add resistors and capacitors to the output lines to bring the signal back down to TTL before it gets connected to the display.  Evidently the Gamecube outputs TTL, so the SCART cable made for it is a straight connection without resistors and capacitors - ergo the recommendation to use Gamecube cables.  It seems like Tim had enough requests to accomodate 75 ohm output that the current versions of  NESRGB default to 75 ohm output making them compatible with SNES cables.  You now have to solder a jumper closed to change to TTL output.

I understand why 'TTL' is recommended/preferred - because it seems silly to ramp up the voltage, only to ramp it right back down at the plug end, but cable compatibility is more important to me so that's the method I went with. 

Edit: Evidently my understanding of TTL was backwards.  TTL actually refers to a higher voltage level - around 5Vpp (5 volts peak-to-peak) whereas ideal 75-ohm output is closer to 700mVpp (.7 volts peak-to-peak).  Setting the output to TTL requires capacitors and resistors in the cable to pull the voltage down to the correct levels.  If you output 75 ohm and have capacitors and resistors in the cable, you're needlessly diminishing the signal.


Sync

In one part of the instructions it vaguely refers to cutting the original composite video trace...or not.  It doesn't really explain what this decision means - probably because this should be obvious.  It was not obvious to me.

AV-pinout2_small.jpg (19568 bytes)Firstly the point of this step is to disconnect the original signal path of composite video.  I *thought* this was because the original composite video was still being driven and you don't want to push two signals at the same time.  So the first time I tested this, I did so by just connecting the R, G and B lines and leaving the original composite video path intact.  With a composite cable, the picture was the wrong color and missing elements.  From some additional reading on the way the NESRGB works, there is evidently some "dummy" data being passed into the PPU to make it behave normally and I *think* that's what I was seeing - so while there was still a picture of some description, it definitely wasn't right.

Next, I desoldered one leg of resistor R106 (this should have the same effect as cutting the trace but it's reversable) and then connecting the composite video line from the NESRGB to the output port.  The result was a perfectly normal looking output with composite video cables.

When I tried to connect an RGB SCART cable to with just these four lines connected, it resulted in a wavy distorted picture, and it took me a little while to figure out why. (Hint: I was using a Sync-on-Luma cable).

In the instruction images you only see the R, G, B and Composite video lines connected, and this is exactly what I did.


From the instructions on Tim Worthington's Website


I knew the wavy distorted picture was happening because of a lack of sync signal, but I didn't immediately understand why.

I had 3 different SNES SCART cables and I was fortunate enough that all three of them used a different method of obtaining sync - fortunate because one of them actually worked when I tested it, and that was the breadcrumb I needed to figure out what was going on.

If a video signal is a single long line of pixels, the sync signal is a timing pulse which explains to the display how to assemble it into a rectangle.  One part of the pulse tells the display when to start the first line at the top of the display, the next tells it when it has reached the end of a line and to start drawing pixels on the next line down.  This requires two types of signal - horizontal sync and vertical sync.

In composite video, the horizontal and vertical sync signals are mashed together with the color and light/dark information.  In S-Video, horizontal and vertical sync are carried on the Luma (Y) channel along with the light/dark information.  Pure RGB has the option of a separate conductor dedicated just to the horizontal and vertical sync - confusingly, this is called "composite sync" (c-sync).  It's called "composite sync" because it is composed of  both horizontal and vertical sync in a single signal, whereas composite video gets its name from the fact that it is composed of the color, light/dark and sync information all combined into a single channel.

Since the sync signal should theoretically be the same no matter how the video is being transmitted, it's possible for RGB to draw sync from other sources when c-sync isn't available.  This makes for a total of three options for getting a sync signal for RGB:

Sync-on-Composite
The sync signal is taken from the composite video signal.  This is the least desirable method because it involves sending the whole composite video signal through the cable.  The composite video signal is "noisy" and can cause crosstalk with the other signals.

Sync-on-Luma
The sync signal is taken from the Luma (Y) S-video channel.  This is a sort of middle-ground as it's cleaner than composite. It's sending less additional information that might cause crosstalk, but it's still sending some.  It's necessary for systems that do not natively output c-sync (such as the original Playstation).

C-Sync
The dedicated sync signal is the cleanest way to get sync, but it's not necessarily available everywhere.

The NESRGB actually offers all of these connections, but the instructions showing only the four wires connected will only enable the worst quality option: Sync-on-Composite.


For reference: the Multi-out pins (Not an AV Famicom, but the pinouts are universal). Image taken from https://gamesx.com/wiki/doku.php?id=av:nintendomultiav

To enable C-Sync, connect the "CS" on the NESRGB to pin 3 (labeled S/12V).
To enable Sync-on-Luma (and S-video), connect the "Y" on the NESRGB to pin 7 (labeled Y) and "C" on the NESRGB to pin 8 (labeled C).

In the end I needed to connect 7 conductors to fully enable all output options.

Bottom of the mainboard.  All connection options wired up.
From the Left:
Brown: Composite Video
Red: S-Video Chroma
Orange: S-Video Luma
Yellow: RGB Blue
Green: RGB C-Sync
Blue: RGB Green
Purple: RGB Red


NESRGB end of the video out

Using Different Palettes


Tim doesn't provide instructions on his website for using additional palettes (at least that I could find), but instructions are available here: http://www.firebrandx.com/nespalette.html

(Update: I did eventually stumble across a page on Tim's website which describes how to flash firmware and swap in new palettes, but Google seems to be the only way to reach it - I couldn't actually find where it was linked from on the site itself: http://etim.net.au/nesrgb/background_fault/)

Basically, you need to connect to a custom J-Tag header on the NESRGB and use a programmer like an Altera USB Blaster to reprogram the EEPROM with the new palettes.

I happened to have some JTAG sockets lying around.  Since I'm not punching holes in the plastic, I just used a short segment of cable so the connector can be tucked inside the case.  I'm not going to be flashing palettes all that often.
JTAG socket wired up for USB Blaster


I also wired the toggle switch but left it internal in the case, covered in a plastic sleeve to make sure it doesn't cause any shorts.  This does mean that I have to open the case to switch palettes, but again, I don't plan on doing so very often.  With the amount of time and passion that FirebrandX put into his "Smooth" palette, I'm pretty sure I'm just going to leave it there, but it's good to have the option.

Final Thoughts


I'm pretty happy with the way this turned out.  The installation effort basically took me an entire day, but that was mostly because I've never done it before, didn't really know what I was doing, and my desoldering tools left a lot to be desired.  But the effort was well worth it.  NES/Famicom games never looked so good.  The main reason I did this was to be able to run it through the OSSC and play on a modern TV with perfect integer scaling, absolutely clean graphics and no perceptible lag, but it also cleaned up the image on my CRT displays.  It blows the NES classic out of the water.