A Reproduction AdLib Sound Card

Projects 8 Comments

Growing up, I used to play some games on an AST 286 computer, including Commander Keen, Wing Commander, and a few others.

Sound in those days was primitive compared to modern machines, but I still have a soft spot for the bleeps and bloops of the OPL2 synthesizer cards (which includes the AdLib).

Recently I have been fixing up an IBM XT (with original CGA card!) and I needed a sound card. It turns out that early sound cards like the AdLib or the Sound Blaster are quite expensive on the used market, so I thought I’d make a clone of the AdLib sound card (1990 version). Being me, I couldn’t just make an electrical equivalent. It had to look as close as possible to the real thing.

Here it is.
my_adlib2

Compare it with the original 1990 version of the AdLib sound card.

I started with Sergey’s OPL2 card and corrected some differences between it and the genuine AdLib card. Since I don’t own a physical card, I found photos on the net of the front and back of the card to use as a reference. To make sure everything matched up exactly, I figured out the design grid of the original and duplicated the traces and component placement as closely as possible. All the library footprints are custom designed to match!

The KiCad design files are available on GitHub. Mouser part numbers are embedded in the KiCad design but they are also included in the table below. The Yamaha OPL2 chipset, the YM3812 and YM3014B pair, can be found at various sources online. They were socketed on many older Sound Blaster cards, so I suspect quite a few were recovered by the scrappers.

Q Designator Description Mouser Part
1 J1 CONN_01X05 490-SJ1-3553NG
1 U6 YM3812
11 C4,C5,C24,C2,C25,C20,C19,C26,C1,C14,C16 0.1uF 581-AR215C104K4R
1 D1 D 512-1N4148
1 Q1 2N3904 512-2N3904BU
2 R1,R13 8.2K 291-8.2K-RC
6 R2,R3,R6,R7,R11,R12 2.2K 291-2.2K-RC
1 R4 12K 291-12K-RC
4 R5,R9,R10,R16 10K 291-10K-RC
1 R8 1.5K 291-1.5K-RC
1 R14 POT 652-91A1A-B24-D15L
3 R15,R18,R19 10 291-10-RC
1 U1 74LS109 595-SN74LS109AN
2 U2,U3 74LS138 595-SN74LS138N
1 U4 74LS245 595-SN74LS245N
1 U5 74LS04 595-SN74LS04N
1 U7 YM3014B
1 U8 RC4136 595-RC4136N
1 U9 LM386N 926-LM386N-4/NOPB
1 C18 10uF 647-TVX1C221MAD
4 C7,C6,C9,C8 4700pF 581-AR211C472K4R
1 C12 1000pF 581-AR211C102K4R
1 C17 0.047uF 581-AR215C473K4R
1 C13 270pF 594-S271K43SL0N6TK5R
6 C23,C21,C22,C11,C3,C15 10uF 581-TAP106M025CRW
1 C10 4.7uF 581-TAP475K016SCS
1 MNT1 CONN_01X01 534-9202

To install the card in a computer, you’ll need to get a Keystone 9202 bracket. The KiCad layout includes a drawing showing where the holes need to be punched in the bracket. I recommend using a hand-held sheet metal punch with a 7mm or 9/32 die. You could also drill it but the punch makes a much cleaner hole.

Here’s a bonus photo showing all the parts laid out before soldering. The components were chosen to match the colors on the original card.

adlib_knolled

CRT Magnetic Deflection Driver Design

Projects 16 Comments

I’ve uploaded the design files for my CRT deflection yoke driver board. This works for CRTs that use magnetic deflection. For a complete design, you will need the following boards:

  • ScopeMag
  • ScopePower – +1KV power supply
  • ScopeVideoOnly – Video amplifier, focus chain, and nothing else (the ScopeDefl electrostatic design combines this amplifier with the electrostatic deflection amplifiers)
  • ScopeVideo – +60V video amp bias supply

Gerbers are in the repository but you can get them directly from OshPark by clicking the links for each board above.

This board, unlike the others I’ve developed so far, requires both +12V and -12V. My projects typically use an Artesyn NFS40-7608J but it is now obsolete and a bit expensive, so you probably should use something else for power.

There are places on the board (C6/R9, C10/R20) for coil compensation components. You can figure out the values that you need with a little experimentation.

The board is designed for a vector-style yoke, not the far more common raster scan yoke that has a high inductance vertical deflection coil with lots and lots of turns. It can usually drive the horizontal coil no problem, but you’ll want to modify the vertical winding to reduce the number of turns. Check out my blog post on winding deflection yokes for more information on making your own.

The LM4765 audio amplifier, which drives the deflection coils, will dissipate a lot of heat so you will need to bolt it onto a good-sized heat sink (at least 3″ x 3″ aluminum with fins, not some dinky little TO-220 clip-style heat sink).

