Sometimes a project goes so smoothly from start to finish that you’re left feeling all warm and fuzzy, and the whole experience is a real thrill. You look back on what you’ve built, marvel at how awesome you are for building such a fine thing so efficiently, and can enjoy the memory for years to come.
This is not one of those times.
You wouldn’t think a 1.5″ square PCB could cause much trouble, especially when you’ve built dozens of such boards before. This is one project where a truly astonishing number of things went wrong, yet I persisted despite myself, ultimately ending up with nothing to show for it. Hold on, I’m getting ahead of myself here.
Previously, I got a nice display solution up and running for my IIc Plus project. One of my specifications was that the screen needed to be in the 8-10″ size range. You may have wondered why. The reason is that I’m in the midst of prototyping an add-on product for the Apple IIc and IIc Plus that I’m code-naming Teddy Top. It’s so-named because it lives on top of the Teddy (which was one of the prototype codenames for the Apple IIc computer). Teddy Top is a hinged display that mounts to the top of a IIc, similar to how a clamshell-style laptop works. It serves a similar purpose of protecting the keyboard for transport, while providing a convenient display anywhere you go. In this article, I get started with mocking up the display portion of the Teddy Top.
First things first, we need to get inside this monitor and see what we have to work with.
The plan is to drive this display from the IIc’s Video Expansion port. You may recall from a while ago that I was very interested in this port. It’s now time to make good on my threat to hack with it. Here’s the relevant information from the Apple IIc Technical Reference manual on this delightful port.
The parts I’m interested in are +12V, Ground, and NTSC video. According to the manual, the 12V source can drive up to 300mA. By astonishingly lucky coincidence, the LCD panel I bought runs on 12V and draws 200mA. However, instead of just marveling at my good fortune, I decided to “do better” than just wiring the panel into the machine. This is where things go very pear-shaped indeed.
My thought was a noble one. I thought to myself, “Self, sure, the ammeter says this panel is drawing 200mA, but can I trust it? What if it spikes sometimes or draws more in some situation I don’t know about? Shouldn’t I protect the poor IIc from such risks?”. I set out to design a little bridge board that would sit between the panel and the IIc to protect it from harm. Little did I know what I was in for.
To start with, I dug up this nice little current-limiting circuit. It’ll work with most any NPN power transistor, and you can tune it to set the maximum allowed current. If the load tries to draw more than that, the transistor will start dropping the voltage and dissipating the excess power as heat. If the load is really high, the transistor will ultimately blow, sacrificing itself instead of harming the IIc. You might be thinking, “why not use a simple fuse for that, then?”. Well, that would be entirely sensible, but Blondihacks is not known for sensibility, and I wanted to try out this neato current limiter. I had many many chances to quit while I was ahead here, yet I proceeded. Not simply installing a fuse and calling it a day was Fail #1. Buckle up, kids- it’s gonna get so much worse before it gets better.
Input voltage can be anything in the 5-15V range. The value of R2 sets the maximum allowed current. The catch with this circuit is that the value of R2 needs to be very precise. Theoretically, I(max) = 0.7/R2. I wanted to limit the current to 250mA, to give a nice safety margin for the 300mA limit on the IIc’s expansion port. In theory, that means I need R2=2.8Ω. In reality, the value depends on the exact implementation, so it needs to be dialed in experimentally, as we’ll see. However, that equation is a good starting point.
As for the transistor, pretty much any power NPN will do. I found this one in the junk pile, and I’m not even sure what it is. Googling turned up enough information to know it was an NPN transistor, but I never did find a data sheet for it.
Next up, I prototyped the circuit on the breadboard, both to make sure my transistor was correct, and to dial in the value of R2.
It works! Or does it? There’s a critical error in this mockup that I didn’t catch. It will come back to bite me in a major way later.
Ignorantly satisfied with this test, I proceeded to lay out a PCB. A circuit this simple would take only minutes to build on perfboard, but I like making PCBs, so I decided to do it. This is Fail #2.
In my haste to lay out a nice board, I neglected to consider how the pins on the input header might map to the pins on the DB-15 port used by the IIc’s Expansion Port. In a moment of major absentmindedness, I simply mapped the header pins to the port pins as they happened to be numbered in the Eagle part. This was Fail #3.
Next, I proceeded to etch this board using my usual method. Sometimes, being too comfortable with something is a source of error. Such was the case here. I’ve etched so many boards with this method and had so much success with it, that I got complacent about the kinds of errors that can creep into the process.
After exposing the board, it was ready for developing. However, the developer didn’t seem to be working. This batch of developer is many years old (this stuff lasts a long time), so I figured maybe it was finally time to replace it. I poured a fresh batch of developer into a bowl, and transferred to the board to it. The board instantly developed, then the traces were immediately obliterated. What was this? I’d never seen that happen before. Fail #4.
Trying to be scientific about it, I reasoned that the developer’s job is to remove the film which wasn’t cured in place by the UV exposure (which in turn protects the traces). If the traces are being wiped out, they must not have been cured properly. Perhaps I didn’t expose long enough. I used my usual exposure time, but these copper boards are old, and maybe they need more time. I exposed another board for 25% longer, and developed it again. It was instantly obliterated. Fail #5.
Undeterred, I increased the exposure time by 50%, re-exposed, and re-developed. The board was obliterated. Fail #6.
Thinking I was modifying the right variable, but in the wrong direction, I drastically reduced my exposure time. Re-expose, develop, and… obliterated. Fail #7.
Stumped by this, I decided it was time to RTFM. Re-reading the instructions on the developer (which I haven’t done since making this batch five years ago), I was reminded the developer is supposed to be diluted 10:1. I still have a bruise on my forehead from the magnitude of that facepalm. Fail #8.
With that sorted out, I suddenly also realized my mistake earlier whereby I ordered the pins arbitrarily on the header. Determined to get that right, I busted out my notebook, and worked out the proper assignments. This was my first time using IDC ribbon connectors, and I wanted things to look nice.
All the deduction you see above is correct… except it’s inverted. I neglected to account for the orientation of the PCB in the final enclosure, which means the plug is upside down from where I thought it would be. Fail #9.
Unknowingly, I felt chuffed about working all that out, and proceeded to etch the PCB with the new layout. I drilled the board, and began assembly, only to realize… I had inverted the exposure mask, so the PCB was a mirror image. Fail #10.
At this point it was personal. I was not going to get beaten by this damn board, even though I could have hand-made a dozen on perfboard by now. I very carefully checked and re-checked the mask to make sure it was correct, and etched another board. I had checked it so carefully, that I knew it was right, so I drilled it and began assembly. Only to find… it was inverted again. Fail #11.
The mind boggles at this, but I wasn’t going to give up. I regrouped, carefully aligned the board with how it was in Eagle, and exposed it again. Again confident that I had triple-checked the orientation, I drilled it and prepared to assemble the board. You guessed it, it was inverted. I wish I was making this up. Fail #12.
It finally hit me what the problem was. I haven’t used Eagle in a while, so I was a bit rusty with it. I forgot a quirk that has caused me some trouble in the past. When looking at the traces in Eagle’s board layout tool, you are looking down on them through the PCB, as though it were transparent. You are not looking at the copper from underneath. My brain always struggles with this, like some kind of PCB dyslexia. A Blondihacks reader once suggested always putting some text on the PCB so you can immediately see if it’s flipped or not. I disregarded this advice here, and it bit me. Three times.
Well, there was no way I was giving up now. After playing a Rocky training montage in my head, I was determined to come back and totally crush this board. I etched a final one in the correct orientation and proceeded to assemble it. Wouldn’t you know, this simple assembly fought me at every step. I got a bunch of solder whiskers that needed cleaning up. The pins on the header were oxidized and solder wouldn’t stick. I applied too much heat at one point and lifted a trace. I made every rookie mistake in the book on this. It was like the experienced board builder inside me was wiped out by a brain tumor or something. Don’t worry, eet’s nod a tooma.
With the PCB built, it was time to test it out. On my breadboard, I had determined experimentally that a 2.2Ω resistor worked well to calibrate the current limiter for 250mA. On the PCB, that limit shot up to 310mA. Fail #13.
The resistance on the PCB traces was different enough from the breadboard that the calibration was now off. Not having a tiny potentiometer that I could solder in for adjustment, I needed to find a value for a single resistor that I had on hand that would work. The trick is, it has to be installed fully in-circuit, or it won’t be an accurate test (as I learned with the breadboard). After several iterations of soldering and unsoldering a resistor into the R2 location, I determined that a value of 3.7Ω would work, which I could construct from two resistors in series that I happened to have. I hacked the two of them onto the board in the spot intended for one, and pressed on.
So far so good, right? We persevered through all the failures, and we’ve got something that will work. Time to hook it all up for real!
At this point, I did some probing to verify my signals were all correct before connecting the IIc Plus, and realized my mistake from earlier where I had inverted the IDC connector during my laying out of the wires. Fixing it meant either rebuilding the PCB yet again, or twisting my ribbon cable over. I really didn’t like either of those choices, because I was very sick of building this PCB, and for space reasons it was important that the ribbon lay flat. Since I’m only using three of the 15 signals, I opted to twist those and leave out the rest. I had intended to run all the IIc’s signals up to my board to allow easy future expansion, but I’ll fail that bridge when I come to it.
Next, I needed to connect the LCD driver board to my bridge board. The built-in DC power and RCA connectors were taking a lot of space, so I opted to strip them off and solder in my own connector instead.
And…. nothing. The machine powers up and the backlight comes on, but the video won’t lock to the signal.
This makes no sense. The board matches the schematic, the schematic matches the breadboard, and the breadboard worked perfectly. Yet it was pretty clear what the problem was- the video signal wasn’t happy with its ground. The one weird thing about this board design is that the video signal is getting ground through the current-limited power supply. I wasn’t sure if this would work, but in my tests on the breadboard, it did. Yet, if I removed my limiter and patched the LCD directly into the IIc, everything worked. What was going on? I had dismantled my breadboard already, but luckily, I had photos of it (taken for this very blog, in fact). I zoomed in on the circuit, and the answer hit me like a slap in the face with a soggy catfish.
Do you see it? That green wire is the ground being provided to the LCD for power and video. Now look at the schematic from the top of the article. See it? If you know your TO-220 pinouts, you know that my ground in this photo is on the COLLECTOR, not the EMITTER as it should be. In this arrangement, I have in fact completely bypassed the current limiter without realizing it. This idea of running the video and power for the panel through a current limiter was an invalid one all along. Fail #14.
The video signal needs a direct ground from the IIc. I can’t run a dedicated ground wire for it, because the grounds are unified on the LCD driver board, which would create a short circuit across the back of my current limiter. At this point, I had no choice but to cut my losses. My whole idea was flawed from the start, and I had to travel a long horrible road to figure that out. In the end, since the panel only draws 200mA anyway (as verified by my multimeter), I opted to simply wire it into the IIc directly as I should have done in the first place.
If I’m worried about protection, I’ll put a 250mA fuse in there, like a normal person would have done from the very beginning. I was trying way too hard to be clever here, and it bit me in the ass. It bit me 14 times, in fact, and boy is my ass sore.
So, here’s a boot-up demo of the final display prototype. This entirely powered by the IIc. There’s nothing external connected here. The ribbon cable at the bottom runs down to the video expansion port on the back of the machine.
Here’s hoping the Teddy Top prototype goes a little smoother from here on. Now if you’ll excuse me, I need to go sit on something soft.