Vacuum Tubes Part 2: Amplifiers, TVs, Computers, and More

In my last post, I talked about the basics of vacuum tubes and one of the very first tube types, the diode. Diodes were used to rectify household alternating current (AC) into the direct current (DC) needed by many home electronic devices, and they were also used to detect incoming radio signals so that the information carried by these signals could be heard.

In 1906, Lee DeForest, an American inventor, was experimenting with vacuum tubes. He took a diode and added a third element, called a grid, between the cathode and the plate. This early grid was simply a wire bent back and forth several times. Later grids took the form of a coiled wire that surrounded the cathode.

Remember that in a tube, we boil electrons off the surface of the cathode. For a diode, If the plate is positive with respect to the cathode, it attracts the electrons and a current flows. If the plate is negative with respect to the cathode, it repels the electrons and no current flows. Now, in a triode, we have the grid between the cathode and the plate. We connect a wire to the grid and bring it outside the tube. Let’s apply a voltage to make the plate positive with respect to the cathode and leave the grid disconnected for now. What happens?

Diagram of a triode tube conducting

Well, nothing different really—we get almost the same current flow we would have in a diode. There is plenty of space between the grid wires for electrons to pass through on their way from the cathode to the plate. A few electrons may strike parts of the grid and be scattered, but this has little effect on the overall flow. However, if we now apply an additional voltage to make the grid negative with respect to the cathode, the effect is dramatic. Even though the plate is at a positive potential, the grid starts repelling electrons and the current flowing to the plate drops rapidly. If we make the grid negative enough, we can stop the flow of current completely! This is called cutoff.

Diagram of a triode tube in cutoff

Inside the tube, the grid is not connected to anything, and we are not using it as a source of electrons like the cathode. This means that it requires very little current to swing the electrical potential of the grid positive or negative. This is a groundbreaking discovery! We now have a device where a tiny current (grid current) can control a much larger current (current between cathode and plate). This is the basic principle of an amplifier. Before amplification, early radio enthusiasts constructed huge antennas to capture incoming radio waves. The right design with a large antenna created the largest possible alternating current in the antenna wire from the incoming signal, however, this current was still very weak. At best, it could operate a pair of headphones. Even with a big antenna, radio operators strained to hear faint signals.

Violet McKenzie with wireless, Ex-Wrans Association of New South Wales, public domain

Now, imagine that we connect a strong current source (rectified current from an outlet, or a high-voltage battery) to the cathode and plate of a triode. We connect the very weak radio signal coming from the antenna to the grid of that same triode. Voila! The weak radio signal causes small changes in the grid potential relative to the cathode, and these changes control the much stronger current flowing between the cathode and plate. We now have a strong current (cathode to plate current) that is changing exactly the way the weak radio signal was changing! We have amplified the weak signal. Not only was this new form of amplification enough to make a weak signal easier to hear in a pair of headphones, it could even power a speaker so that everyone in the room could enjoy a radio program!

Little Girl by Radio, Franklin D. Roosevelt Library Public Domain Photographs, public domain

As tube development progressed, tubes became more powerful in terms of both amplification and the ability to handle larger currents, thus bringing in even weaker stations and powering larger speakers. Researchers and developers created tetrode tubes with four elements (cathode, plate, and two grids), and pentode tubes with five elements (cathode, plate, and three grids), to improve the electrical properties of tubes. The number of radios and broadcast stations skyrocketed, and millions of people began enjoying this new form of entertainment.

In addition to amplifying signals, engineers also started using tubes as oscillators, devices that create alternating currents. This was useful in creating radio broadcasts, and also in radio receivers with the superheterodyne circuit invented in 1917—a circuit so good at bringing in weak radio stations that you can still buy AM radios that use it. Oscillator tubes were also a key component in TVs, as was a new development in tubes: the picture tube. Also called a kinescope or cathode ray tube (CRT), the picture tube once again boiled electrons off a cathode, but in this application, the electrons were sprayed toward a phosphor screen that lit up to produce a picture as the electrons struck it.