Circuit operation is pretty straightforward. CRT electron beam deflection is proportional to the magnetic field which is proportional to the current in the coil, so the LM4765 controls the coil current (measured through R14/R25) instead of the voltage. The current is therefore directly proportional to the input voltage (X or Y). An extra gain stage facilitates the width/height and left/right offset adjustments.

 

Vacuum Tube Op Amp Experiments

Projects 3 Comments

At the electronics flea market I recently found something particularly interesting…

This is a vintage Philbrick K2-W vacuum tube operational amplifier! Turns out they have quite the following. Sadly the original 12AX7 tubes were gone–somewhere, someone probably has rare GAP/R marked tubes in their guitar amplifier. I put in some generic replacements.

I decided to build a little jig to try it out.

This is based on the inverting amplifier schematic given in the K2-W datasheet I linked above. I added a simple linear power supply to generate the +/-300V rails. If you build your own supply, be sure to add bleeder resistors so you don’t get a nasty surprise after you turn it off and try to work on it.

After connecting a 10K series and 100K feedback resistor to the op-amp, I ran a 1KHz 5Vp-p square wave from my function generator into the circuit and saw this:

Neat! The top trace is the input and the bottom trace is the output. The bottom trace has a magnitude of 50Vp-p, as expected.

It’s really interesting to see how the short paragraph of specifications at the bottom of the first page of the K2-W datasheet developed into the formal electrical characteristics tables you can see in more modern op-amp datasheets, like the 741.

Build Guide for Mini Arcade Machines

Projects 19 Comments

Edit: Updated instructions to discuss the game ROM

Have an STM32F407 Discovery board? Have a CRT scope with XY inputs? Try out Asteroids and Battlezone for yourself.

Read the rest…

Battlezone Mini Arcade Source, STM32F407 Discovery Board Sound Mods

Projects 2 Comments

First, the source code for the mini Battlezone arcade machine is now online (GitHub), along with the code for the mini Asteroids arcade.

If you build either of those and try it out on an STM32F407 Discovery board, you will notice that no sound comes out. The reason is that the onboard audio codec has a LRCK line (left/right framing clock for the I2S audio stream) wired up to GPIO PA4, which happens to be one of the DAC outputs that we are using for the vector graphics generation. You’ll need to disconnect LRCK (U7 pin 40) from PA4 and wire it to PA15. I did it by cutting a trace (indicated with a black arrow) on the back of the board to isolate the PA4/LRCK net from the STM32:

And by adding a wire (indicated in red) on the top of the board from R48 to pin 77 (red arrow) of the STM32 (PA15):

Oh, and one more thing. To keep the audio mixer marching along, we had to connect PC6 to PC7. This ties the I2S MCLK to timer 3 channel 1, which triggers a periodic interrupt that mixes new samples into the audio output buffer. The easiest way to do this is to connect a jumper across pins 47 and 48 on the GPIO header P2. They are clearly marked on the board and the pins are right next to each other so this is easy.

Battlezone – Mini Vector Arcade Machines

Projects 18 Comments

If you follow me on Twitter, you’ve probably seen the picture of a CRT deflection yoke undergoing surgery. Well, it’s now installed in a mini Battlezone arcade cabinet that I built for Maker Faire this year.

It uses a 5-inch B&W CRT taken from a broken security camera monitor. I had to rewind the yoke to make the vertical windings fast enough to handle vector graphics. The horizontal windings were already pretty close, but they did need to be rewired to operate in series to reduce the drive current.

The CRT is a bit different than most of the old-style CRTs I work with. For the curious, it uses an EIA E7-91 style base which has an additional grid for acceleration purposes. The lower circuit board in the photo is a potentiometer resistor divider that develops a ~300V bias voltage to drive this additional grid. The upper board is a Cockcroft-Walton multiplier circuit to step up the 1KV power supply voltage to the 4KV necessary for the post-deflection acceleration (PDA) anode. I’m running this CRT a bit under voltage, and it works fine because I’m not trying to fill the whole screen with a solid raster.

The metal enclosure houses the power supplies–it is made out of soft steel with the idea of containing the stray magnetic fields generated by the power supply switching inductors. It works a bit, but I’ve had better luck in the past with mu-metal shields around the CRTs themselves. There are three power supplies: one steps 120V down to +12V, +5V, and -12V. Another steps +12V to +1KV, and the final one steps +12V up to +60V. These last two power supplies are detailed here. They are open-source hardware so you can build your own.

Outside the shield you can see the video amplifier board at the lower left, which is the same circuit used on my electrostatic deflection board but without the deflection amplifiers. At the bottom right is my new magnetic deflection amplifier board which drives the deflection yoke. It is based around an LM4765 audio amplifier IC. I’m not totally happy with the design but eventually I will release the board design. The green board in the upper middle is an STM32F4 Discovery board. The board to the right of it is an audio amplifier that drives the speaker.

