ColoR ANd ThE
Clock
by BEN POEhlANd, AC MANAGiNG EdiTOR
Old Ludwig
There's a colorful story about Ludwig van Beethoven in his later years when he was stone deaf and turned out his greatest masterpieces. He developed a habit of dousing himself with pitchers of water to cool down the heat generated by his creative labors. He ended up moving around town a lot, as this got him in no end of trouble with landlords. There came a day when an enraged landlord, dripping wet from old Ludwig's activities on the floor above, came barging into Beethoven's room to deliver the eviction-and instantly retreated in terror from a sight that assaulted his sanity. It was Beethoven: half naked in a filthy nightshirt, dried shaving cream all over his face and long cotton wicks dipped in smelly yellow liquid trailing from his ears, stamping and screaming and thumping on a stringless piano... .
Reminds me of The 8-Bit Alchemist. You wouldn't believe that guy. He opens up a computer, and in short order the whole house is trashed. He stomps all over the place muttering nonsense about Murphy Demons and spends hours in an upstairs room wreathed in a pall of solder resin fumes. He'll drop some small part on the floor, and oh! such swearing! The worst came when he was trying to install Super Video in a 600XL. It seems this particular 600XL (which began its existence as the property of one John Nagy, now of AtariUser fame), was defective before The Alchemist began modifying it.
Alchemist Vs. Corollary No. 6
Now the poor fellow was going bonkers trying to figure out why the modification, which worked so well in other XLs, didn't work in the 600XL. Such cussing was never heard from a dozen sailors! I retreated to ACs Editorial Offices to escape The Alchemist's wrath, to no avail. The old goat followed me in there, still foaming over the recalcitrant 600XL. He drew up before a glassed-in frame on the wall holding a poster that reads:
MURPHY'S LAW: IF ANYTHING CAN GO WRONG, IT WILL.
There follows a list of 10 items elaborating Murphy's Law, under the heading.
COROLLARIES:.
The Alchemist studied the list for a moment, then
excitedly jabbed a bony finger at the poster with such force I feared
he would break the glass (it happened once). "There!" he shouted.
"Number Six, it got me again! Confound Murphy and all his dirty tricks,
the devil take him...". There followed a nonstop 10-minute stream of
verbal vitriol lambasting Murphy, Atari, James Morgan, all people named
"Tramiel", and the Sunnyvale Butchers, at the end of which The
Alchemist slumped into a chair completely spent, a trickle of slobber
dripping from his chin.I gingerly glanced at the poster to read which Corollary he was talking about:
6. WHENEVER YOU SET OUT TO DO SOMETHING, SOMETHING ELSE MUST BE DONE FIRST.
"So", says I, "by this I take it you mean the 600XL must be repaired before you can proceed with the modification? Well gee, that's not so bad."
He bolted up, eyes flashing. "Not so bad? NOT SO BAD?? Good heavens! How am I to know if the problem is in the mod or elsewhere? No, no! The only way is to strip it all out, put back all the original parts, repair it, then start all over again! So much good work, all wasted and frittered away on this [ADJECTIVE DELETED] piece of junk! Oh, woe is me, I'll never finish this thing!" he groaned as he sagged wearily back down in his chair.
He looked so pitiful there, all bedraggled and defeated. I saw in this an opportunity for the restoration of domestic tranquility, and I knew what to do. "Lookit here old fellow, you've hit a rough patch, you're all done in. You need a little rest, then you'll be fit again. And hey, while you're recharging your batteries I'll look over the machine and repair it for you. You've got a good video signal, it's just the color that's poopy. Heck, I can fix that! When you come back you can continue Super Video right where you left off."
He gave me a heartrending look as he shuffled out of the room, like a lost puppy just returned to its owner. "You would do that for me? Bless you, dear boy! I guess I am a little used up, I could use a rest. When I come back I'll finish Super Video. It'll work great, you'll see! I can do it, really. I just need a good machine, that's all. Then I'll put Super Video in the 1200XL, and... and... ......
Funky Color
Man, I thought I'd never get rid of the old geezer. In his absence I gave the funky 600XL a good going-over with a nice Commodore 1902 color monitor attached. The picture was clear, but color was runny and kept flipping between puny color and mono. I looked over Jeff Potter's article on adjusting the color potentiometer and tried twiddling the color pot. Bad move. "Something" happened, after which the screen stayed monochrome no matter how much I twiddled either the computer or the monitor. Peachy. I'd gone from runny color to none at all. Having just promised that crazy old man I'd have his machine ready to go when he came back, the first faint twinges of anxiety began creeping up my spine.
I called Jeff McWilliams, from whom I'd purchased the machine (this computer definitely had a checkered history), and described the problem. "Oh yeah", he says, "come to think of it, that thing always had lousy color. Weak and runny, and sometimes it went mono. It was like that when I got it from Nagy. I just figured it was because of the interface. I was using it with a TV, which is pretty cruddy to begin with. I mean, if the video is malfunctioning intermittently, but your interface is junk, how can you tell where the problem is?" I couldn't argue with Jeffs logic, but this was a rotten time to find out about it.
I did all the normal, sensible things. You know, chipswapping: GTIA, ANTIC, 4050 video buffer, CPU, OS ROM. Zilch, the screen was still as gray as Mosby's ghost. I carefully double-checked all the parts The Alchemist had stuffed in there as part of his Super Video upgrade. No problems. (The Alchemist might be a maniac, but I must say the man does beautiful work.) It was time to fire up the oscilloscope.
Homing In On GTIA
A 'scope check of the GTIA showed no color signals coming out on pins 21 and 25, which explained why replacing the 4050 had no effect. It also cleared The Alchemist of any wrongdoing, since the problem originated upstream of the color amplifier components he installed. I monitored pin 17 of the GTIA and twiddled the color adjust pot some more. As I ran the pot through the extremes of its travel, the voltage rose from zero to about 0.2V and stayed there. I checked pin 17 GTIA voltage on a healthy 800XL exhibiting a nice blue BASIC screen, and found 4.8V. Aha! Obviously the GTIA in the bad 600XL had a defective input stage that was drawing too much current and loading down the pot voltage. It had to be the GTIA!
I replaced the GTIA again. Darn, no voltage and no color! Out of the corner of my eye, I swear I saw a small green scaly thing with webbed claws skitter across the floor, accompanied by a high-pitched cackle. Was it my imagination? Or was there really such a thing as a Murphy Demon, born enemy and sworn foe of my Alchemist friend? My mind wandered... I recalled a strange statement The Alchemist once had made, about doing battle with unseen foes in total darkness, and how gratifying it was when he actually managed to skewer one of the nasty buggers upon the point of a hot soldering iron. He kept the slain creature preserved in formaldehyde in a pickle jar but never let me see it.
I snapped out of my reverie, shrugged off these silly thoughts, and proceeded with my tests. OK, maybe the laws of Chance had conspired against me, and I had two bad GTIAs in a row. Well I got me a whole drawerfull of GTIAs and prepared myself to go through every single one until I found a good one. And so I did-3, 4, 5 GTIAs-and still no color. Man, this was really pushing the laws of Chance! Well, actually I was pushing the laws of Chance, but not in the usual statistical sense.
Chance Favors The Prepared Mind
It was while testing GTIA #5 that a totally meaningless, random event occurred which finally put me on the right track. Check out Figure 8 in The 8-Bit Alchemist's "Super Video 2.1XL" article: you'll notice that just to the left of the 600XL video circuits is some additional circuitry (two transistors and a crystal, etc.) which comprises the system clock. I accidentally touched some of those clock components with a probe (or was it a finger?) and was amazed to see color briefly restored to the screen! OK, it was terrible color, runny and phasey and messy. But hey, this was progress, I was back up to the same crummy color I started with!
It made no sense. I mean, how could it be that messing with the system clock would generate a color signal at the video output? Well, it turns out the clock signal has everything to do with color. And it also turned out that my touching the clock circuit and observing an effect on my color display weren't necessarily connected events. Any highfrequency RF signal will behave unpredictably outside the controlled environment in which it was designed to function. Perhaps my instrument, or my body capacitance, coupled the clock signal to the video output, causing the monitor's chroma detector to trigger on the weak, unstable signal. Explain it any way you want, it's irrelevant. The real value of the experience was that it motivated me to sit down and seriously study the clock circuits.
Since the clock governs virtually all the major digital functions of the machine, following the clock signals amounts to a whirlwind tour of all the hardware. Not just in the 600XL, but in all the Classic Ataris: they all employ a clock generator, Atari custom LSI chipset, and color adjust circuit. For me it was like following a rainbow, with the prize being the discovery of the failed components in the color circuit instead of a pot of gold. (I don't need gold anyhow, The Alchemist makes all I want from lead.) Along the way I discovered some really neat stuff about how all the 8-bits work.
Crystals and Clocks
In all the Classic Ataris the action begins with the crystal: 3.58MHz in the North American NTSC systems. Associated with the crystal is a two-transistor differential pair that buffers the 3.58MHz signal and passes it along as a low-level sinewave to pin 28 (Oscillator input) of the GTIA chip. The diagram in Fig. 1 is for the 800XL, but the oscillator circuit is identical in all the XLs.

A slightly modified version of this circuit (Fig. 2) is used in the 400 and 800, as those machines employ an additional +12 volt bus. One half of the differential pair is powered by the +12V bus, while the other half runs off the +5V line. The availability of two different supply voltages simplified the design:

The oscillators of Figures 1 and 2 are entirely absent in North American XE computers. Instead, a special IC oscillator feeds 14.3MHz to pin 2 of the FREDDIE chip which divides it by 4 and sends out the 3.58MHz to GTIA on pin 37. The 1450XL uses this arrangement as well.
Follow That Clock!
GTIA (CTIA in the 400/800) amplifies the clock signal on pin 28 and snaps it up from a sloppy sinewave to a TTL-level squarewave, then puts it out again on pin 29 (Fast phase 0) which goes to ANTIC pin 35. ANTIC divides the 3.58MHz clock by 2, to 1.79MHz, and sends it back out again on pin 34 (Phase 0 clock) where it appears as an input on pin 37 of the 6502CPU after buffering by a 74LS08 gate (gate buffering varies in different models, and early versions of the 800 route the clock differently). The CPU re-phases the clock again and puts it out on pins 3 and 39 as the 1.79MHz Phase 1 and Phase 2 clock signals, respectively. (At this point hardware comparisons between the 400/800 and XL/XE end, as the Phase 1 and Phase 2 clocks in the 400/800 aren't used.)
The Phase 2 clock in various convoluted forms is basically the master clock signal for all the computer's digital functions. It controls timed events such as memory refresh, video synchronization, CPU instruction execution, I/O data fetching, and a zillion other things.
Color and The Clock
What about that Phase 1 clock, what becomes of that? It doesn't live long once it leaves the CPU. From pin 3 of the 6502 it goes to the input of the color adjust circuit, where it gets clobbered. Or, to be precise, it gets rectified into a DC voltage that's applied to pin 17 of the GTIA via the color adjust potentiometer. In a healthy 8-bit computer the approximate voltage range of the color adjust pot and corresponding screen colors are as follows:
0.0 to 3.4 volts..... Monochrome
3.4 to 4.2 volts..... Green
4.2 to 6.7 volts..... Blue
6.7 to 8.0 volts..... Violet
8.0 to 9.1 volts..... Magenta/pink
The GTIA voltage:color relationship varies from chip to chip, which is why the color pot always needs to be readjusted after you replace a bad GTIA.
Okay, I hear you snickering. You know your computer runs on +5 volts, so where is this 8- and 9-volt stuff coming from? The diagram of Fig. 3 is the color adjust circuit for a 130XE, but the circuit is identical for the 600XL, 800XL, 1200XL, and 65XE.
The transistor isolates the clock signal from the violent events to follow: the little pulses go merrily to the slaughter with no inkling of what's to come. The diode connected to +5V (CR2) adds a 4.4V DC bias to fatten up the clock pulses for the killing, and the second diode (CR3) does the dirty work by rectifying the whole mess to about 10 volts DC. The resistor and two capacitors (C45-R37-C47) form a pi-filter that smoothes the DC and passes it (with some voltage loss) to the color adjust pot, from whence it goes to GTIA pin 17. This pin 17 bias voltage is really critical, as the GTIA seems to use it as an external reference for correctly phasing the color video signal fed to the input of the color video amplifier from pin 21.
The circuit of Fig. 3 is absent in the 400, 800, and 1450XL. Those computers all have a +12 volt bus, so Atari just tied the color adjust pot to the +12V line via an isolation resistor. The Fig. 3 circuit was only needed in the machines that ran on a single +5 volt bus.

Pink Is For BASIC
With these lessons fresh in mind I returned to the funky 600XL. GTIA #5 still wasn't producing any color, and I decided it just wasn't believable that I had five bad GTIA's in a row. To prove to myself the GTIA wasn't defective, I removed it and checked the DC voltage at pin 17 of the empty socket: it was still 0.2V. If the GTIA had had a shorted input on that pin as I erroneously thought, the voltage on the empty socket pin should have jumped up to about +9V, as I had the pot turned up full blast. What this told me was that I needed to look further upstream for the trouble.
I scoped pin 3 of the 6502 to see if the Phase 1 clock was there. Well, yah, it was there all right, but the little pulses looked very unhappy. Kinda skewed and smeary, like they had gotten wind of the fate in store for them and were trying to run away. Something in the color adjust circuit was giving away the bad news.
I moved my scope probe to the collector (marked "c" in Fig. 3) of the transistor, expecting to see the clock signal. All I saw was noise. So! It was the transistor. I removed it and checked it on my click tester: dead as a doornail. I stuck in a new transistor and fired up the 600XL.
No color. From somewhere, faintly, came a high-pitched cackle. I wasn't imagining it this time. Musts been a mouse, I've had a problem with mice in the kitchen lately. I kept my cool and scoped the collector of the new transistor. There was a nice healthy clock signal there, just waiting to be creamed. I moved along to the junction of the two diodes: the signal was healthier still. I jumped to the other side of the rectifier diode CR3, and... nothing. All those eager electrons were just left dangling in mid-air. I pulled the diode out and checked it on an ohmmeter: it didn't conduct in either direction (diodes should conduct in one direction but not conduct when the polarity is reversed). Not only was the transistor bad, but so was the diode.
As I replaced this diode with a good one, I again heard a strange noise, a howl or moan, as if something in the distance was dying. I looked out the window to check my neighbor's dog, but Old Bones was cheerfully chewing the remains of some odd critter he'd just found in the yard and didn't seem distressed at all. Annoyed by the interruption, I returned to the 600XL and fired it up.
I got a big pink screen. PINK??? Doofus me, I'd left the color pot cranked all the way up. I tweaked it down till I got the usual blue BASIC screen, then fine-tuned it with Jeff Potter's nifty color adjust program. I stood back to admire my handiwork and was seized by a sudden impulse: a loud warwhoop inexplicably escaped my lips.
Old Goat Returns
Big mistake, I awakened The Alchemist. There was a huge ruckus, and suddenly he appeared with shirttails all a-flutter and wearing mismatched socks (one blue, one brown). I could see he was in high feather: he had that wild gleam in his eye and brandished a smoking soldering iron like some kind of weapon. He brushed me aside without a word and went immediately to work, firing up a pile of color monitors on the kitchen table and studying the results of his Super Video modification. Soon the muttering began, then the familiar stream of curses.
Somewhat miffed, I went slinking upstairs to my Editor's lair in the AC office. But I couldn't think with all that noise going on. The racket down below swelled to a roar that shook the house, as if some terrible battle between cataclysmic forces of Nature were being fought. Once, I thought I heard that high-pitched cackle, followed at once by a piercing shriek that ended abruptly amid bloodcurdling screams from The Alchemist: "Take that, you devil! Now I've got you, I'll have all of you! I'll rip your flesh and crush your bones, you'll not escape me! Give it up, give it up!" I couldn't bring myself to gaze upon whatever nightmare was going on down there. It was madness.
I closed the door to the office, achieving peace at last. I leaned back in my comfortable Editor's Chair and closed my eyes. I was still feeling rather hurt. Really, I would have thought the guy could at least thank me for repairing his machine. What a bum he is, I keep trying to kick him out. But then he gives me that wounded-puppy look (I know he's manipulating me), and I go all soft and take him back again. Sheesh, now I'm way behind on my editing, and I fear this issue of AC will be late.