Finally, tubes played a role in the development of faster, more powerful digital computers, which required hundreds, then thousands, then tens of thousands of electronic switches to perform binary logic and arithmetic operations, and route data. How can a tube be a switch? Easy! The grid is the switch control: set it negative enough so that the tube is in cutoff when you want to stop the flow of electrons and turn off the switch. You may have heard of the ENIAC computer, which had almost 18,000 tubes—imagine trying to find which one was bad!

The author and his father, Walter Holthaus, with tube computer equipment at the Computer History Museum

Tubes are still around today, in use by audio enthusiasts who enjoy the sound they produce in a hi-fi stereo system, and musicians who enjoy the sound of music played through a tube guitar amp. Collectors restore and use vintage tube radios, TVs, and test equipment. And, even the heavy, bulky picture tube has made a comeback as vintage computer and game console enthusiasts rescue obsolete TVs from the dumpster so they can display their favorite programs with the scanlines they remember. Tubes helped enable and shape the electronic world we live in–next time you listen to the radio or watch a video, imagine the warm glow of the tubes that was part of so many families’ experience in the early days of electronic entertainment.

Vacuum Tubes Part 1: The Start of an Electronics Revolution

Vacuum tubes (also called electron tubes, vacuum bulbs, valves, or simply, tubes) are sealed glass tubes with metal pins sticking out of one end so that the tube can be plugged into a socket as part of an electronic circuit. Inside the tube are various elements—metal cylinders or boxes, coils, and wires to keep everything suspended inside the tube. There is no air (almost no air) inside a vacuum tube, which is a requirement for the tube to perform its electrical function. The vacuum tube was created in 1904, and they were actively used in electronics in the US until the 1960s, when tubes were gradually phased out and replaced by the next major innovation—transistors. Unlike many “new old stock” items manufactured more than 50 years ago, unused vacuum tubes are inherently preserved—the inner workings are as pristine as the day they were made since there is no air or moisture to cause oxidation (assuming that the seal between the glass tube and the external pins hasn’t failed). Therefore, if you find an unused tube, chances are excellent that it will work as-is in your vintage electronic device.

Different sizes of vacuum tubes and tube boxes. The tiny part with three leads is a transistor, not a tube!

Vacuum tubes work by controlling a stream of electrons that are speeding from one element to the next through the empty space in the tube. Everything starts at the cathode, an element of the tube that is coated with a special material that loves to release electrons when it is heated. The simplest cathodes are just a coiled filament like you would find in an incandescent light bulb. The ends of the filament are connected to two pins at the tube base, and by passing the right amount of electric current through the filament, we can heat it red hot, giving the tube its characteristic red glow.

Once the filament is red hot, it starts releasing electrons. Now we need another tube element in order to do something useful. This new element is called the plate. In its simplest form, it’s just a flat piece of metal, though often it takes the shape of a cylinder that wraps around the long, thin wire of the cathode without touching it. This simple type of tube with two elements, cathode and plate, is called a diode.

Diagram of a diode tube

Let’s talk about the function of the plate. You may have heard the phrase “opposite charges attract.” Most likely, you’ve experienced this phenomenon if you’ve tried to comb or brush your hair on a dry day. The action of rubbing the comb or brush against your hair strips electrons off the hair. Electrons are negatively charged, and the removal of electrons leaves your hair positively charged, causing it to stick to the now negatively charged comb or brush.

Now, what if we connect a battery between the cathode and the plate? This will change the electrical potential, or voltage, between these two tube elements. If we give the plate a positive potential as compared to the cathode, the negatively charged electrons coming off the cathode will be attracted to the plate and will fly through the space in the tube to the plate. The metal plate is a good conductor, so the electrons will continue to flow into the plate and through the connecting wire to the pin, where they will exit the tube. This flow of electrons from battery to cathode, through the empty space in the tube to the plate, and back out of the tube to the battery is an electric current.

Diode tube with positive voltage on plate showing electron flow

Let’s turn the battery around so that the plate now has a negative potential as compared to the cathode. If the plate is negative, it will no longer attract the negatively charged electrons that are coming off the cathode, and no electric current will flow as in the previous configuration. This is the key feature of a diode: it will only allow an electric current to flow in one direction.