The joysticks I machined out of small aluminum blocks. It took some experimenting to figure out how to arrange the springs to get the joystick to return to the center position. The joystick handle on the right is hollow to allow the wires for the fire button to pass through.

I also build a second unit with the same driving circuit but a different CRT–a 5-inch round 5AXP4. This CRT would originally have been used by a TV technician to look for problems with the chassis or the full size picture tube in a customer’s set. The glass is extra thick because the tube was designed to be handled more. This is the same tube that I started experimenting with last year.

Tiny CRTs in Action

Projects No Comments

Richard built up some of my CRT driver boards and put them to use, testing a variety of CRTs with interesting characteristics, such as the rare 1DP11 or the vintage RCA 913.

He’s also got a nice video as well:

If you plan to build up the CRT boards, I highly recommend you visit Richard’s page. He’s drawn up an excellent connection diagram that shows how to interconnect the HV power board, the video power board, and the deflection/video amplifier board.

Miniature Nixie Power Supply – How it Works

Projects 1 Comment

For more details and the video about the miniature Nixie power supply, see my original post.

First off, this circuit is not a Royer oscillator. As summarized by Jim Williams in his famous app note AN65, Royer developed a power converter using a transformer that saturates every cycle.

A coil saturates when the magnetic field (the B field) has reached the maximum that the magnetic core material can support: if the current (which is what creates the magnetizing H field) increases more, the magnetic field increases very little. The inductance, which is proportional to (B ÷ H), rapidly drops off, causing the current in the coil to increase at a much faster rate. Royer’s design detects this current spike and uses it to switch the transistors (2N74s, in his original paper) into their opposite state.


My circuit is a more common LC resonant converter. There are two transistors, Q1A and Q1B. Resistor R1 provides the bias current for the transistors and gets things started. Current (represented by the large red arrow) flows through the center tap of the coil T1 out to Q1A through its collector. The current in the upper half of coil creates a magnetic field, and the magnetic field induces a voltage in the feedback coil. This voltage reduces the base drive for Q1A and increases the base drive for Q1B (represented by the small blue arrow). When that happens, Q1A shuts off and Q1B turns on. The current in Q1B’s collector (represented by the large blue arrow) creates a magnetic field of the opposite polarity in the coil, and therefore causes the feedback winding voltage to reverse polarity (see the small red arrow), turning off Q1B and turning on Q1A. The cycle repeats as long as there is power.


Above are some approximate waveforms. You can see that the transistors go back and forth, driving the coil first one way and then another. Capacitor C1 and inductor L1 help determine the resonant frequency of the circuit. If you measure the voltage across the entire coil, you’ll see a sine wave.

The output winding of the coil has a lot more turns than the input winding, and it increases the voltage (at the expense of the current) dramatically. This high voltage AC goes through the half wave rectifier formed by D1 and gets filtered to DC by C2. R3 limits the current into the Nixie tube.

You might be wondering why T1 is actually an inductor–an 8.2 millihenry one. It just makes the project easier to build. You only have to wind 12 turns on an off-the-shelf part instead of buying a hard-to-find transformer core and adding all the windings yourself.

If you feel so inclined, try adjusting the component values. Start with C1 and then maybe R1 or even L1. Try changing the number of turns on the coil.

Miniature Coin Cell Nixie Tube Power Supply

Projects 22 Comments

Update 11/3/2014: Fixed the coil connections on the schematic, along with the inductance. Also, check out this post to see how the circuit works.

This project has been a long time in progress. It started years ago at a Maker Faire where I built a Nixie tube pendant powered by a lithium coin cell battery. Since then, I’ve decided to make a PC board and put together some instructions on how to build such a power supply yourself. These little supplies are great for steampunk jewelry or possibly single-digit Nixie tube clocks (they’re not quite strong enough to drive multiple tubes). The battery life should be around 3 hours or so for a CR2032 lithium coin cell.

The schematic is below–click for a larger view. The bill of materials is located here, including Mouser Electronics part numbers. If you decide to order, get at least 5 of each part just in case you lose or burn up some of them.  Note: Mouser seems to be out of stock for the T1 inductor, but Digikey has it here.

Q1 is a single device; it actually contains two transistors which is why it looks like that on the schematic.

To make it easier to build, I’ve put up a convenient OSH Park project page link so you can order boards. When I ordered from them, it cost $2.80 for a set of three boards (with free USPS shipping). Not a bad deal at all!

When you have boards and components, there’s a specific order of assembly that makes things a bit easier. See this YouTube video:

