Okay, so I’ve already fessed up to some errors I made with my first-ever PCB. Now I’ve discovered another, and it’s a doozy. It’s also a valuable lesson.
I’m waiting for a few bits of kit in order to do surface mount soldering. I’ll be writing more about this when it’s all installed (but as a teaser, it’s a hot air rework station and a compressed air controller to drive a syringe of solder paste). In the meantime, though, I thought, ‘What the hell, I’ll warm up the iron and do one of these boards by hand’.
And it didn’t go too badly. The 1812 resistors were a doddle. The 1206 capacitors were a bit more of a fiddle – two went on fine, but the other was a nightmare. The real challenges were the two ICs. The 74HC595 shift register is a SOIC-16 package with a 1.27mm pin pitch, while the TXB0108 level shifter is a TSSOP-20 with a 0.65mm pin pitch and pins smaller than a bee’s dick (to use Dave Jone’s memorable expression).
And yet they went on reasonably well. I found the best method was to tin just one pad and, keeping the solder molten with the soldering iron, nudge the chip up to it with tweezers. That then tacks the chip in place.
All of this was done with the aid of an anglepoise lamp with a large, built-in magnifier to which my nose was firmly pressed.
By the way, I keep seeing electronics greybeards insist that you should use a chisel tip on your soldering iron, not a pointy tip. I’ve always used a pointy tip; but not being one to ignore the advice of the sages, I recently switched to a chisel tip. And hated it. Couldn’t solder a decent joint to save my life and found it impossible to get into small spaces. So for this project I went back to the pointy tip and am happy once more.
So anyway, instead of the DB25 connector, of which I only have a few, I decided to solder jumper leads into the holes so that I can connect to a breadboard for testing. I set up an eight-segment bar LED unit to show the status of the data lines. This was on the breadboard that’s part of my AVR ATMEGA programming and test platform (version 2).
I also connected up some of the other signal lines to pins on an ATMEGA328P and wrote a test program.
Then the first problem: once everything was wired up, I couldn’t upload the code to the microcontroller. By a process of elimination (unplugging one connection at a time) I traced the issue to the strobe line. On my board, the strobe line (which is active low) is pulled high with a 10kΩ resistor. But, when probing the board with a multimeter, I found that there was a solder bridge that was also connecting the strobe line to ground! This is at the point when the board connects to one of the microcontroller’s pins. That was enough to cause issues with program uploading. I left this line disconnected as a problem for another day.
In my test program’s main loop I sent incrementing values to the shift register, starting at 0 and going up to 255 before starting again. This meant the bar LED should have acted as a binary counter. But it didn’t. The values were all over the place. It started well, with 0 and then 1, but went to hell after that.
Maybe it was my code, rather than the board. So I set up another 74HC595 in a PDIP package on the breadboard and tried it with that. This exhibited a different but equally bizarre phenomenon. It counted up fine, but showed only odd numbers. Even numbers appeared as blanks, or zero.
Then I noticed an error with my board setup. I was powering the chip from one of the power rails down the side of the breadboard. Except that it wasn’t – I’d forgotten to run power to that rail! (Ground, on the other hand, was connected.)
It seems that odd numbers worked okay because the chip was getting powered whenever the Q0 pin was enable. (Reminds me of the story of the first ARM chip prototype when the folks at Acorn realised that, during testing, they’d forgotten to power the chip but it was running fine from power provided by inputs.) Powering the chip showed me that my software was functioning properly.
So what was wrong with the board? Out came the multimeter again, set to continuity testing, and I started buzzing out traces. The shift register’s outputs were indeed going to the right connections on the DB25. Okay, so what about the other pins?
Oh-oh. The VCC pin showed no connection to my 5V input. The chip wasn’t getting power.
And here beginneth the lesson. Fairly early on, in my board layout in KiCad, I’d placed a VCC fill on the top layer. I then connected various things that needed 5V to this fill. But in placing some components I hadn’t noticed that a couple of areas of this copper fill had effectively become disconnected.
So, neither the shift register chip nor the pullup resistor for the ACK line are connected to VCC.
I decided to solder a bodge wire to the chip’s VCC pin from a point that was getting power. But I had one of those mornings and – well, long story short, I managed to rip the leg off the chip!
I’s just as well I order 10 of these boards.
[Update: 16/04/2018] I decided to make up another of the boards, but just the shift register section. That means the 74HC595 itself and a 100Ω pullup resistor to keep the master reset (/MR) line high (it’s active low). I should have installed the bypass capacitor too – I’ll do that later.
And, to fix the problem mentioned above, I soldered in a bodge wire, connecting the chip’s VCC pin to the VCC pad used for the resistor.
And it works!
So that lack of VCC was the problem. I may add some of the other connections to the board. But now that the header pins for the 5V connections are in place it’s going to be difficult to solder on the level shifter. So this will be a 5V-only version of the board, which is fine.
So, my circuit design was okay and my board layout was mostly okay except for that one cock-up.
This was meant to be a learning experience and it has been. On the whole, I’m very happy with the results.
[Update: 17/04/2018] I’ve now also connected up the other five signals – strobe, init, ack, error and busy.
The strobe and init signals are output from the host to the printer. Both are active low. I put a 10kΩ pullup resistor on the strobe line but not the init (can’t remember why). I’ve run each to an LED on the breadboard and they’re working as expected.
The ack, error and busy lines are controlled by the printer. Ack and error are active low while busy is active high. So here’s another cock-up: I put pullups on ack and busy when it should have been ack and error. It’s not that big a deal for what is a very experimental board (I can just remove the resistor from the busy line).
And the signals work as I’d hoped. So that’s all good.
In my defence, there’s a lot of conflicting information out there about signals on the various implementations of parallel ports. But I’ll get into this more when I give more details about my planned DottyMatrix board.