Because diodes only allow electric current to flow in one direction, they are often used to change the alternating current (AC) that comes out of an electrical outlet into direct current (DC) that is needed by many types of circuits found in consumer electronics. The current that comes out of an outlet changes direction many times per second, hence the name “alternating current.” One cycle of alternating current begins with no current flowing. The current begins flowing in one direction and increases until it reaches a maximum. Then, the current decreases until it stops for an instant, at which point it reverses direction and again increases to a maximum in the opposite direction. Once again, the current decreases until it reaches zero, at which point the cycle is complete.

Waveform showing one cycle of alternating current

You may have heard the term “sine wave” used to refer to this graph. The current that comes out of an outlet in the US goes through 60 of these cycles per second, and most countries use either 60 cycles per second or 50 cycles per second. When we connect a diode in series with the current coming out of the outlet, it only allows current to flow in one direction. The process of converting AC into DC is called rectification and another name for a diode is rectifier.

Waveform showing two cycles of half-wave rectified current, or “pulsed DC”

As you can see in the graph above, which shows two cycles of rectified AC, the diode only allows current to flow for one half of each cycle. This is called half-wave rectification. The current flows in only one direction, but it changes in magnitude, and sometimes there isn’t any current flowing. This type of current flow is also called “pulsed DC.” We need a few more components in our circuit to smooth out this current and make it truly constant, like the current that flows out of a battery, but that can be the subject of a future blog post.

As it turned out, diode tubes also found an important use in radio. Radio signals are transmitted as electromagnetic waves that set up a very weak alternating current in an antenna. Before the information encoded in this alternating current can be heard, we must pass it through a diode, once again changing the AC into pulses of current that flow in only one direction. This process is called detection, and tubes used to do this are sometimes referred to as detectors. Before the advent of the diode, early radio systems used clunky mechanical methods to detect incoming signals. This worked okay for morse code, a series of short and long pulses that are used to encode the letters of a message. However, because they have no moving parts, vacuum tube diodes can react to incoming radio signals much more quickly.

Because of their fast response time to incoming signals, vacuum tube diodes enabled the reception of voice and music. Radio transmissions were no longer limited to morse code, which made radio more accessible to the general public. Radios require direct current to operate, and vacuum tube diodes also enabled rectification of AC into DC, so that radios could be plugged into a wall outlet. This eliminated the need to buy expensive batteries and allowed radio owners to play their sets as much as they liked, without worrying that the batteries would die.

In my next post, I’ll talk about how the addition of a third tube element, called a grid, created a tube called a triode. It was the triode that kicked the field of electronics into high gear—radio sales skyrocketed and millions of homes started listening to a growing number of stations. Even more impressive, triodes paved the way for many of the modern electronics we now take for granted, such as televisions and computers.

Dad’s Shop: Part 2, the Heathkits

We of course did a lot of woodworking and other non-electronic work in the shop, but when it comes to electronics, the projects that stick out most in my mind are the Heathkits. My dad, like many others, took advantage of technical training programs available through the GI Bill to people who had served in the military. He had been educated in tube electronics at U.S. Army Signal school in Fort Monmouth, New Jersey, where (among other things) he assembled and disassembled a typical superheterodyne tube radio as part of the training. As a result of this, he had excellent soldering and debugging skills, and he later applied for a correspondence course to learn about servicing color TVs. The great thing about these courses was that, as part of your training, they would send you the pieces of a TV kit to assemble bit by bit, and at the end of the course, you would have a color TV you could use in your house—for free!

There have been many companies over the years that sold electronic kits. Before manufacturing became largely automated, driving down assembly costs, putting together your own electronics by soldering parts and connecting pieces could save you money over buying something that had already been fully assembled. Kits like Eico, Paco, and Allied Radio Knight Kit were popular and frequently appeared in many hobbyist and electronics catalogs. By the time I was old enough to build my own kits, this business had mostly dried up (to my disappointment), but we still had the fruits of several kit-building exercises in our house. These were all Heathkits—arguably the king of electronic kit companies. Their catalogs were filled with pages and pages of TVs, radios, stereo systems, speakers, ham radio gear, and test equipment. As a kid I would pore over these pages dreaming about all the cool stuff I could build, though the number of kits listed in the catalogs I had was a fraction of what it had been in Heathkit’s heyday. As my dad likes to say, Heathkits were not cheap, but they were high quality and often featured advanced features that would be even more expensive in a commercially-built product. Plus, they came with detailed and easy to follow build instructions that not only took you through (hopefully) successful construction, but also guided you through troubleshooting any issues that occurred, and even gave you some electronics theory in the process.