Basically you need to assemble the components in the following order:

  1. Solder C1.
  2. Solder Q1. Be sure you line up the beveled edge with the extra-wide silkscreen. If you put it in backwards the power supply will not work.
  3. Flip the board over.
  4. Solder D1, then R2, and then C2. C2 is 0.01uF, similar to C1, but it has a 250V rating. It is very important not to mix these up.
  5. Solder R1, and then T1 (the big coil, not marked on the silkscreen).
  6. Take a piece of 32 gauge magnet wire that is 13 inches long and tin about 1/8 of an inch at one end. I use a soldering iron to burn off the varnish. Solder it into the upper left through hole that is below the coil.
  7. Wrap 5 turns clockwise around the coil T1. Thread the end of the wire into the middle through hole below the coil.
  8. Turn the wire around and thread it back through the same hole, pulling it tight to form a tiny loop. Solder the loop to the through hole.
  9. Take the wire and wrap another 5 turns clockwise around the coil. Thread the end through the top right through hole below the coil, and solder it in place. Trim off any excess.
  10. Get another piece of 32 gauge magnet wire that is 5 inches long, and tin about 1/8 of an inch at one end. Solder it into the lower left hole that is below the coil.
  11. Wrap 2 turns clockwise around the coil T1. Thread the end of the wire through the lower right through hole that is below the coil. Solder it, and then trim off any excess
  12. Solder the inductor L1. The reason it needs to be soldered last is that it makes it hard to wind wire around the coil T1.
  13. Solder connecting leads to the +, -, and OUT terminals.

To use it, connect a coin cell’s negative terminal to “-,” the coin cell positive to “+,” and “OUT” to the anode of a Nixie tube. The Nixie tube cathode goes to the coin cell negative terminal. Don’t touch the “OUT” terminal–you could get a shock. In fact, if you build the power supply into jewelry or something people will be touching, insulate all the connections.

Have fun!

 

A Miniaturized Discrete MC1466

Cleverness, Projects 11 Comments

Update: the bill of materials is now available. You can order boards from OSH Park using this direct link. Last time I ordered, it cost me a grand total of $3.55 for three boards (free shipping), and it took about two weeks for the boards to arrive.

I screwed up. My bench power supply is a Lambda LPT-7202-FM triple output (0-7V @ 5A, 0-20V @ 1.5A, 0-20V @ 1.5A), and I blew it up by trying to desulfate a lead-acid battery. The idea is to take a dead lead-acid battery and recondition it by charging it with a current-limited 15V source while feeding it high voltage pulses. I had a diode connected in between the battery and the bench supply to protect the power supply from the high voltage pulses. Well, the diode failed. It was a sad day.

Fortunately the service manual for the supply is available online. I traced around the circuit and found that two of the power control chips were fried, but everything else seemed OK–I could move the one remaining functional chip from channel to channel to confirm that. The control chips were marked with the Motorola logo and a Lambda house part number: FBT-031. A forum thread indicated that the part was actually the MC1466. Sadly this chip is long out of production and a bit hard to find, although a popular auction site had several listed from a seller in China (but who knows if the parts were counterfeit or not).

The datasheet has the full schematic including resistor values, but how do I know that it actually matches the chip? Since the IC is packaged in a ceramic DIP, I followed reader Uwe’s suggestion and took a chisel to one of the dead parts.

It worked and nothing was damaged! The die looks like this:

I went over the layout and it matches up with the datasheet schematic. Those funny round elements are actually zener diodes. You can see the long skinny resistors and the lateral PNPs as well as the NPN transistors and diodes. Below is the schematic (click to enlarge):

The IC design is pretty archaic. I’d say it dates to the late 1960s. There are fairly ordinary differential amplifiers, but the current mirrors are really strange, and the voltage reference circuit uses Zener diodes and series-connected diodes instead of a temperature compensated bandgap reference. The two Zener diodes (the only round features on the die) are probably just reverse biased NPN transistors, using the ~7.5V avalanche breakdown of the base-emitter junction. The lateral PNPs have a much higher breakdown voltage so they can’t be used this way.

Here’s a labeled die photo (click for a larger image) so you can see where each of the components are. The component designators match up with my schematic, not the IC datasheet schematic.

The device is simple enough that I decided to build a really small PC board with discrete components. I found that the BC847BVN (NPN/PNP dual transistor), BC847BV (dual NPN), and BAS16VV (triple diode) came in a really tiny SOT-563 package. Believe it or not, this is not the tightest or smallest layout I’ve done. This is a 2-layer board with 6 mil traces and 6 mil spaces.

To give you an idea just how small the SOT-563 is, take a look at the first BC847BVN I soldered:

The part is 1.05mm x 1.05mm! I had to use a very fine soldering iron tip and a microscope. Another trick is to use really thin solder (I used 0.38mm). As you can see, the resulting board is just slightly larger than the original DIP IC:

It really is pin compatible. I plugged two of them into my Lambda supply and now it works perfectly!

« Previous Entries