Blown CIAs

Started by BigDumbDinosaur, January 03, 2008, 04:14 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

BigDumbDinosaur

Earlier, there was a query of sorts as to why CIA chips fail.  Most people who have used a C-64 or C-128 have undoubtably encountered at least one instance where a CIA chip partially or completely failed.  Symptoms include a partially or completely dead keyboard, no fake RS-232 output at the user port and no tape functions.  In the case of the 128, CIA #1's serial data port is the fast serial driver, and if CIA#1 goes south, that function will go with it.

CIA #1 is charged with scanning the keyboard and joystick ports.  Failure of any of CIA #1's data lines will cause loss of operation.  Damage to the CIA can also affect the 16 bit interval timers and/or the TOD clock.  Timer A in CIA #1 of a C-64 is critical, as without that timer, there will be no timer A interrupt, which means the jiffy IRQ responsible for scanning the keyboard will not be present.  Applying a logic probe to CIA #1's /IRQ line will quickly indicate if the jiffy IRQ is present, as the required CIA #1 setup is performed early on during system boot.

The majority of CIA #1 failures are caused by static discharge into one of the joystick ports due to the user touching one or more pins.  Most often, the process is one of attrition rather than outright failure.  Each discharge slightly weakens the chip's core until the CIA converts itself from a semiconductor to a full-time conductor.

It is also possible for a serial bus device connected to the 128 to take out CIA #1 by damaging the SP connection inside the chip.  Although SP is used only when a so-called fast serial device is present (e.g, a 1581), a failure in any serial device can be the culprit, since SP is linked to the serial bus' data line.  In the early days of the 128, it was discovered that some of the less well-engineered serial to parallel printer interfaces caused damage.

CIA #2 is susceptible to damage from transients off the serial bus, and at the user port, since many of the data lines, as well as /FLAG and PC, are brought out there.  Some of the early Commodore modems were reputed to backfeed telephone line transients into the user port, taking out the entire computer.  This was apparently the result of using very cheap components in the modem.  The lack of line driver buffers exposes CIA #2 to damage.  Also, accidentally applying an input voltage to a data line set for output and currently holding a zero bit can cause failure in some cases, as the CIA will futilely attempt to sink a line that is delivering too much current.

In the 128, a CIA #2 failure can disrupt the 40 column video, since that CIA is responsible for determining the current RAM video bank being seen by the VIC-II.

Bottom line is that if a CIA goes south in your 64 or 128, look very carefully at what is connected and where your fingers go when you are reaching for the power switch or reset button.  Also, watch out for crud coming in off the power line.  None of the Commodore power supplies do a particulary good job of filter line transients -- the C-64's power supply is almost useless in that regard.  Using a small UPS to power your system is a good idea, if not to avoid data loss when the power fails, to avoid damage when the power goes flaky.

:-)
x86?  We ain't got no x86.  We don't need no stinking x86!

airship

Thanks for that insightful analysis, BDD.

If Commodore had put a couple of 10-cent buffer chips on each of the CIA ports (total cost: 80 cents) we wouldn't have this problem. But when did Commodore ever do something right when they could save a few cents by doing it wrong?

Be aware that these things often get very, very flaky before they fail completely. I've got one that works fine until my C128 warms up. That can take anywhere from 10 minutes to 2 hours. I's going to have to get out the spray freeze to find that one.
Serving up content-free posts on the Interwebs since 1983.
History of INFO Magazine

Mark Smith

So what can be done to toughen up the old Commodores then ?  Are there any steps we can do now to get an extra 25years+ of use out of them ? :-)

Airship mentioned that put some buffers before each CIA would help, how would that be done ?

Regards

Mark
------------------------------------------------------------------------------------------------------------------

Commodore 128, 512K 1750 REU, 1581, 1571, 1541-II, MMC64 + MP3@64, Retro-Replay + RR-Net and a 1541 Ultimate with 16MB REU, IDE64 v4.1 + 4GB CF :-)

airship

A daughter board is the most obvious idea. But it would be a pain to get TWO chip sockets to line up with the motherboard. I'm not sure if using a ribbon cable would futz with the timing or not. Not only that, but the C128 OS, as written, might have timing issues with buffer chips inline with the CIAs. You might need to make ROM changes to take into account I/O delays.

You could just use a diode on each line if the ports weren't bidirectional. But they are. Maybe you could get by with using them on the lines that are dedicated to one-way communications.

Of course, these wouldn't be issues if CBM had designed them with buffers in the first place.
Serving up content-free posts on the Interwebs since 1983.
History of INFO Magazine

airship

Does anyone know the difference between the various incarnations of the 6526, as evidenced on this page that sells antique chips? I mean, I assume they get newer as they get pricier, but are there any real differences that - uh - actually make a difference?

http://www.arcadecomponents.com/page/page/2243545.htm

6526 $2.99
6526-R4 $4.49
6526A $4.99
6526B $5.99
Serving up content-free posts on the Interwebs since 1983.
History of INFO Magazine

Mark Smith

How about if opto-iso,lators were inserted inline ?  That would give a measure of protection wouldn;t it ?
------------------------------------------------------------------------------------------------------------------