We had three Heathkits in our house, all painstakingly assembled by my dad from thousands of discrete components: two color TVs (GR-180 and GR-2000) and a stereo (the famous AR-15). For the smaller color TV and the stereo, my dad built beautiful walnut enclosures. The cabinet for the stereo also held a turntable and included room to store LP records. I still have this cabinet, along with the turntable and most of my parents’ records, but the AR-15 in the cabinet is a different one that my uncle put together (my dad kept his original stereo to use in a different enclosure). I remember that both TVs had a great picture, in part because the Heathkit manuals also told you how to perform the periodic service adjustments that all TVs at the time required for the best possible picture (Heathkit TVs actually came with several thick books of construction, alignment, and electronic theory information). As I got older, I became fascinated with these procedures and would align the TV once or twice a year, far more than it probably needed, but I didn’t care—it was fun to see the results of my work and know that every time I watched the TV, the clear, sharp picture was due to my adjustments.

Christmas 1974 at our house, showing the Heathkit GR-180 color TV with custom-built walnut cabinet!

As the TVs aged, some of the components began to fail. Usually the fix was quite simple, involving the replacement of one part at a cost of around a dollar or less, and this often required a visit to our local Radio Shack or to Superior Electronics, a parts store in Madison that had a wider selection of discrete components. Superior no longer exists, but I’m very lucky to have an amazing parts store, Anchor Electronics, close to where I live now. Anchor is even better than Radio Shack ever was because you can inexpensively buy many different kinds of components in low quantities.

The kits my dad built were quite reliable. On the rare occasions when one of the TVs (or possibly the stereo) went on the fritz, my dad would bring it down into the shop, open the case, and sit me down for a lesson. I recall him always asking me, “What do we check first?” And the answer was always, “The simplest thing.” Make sure the fuse or circuit breaker isn’t blown, and make sure the plug is in good shape. Next was usually a visual inspection—components that go bad will often get very hot before a fuse blows or someone notices a burning smell and turns off the equipment. Often it’s easy to spot a blown component and associated burn marks. From there, we pulled down and dusted off the Heathkit manual(s) and started following the troubleshooting guide, which was organized by symptom and helped you isolate failures to a particular circuit board and, often, to a specific component. Sometimes when components start to fail, they become sensitive to heat, and I remember using a can of freeze spray to squirt suspected components while listening to the radio or watching the picture on the TV. If a hot component was the issue, the effect of the spray would be dramatic (often the problem disappeared completely), which never failed to fascinate me—”Spray it again, Dad!”

One of my crowning glories in electronics debug came when I was a senior in high school. By this point, friends and family knew of my interest in electronics and I was regularly getting donations of non-working equipment with a friendly “If you can fix it, you can have it!” I had dreams of setting up a complete entertainment center in my room, and these dreams came one step closer to reality when my dad brought home a 25” Heathkit GR-370 color TV. He had gotten the TV from a coworker, who had almost fully assembled it but then gotten stuck at one of the initial power-on stages when he couldn’t get a picture (before modern digital TVs, TV screens displayed snow when there was no channel tuned in, this one was just a black screen). I had the TV set up in the shop and regularly headed downstairs after dinner and homework to do some detective work, often with my dad assisting me and making suggestions.

After some false leads and dead ends, I went over the troubleshooting section of the manual from the start again and determined based on what I already knew that the problem had to be on one particular circuit board (there were 9 modular circuit boards, each performing a different function, that plugged into the back of the TV chassis). I took out this board and went back to my old standard, the visual inspection. One of the parts on the board was a transformer, which could be installed in two different orientations but would only work in one. All of the circuit boards in the TV were silkscreened to indicate where the components went, and if a component could only be installed in one particular orientation, there was usually an indication on the silkscreening. This transformer was no different—in big letters at one corner of the silkscreened transformer outline, it said “DOT,” indicating that there was a paint dot on the transformer that should align with the DOT on the circuit board drawing. Sure enough, there was a green dot on the transformer in the proper alignment, but something about the dot looked odd. It was very faint, and the plastic under the dot was rough, almost as if this was where the plastic injection had occurred in the mold. On a hunch I looked on the other corner of the transformer and there was a red dot that looked more substantial, like it had been painted on. Curious, I went back to the build instructions for the circuit board, and clear as day in the step-by-step assembly checklist, it said “Install the transformer with the red dot aligned to the silkscreen diagram.” Eureka! The color of the right dot was probably an easy detail to overlook after hours of soldering part after part, one at a time. I desoldered and removed the transformer, flipped it around so the red dot (not the green one!) was aligned to the silkscreen, and reinstalled it. It’s hard to describe the euphoria of solving a tough electronics problem, but when I turned on the TV and heard the whoosh of high voltage and saw the screen light up with snow, I pumped my fists in the air and immediately ran upstairs to tell my dad—all those years of helping him debug and fix Heathkits in the shop had paid off!

Dad’s Shop: Part 1

Some of my earliest memories of working with electronics are with my dad in his shop. I grew up in Madison, WI, where the winters are cold and indoor heating is a necessity. Our house was built in 1921, when gravity heating was the typical system for keeping warm. Because of this, our house had a basement with an octopus furnace, which my dad took out when he and my mom moved in. Going down the basement stairs, you first came to a small room with one door that led to a pantry, one door that led to a family room (where we also took shelter from tornadoes), and a third door that led to the shop.

Dad’s shop had a bare concrete floor and usually smelled like a mixture of sawdust and scented kitty litter since that’s where the cat boxes were (we always had cats while I was growing up), but the smell was not unpleasant. The centerpiece of the shop was a Sears Craftsman radial arm saw, which my dad had purchased early on in his married life even though he had to keep it in a storage room below the apartment complex where he first lived with my mom. He definitely made good use of the saw and it’s still in great shape after myriad remodeling, furniture, and craft projects.

Against the far wall of the shop was the wooden workbench, which had hundreds of holes in it from drill usage and which was always covered with our latest project, in various stages of disassembly or assembly. The wall above the workbench was covered with pegboard, and held all the tools my dad used most commonly, neatly organized. There were several different sizes and types of hammers, wrenches, pliers and screwdrivers, and each tool had an outline on the pegboard so you knew just where to return it.

Above the workbench there was one small window (the only natural source of light), which opened just above ground next to the driveway. We would place a board from the opening of this window to the shop floor and slide heavy bags of water softener pellets down through the window (not unlike the original use for this opening, which was to receive coal for the old furnace). Lighting was mostly provided by two fluorescent tube fixtures hanging from the exposed joists in the ceiling, plenty of illumination for any kind of work.

During my childhood, many broken appliances and other household items found their way down to the shop to be repaired. I frequented the shop to work on school projects, as well as a fairly complex catapult for a Science Olympiad competition. I also remember experimenting with electronics in the shop—one of my early successes was a simple flashlight, made out of an AAA battery, a single wire, a miniature light bulb and duct tape.  I was so proud of this flashlight that I made up excuses to use it, like reading books under a blanket even though it was daytime. As I got older and our neighbors learned I was interested in electronics, I became the recipient of many a broken device. Often the fix was simple, e.g. a bad switch or single burned out component, and it was always fun to find the problem. The best part was that I usually got to keep what I fixed! In this way, I ended up with a stereo and a Korg DW-6000 synthesizer, among other things. Regardless of the project, there was always something exciting about coming into the shop and feeling the potential of all the parts, tools, and equipment—I felt like I could make or fix almost anything!

Project: Using an FPGA to display RGB video, Part 2