Commodore 128, 512K 1750 REU, 1581, 1571, 1541-II, MMC64 + MP3@64, Retro-Replay + RR-Net and a 1541 Ultimate with 16MB REU, IDE64 v4.1 + 4GB CF :-)

airship

That would work, I would think.
Serving up content-free posts on the Interwebs since 1983.
History of INFO Magazine

BigDumbDinosaur

Quote from: airshipDoes anyone know the difference between the various incarnations of the 6526, as evidenced on this page that sells antique chips? I mean, I assume they get newer as they get pricier, but are there any real differences that - uh - actually make a difference?

http://www.arcadecomponents.com/page/page/2243545.htm

6526 $2.99
6526-R4 $4.49
6526A $4.99
6526B $5.99
The plain 6526 is the NMOS version fitted to the C-64, C-128, and 1571.  I don't recognize the R4 suffix and I don't see any reference to it in my old CSG sales literature.  It may be a third party CMOS part, possibly a Rockwell piece, as Rockwell was an authorized second source for a lot of MOS Technology parts back in the day.

The A and B suffixes on the third and fourth parts indicate differences in the AC timing characteristics, primarily in bus setup and data latch times.  The A suffix part is a 1 MHz version, same as the plain 6525, and the B suffix is a 2 MHz version that was most notably used in the B-128 computer, which ran all I/O at 2 MHz (interesting aside: TI and TI$ in the B-128's BASIC used the TOD clock in the CIA, not a jiffy clock like the 64 and C-128).

The 6526 was used in the 1571, and you might find the 6526B inside a 1581, although it's unclear if the 1581 actually ran the CIA at 2 MHz (I don't have a schematic for that unit).  There's no advantage to replacing the 6526 in a C64 or C128 with the B part, as all I/O is at 1 MHz.  Therefore, if you need a replacement CIA go with the plain 6526.

Incidentally, all incarnations of the 6526 are very static-sensitive.  Use ESD precautions at all times when handling the chip.  Never touch the user port lines or the joystick pins unless you have grounded yourself.  Also, ***NEVER*** connect or disconnect the 128D's keyboard while the unit is powered.  The ***ONLY*** safe time to connect or disconnect the 128D's keyboard is with the computer plugged into a ground receptacle with power turned off.

Speaking of the 128D keyboard, there is are some unused lines in its cable.  These lines can be tapped into inside the 128D if you are proficient in soldering in tight areas.  Back when I had 128D's, I used one of those lines to connect to a small reset button that I installed at the right rear corner of the keyboard housing so I didn't have to reach round to the side of the computer to reset.  I also installed a T1-3/4 sized LED into the keyboard and powered it through another unused line so I had a power indicator on the keyboard itself.  When I moved the guts of my Lt. Kernal system into one of the 128Ds, I usurped the power LED in the computer and turned it into a drive activity LED, since I had power-on indication on the keyboard itself.  So you can see there's a bit of hardware flexibility to be had in the old machine.
x86?  We ain't got no x86.  We don't need no stinking x86!

airship

Doesn't sound like Commodore to have invested a tenth of  a cent in UNUSED wires in the keyboard cable. They must have gotten them for a song on the surplus market.
Serving up content-free posts on the Interwebs since 1983.
History of INFO Magazine

BigDumbDinosaur

Quote from: airshipDoesn't sound like Commodore to have invested a tenth of  a cent in UNUSED wires in the keyboard cable. They must have gotten them for a song on the surplus market.
It probably happened because Jack Tramiel was no longer there to ride roughshod over the engineering department and demand that every possible nickel and dime be cut from the hardware cost.

It was by accident that I discovered those extra lines.  I was building a sort of kiosk out of a 128D multiplexed to a Lt. Kernal, and wanted to make the computer itself physically inaccessible to the casual user.  However, the reset button and a power indicator needed to be accessible, so there I was puzzling over what to do about these requirements.  That's what got me to looking at the keyboard interface.

The connectors are standard DB-25 parts, and I knew that 25 lines weren't required to accommodate the full keyboard matrix (there are 19 hardware lines associated with the matrix, 11 columns and 8 rows).  I also knew that most of the Chinese fab houses that made up molded cable assemblies like that in the 128D's keyboard used standard jacketed cable for economy of scale, which would be 25 conductor for a DB-25 assembly.  That meant that at least 5 unused lines were probably available.

Knowing this prompted me to examine the mainboard right by the keyboard receptacle, followed by some probing with a DVM to account for what appeared to be unused connections on the mainboard.  Sure enough, the penny-pinchers in the Commodore accounting department had missed a golden opportunity to save some "big bucks," and had accidentally made my little project possible.

A little wiring at the receptacle on the mainboard got me ground and VCC (5 volts through a 470 ohm resistor), as well as access to the hardware reset line.  In the keyboard, I drilled a small hole on top for the LED, a small hole underneath near the top right corner of the lower keyboard housing section for the reset putton (one of those little Radio Shack jobbies), identified the unused wires in the cable and hooked up everything.  Worked like a charm.  I eventually retrofitted all my 128Ds on my software development system in this fashion.
x86?  We ain't got no x86.  We don't need no stinking x86!