In my last blog post, I talked about the process of programming an FPGA so that it would output digital RGB (red, green, blue) video signals to drive my Sony TV. I had successfully synthesized my Verilog code and turned it into a bitstream that I could use to program an iCEstick evaluation board, and now it was time to see if I could make things work in actual hardware. The iCEstick comes with a built-in 6×2 female header with 8 data pins, and also has through hole pads for an additional 16 data pins—more than enough connections for the signals needed to drive the TV. There are also 5 LEDs that can be turned on and off by the FPGA.

In addition to the red, green, and blue signals, there are also horizontal and vertical sync signals that need to be connected. First, a little explanation about how vintage TVs work. CRT TVs draw a picture by sweeping a beam of electrons across the screen. On the screen, there are hundreds of thousands of phosphor spots that light up when they are hit by the electron beam. In a color CRT TV, there are red, green, and blue phosphors (the primary colors of light, which can be combined in different intensities to form any color). The image is “painted” on the screen one line at a time by three separate electron beams (one each for red, green and blue). With the circuit I built there are a total of 240 lines that make up the full screen, or one frame. The electron beams start out aimed at the upper left-hand corner of the screen and are swept to the right to paint the first line of red, green and blue dots (the dots are small enough and so close together that your eye interprets the color combination of three RGB dots as a single spot on the screen). The intensity of each beam is controlled by the separate red, green, and blue (RGB) signals being fed to the TV, and this determines the color of each spot or pixel on the screen. Every time the electron beam reaches the end of a line, it has to be turned off and moved to the beginning of the next line (this is called “horizontal retrace”). The horizontal sync signal tells the TV when to go to the next line.

Raster scan, by Ian Harvey, public domain

Once all 240 lines have been painted on the screen, The electron gun again has to be turned off and moved all the way back to the upper left-hand corner of the screen in preparation to start painting a new frame (this is called “vertical retrace”). The vertical sync signal tells the TV when to go back to the start of the frame, and the TV displays 60 frames per second, which is fast enough that your eyes and brain interpret it as a smoothly moving image. As a sanity check to verify that the FPGA circuit was actually operating, I added some additional Verilog code to blink one of the LEDs provided on the iCEstick. The code consists of a counter that increases by one every time there is a vertical sync. When the counter reaches 30, it toggles the LED. Since there are 60 frames per second, this makes the LED blink on and off once per second. So, if the LED is blinking at the right rate, I know that the vertical sync signal is working properly, a good indication that the FPGA is doing what it’s supposed to do.

With the FPGA programmed and the LED blinking correctly, I hooked everything up to the TV, switched to the RGB input, and…nothing happened! So, now it was time to do some troubleshooting. I’ve always enjoyed debugging electrical circuits; it’s like being a detective and following clues that are revealed by your test equipment to zero in on the culprit (or bug). At this point, I needed some help from an oscilloscope to see what the FPGA was actually doing. An oscilloscope allows you to see a visual representation of how the signals in an electrical circuit are changing with time. I expected to see a series of regular, short pulses for the horizontal sync signal (remember, one pulse every time the TV needs to start scanning a new line), as well as a much slower series of pulses for the vertical sync signal (one pulse every time the TV needs to start scanning a new frame, 60 pulses per second). I also looked at the R, G, and B signals to verify that they were correct. The image below shows the horizontal sync signal, with the blue signal below it.

Okay, this looks good! Notice how the blue signal only pulses in the time between the horizontal sync signals; the red, green and blue signals contain picture information, so they should only be doing something when the TV is not performing a horizontal or vertical retrace. So, why was there no picture? My next step was to make sure I understood how the TV worked and what kind of signals it was expecting. For digital RGB signals, which can either be on or off, many TVs and monitors from the same era as my Sony TV feed the incoming sync signals into some digital logic to combine horizontal and vertical into a single mixed signal called composite sync. This signal is then used internally by the TV to figure out how to draw each frame. When I finally found the circuit diagram for my TV, I immediately had one of those great “aha!” moments where you know (or at least think you know) exactly what the problem is. It turns out that in this particular TV, the horizontal sync (Hsync) and vertical sync (Vsync) signals are fed into an AND gate:

With digital circuitry, signals can either be high (typically positive voltage, in this case around 5 volts), or low (typically ground or 0 volts). When you feed two signals into an AND gate, the output is only high if both signals are high. If either signal is low (or both signals are low), the output is low. And, here’s the big aha: I was using positive sync polarity in my FPGA circuit (see the oscilloscope traces above), which means that each sync signal was normally low and only pulsed high for a short time when it was time for a retrace. So, the vertical sync signal was low the entire time that the TV was supposed to be drawing the frame (remember, vertical sync only pulses when the frame is complete and it is time to move the electron beam back to the top), and this meant that the output of the sync combining AND gate was also low. Effectively, the TV was killing the horizontal sync pulses and therefore couldn’t figure out where to start drawing each line! The built-in circuitry in the TV was smart enough to not even attempt to draw the lines without seeing valid sync signals. Notice in the simulation below that with positive sync polarity, the only time something makes it through the AND gate is during the vertical sync pulse, when a few horizontal sync pulses make it through (these are the only times that both inputs of the AND gate are high).

Luckily, the fix for this was simple: change from positive sync polarity to negative sync polarity. This means that the sync signals are normally high and only pulse low when it is time for a retrace. With this setup, the vertical sync signal is high the entire time the TV is supposed to be drawing the frame, therefore, negative pulses on the horizontal sync signal will still make it through to the output of the AND gate (remember, if only one of the inputs to the AND gate goes low, the output also goes low).

I made the change in my code, hooked everything up again, and…success!

An FPGA-based pattern generator! Note: the extra circuitry attached to the iCEstick consists of a 74LS244 line driver IC (purchased of course from my favorite local parts store) and 5V power supply to boost the output of the iCEstick.

Project: Using an FPGA to display RGB video, Part 1

Lately I’ve been refreshing my Verilog skills—Verilog is a hardware description language (or HDL), which means that the code you write can be synthesized into actual hardware (e.g. logic gates and flip flops). As luck would have it, I stumbled across a great book that allowed me to combine learning Verilog with one of my passions, vintage computer and video game hardware. The book is called Designing Video Game Hardware in Verilog, written by Steven Hugg. In addition to the book, the author created an awesome Verilog IDE (Integrated Development Environment) on the 8bitworkshop website, where you can explore sample code, as well as write your own code. Not only does this IDE include a waveform viewer so you can see the signals your code is driving, it also includes a virtual TV screen, allowing you to write code that creates digital RGB signals and to immediately see what the results would look like if you connected your hardware to an RGB TV or monitor.

As soon as I saw this book, I thought about making something that would drive my vintage Sony TV—I wrote about building an RGB cable for this TV in a previous post. One way to actually implement what you’ve written in Verilog is to synthesize your code and download it into a field-programmable gate array, or FPGA chip. The book suggests using an iCEstick evaluation board, which is based on a Lattice FPGA. One nice thing about this board is that it comes with an onboard USB interface, so it will plug directly into your computer for programming without any additional hardware. Another great thing about this board is that there is an open source toolchain (IceStorm) available to program the FPGA using Verilog, which means it’s totally free to use the tools!

The first thing to do was download the tools and make sure I could install and use them. Thankfully, there are scripts that will automatically complete the installation on OSX (using Homebrew), and I was able to get through this with only a few easily resolved hiccups. Next, I tried using the tools to go through the complete Verilog to FPGA flow. There are four tools needed to go from Verilog to a programmed FPGA:

  • yosys takes your Verilog code and synthesizes it into an actual logic circuit
  • arachne-pnr takes the circuit from yosys and, with knowledge of the specific FPGA you are using, does place and route (determining how to map the logic circuit to the resources available on the FPGA)
  • icepack takes the output of arachne-pnr and converts it to a bitstream, which can be directly downloaded into the FPGA in order to configure it with your circuit
  • iceprog uses the USB port to send the bitstream to the FPGA, programming it

For my first design, I decided to implement a simple SMPTE color bar pattern generator. This would allow me to see all 8 colors possible with 3-bit digital RGB, which is what the examples in the book use. Thanks to the 8bitworkshop IDE, I was immediately able to see the TV output of my code:

Whoops! I swapped the position of the red and blue bits, so the colors aren’t in the correct order. The beauty of using Verilog to define hardware is that a change is as simple as editing your code. A quick fix and everything was working correctly. I ran the IceStorm toolchain and everything seemed to go okay, so I was ready to order the iCEstick evaluation board. In my next post I’ll talk about my experience with using this board to try to get a picture on the TV!

Project: RGB Cable for Sony KV-20XBR

Some time ago I acquired a Sony KV-20XBR 20” Trinitron TV. This and the companion 25” KV-25XBR TV were Sony’s first XBR series TVs, top of the line models that (according to the Chicago Tribune) retailed for $899.95 (20”) and $1,199.95 (25”) when they were introduced in the mid-1980s.

One of the interesting things about this set is that it has an RGB input, an uncommon feature for consumer TVs of that era. RGB stands for Red/Green/Blue, a video signal format where the red, green, and blue signals that make up the TV picture are sent on separate wires, allowing for a sharper picture with more accurate colors. In the 1980s, there weren’t many consumer devices capable of outputting an RGB signal, and with the advent of high definition TV, most electronics manufacturers would adopt the component video standard instead. However, there were several personal computers that could output RGB signals, and later there would be some video game consoles that supported RGB (e.g. the Atari Jaguar, Super Nintendo, and Sega Genesis, to name a few).

In order to use the RGB input on my KV-20XBR, I needed to build a cable that would interface to the Sony-specific connector on the back of the TV (labeled “RGB MULTI INPUT”).

This 34-pin connector happens to be the same connector used on many floppy drives (remember those?), and for fast cable construction with these types of connectors, I like to use an IDC connector with a ribbon cable—no soldering required. For the other end of the cable, I decided to use a 15-pin female D-sub connector, since there are many devices that will interface to this connection and it’s fairly easy to still find cables (often referred to as VGA cables). Again, I decided to use crimp-on pins for the D-sub connector for quick construction. Once the pins have been crimped on to the cable, it’s easy to insert them into the D-sub connector, where they lock in place. Here is a photo of the D-sub connector, the ribbon cable with crimp-on pins, and the crimping tool I used.

Having a good crimping tool makes for neat and reliable connections—I got mine at a wonderful Bay Area electronic components store called Anchor Electronics. In fact, I got everything I needed for this project there, including the rainbow ribbon cable (which makes it easier to keep track of which wire is which) and the D-sub connector with crimp-on pins. Stores like Anchor are an electronics hobbyist’s dream—in addition to parts for making up cables, they have a large selection of components, including resistors, capacitors, transistors, and ICs.

Before hooking any new cable up to a live circuit, I check and recheck my connections for correctness using the continuity function of a DMM. I’m often working with vintage gear that is difficult (if not impossible) to repair or replace, so I want to make sure there are no short circuits. With everything double checked, it was finally time to test the cable. I got out my Atari Jaguar, hooked everything up, hit the RGB button on the TV, and…success! (Note the similar ribbon cable to D-sub connector I built in order to access the Jaguar’s RGB output, which also has connections for stereo audio. I added audio connections to the Sony RGB cable after the photo was taken).


My name is Garrett Holthaus. I am an engineer and teacher living in Silicon Valley, California. I have had an interest in electronics and computers since a young age, when my dad would bring me downstairs to his basement shop to help him repair a broken TV, stereo, or other household appliance. When I was 6, my family got our first computer, an Atari 800XL, and my experiences with that machine motivated me to study electrical engineering and computer architecture in college.

I worked on microprocessors as a functional validation engineer for years before deciding to shift my career to another one of my passions, teaching and education. I got my California teaching credential and taught two years of high school physics, including (of course!) a unit on electricity and electronics.

Ever since those early days in my dad’s shop, I have been an avid electronics hobbyist, repairing and restoring vintage electronics (such as antique radios and record players), and collecting the Atari computers that I enjoyed so much as a kid. I especially enjoy resurrecting older technology and interfacing it to modern electronics, such as when I used an Arduino board to emulate the Apple II bus and drive a Sweet Talker speech synthesizer card. This blog will detail some of my adventures in both vintage and modern electronics. Thanks for visiting!