Introduction: Do You Need a Byte?
When developing (or debugging) microcontroller or Arduino applications you sometimes want to visually display several logic signals, several bits, perhaps a full byte. You can of course wire up a group of LEDs on your breadboard, but with all the series resistors this might take up some space and wires.
For a student course I was searching the net and eBay for a commercial breakout board for this purpose with no result. So here is my solution.
- 8pcs red 1206 SMD LEDs
- 8pcs 330Ω 1206 SMD resistors
- 1pc 33kΩ 1206 SMD resistor
- 1pc 74AC573 TSSOP20 package
- 1pc 13pin pin-header
Step 1: Background
In principle you could just connect an LED with a current limiting resistor to a digital signal and the LED will show you the state of the signal. However, there are three possible pitfalls here:
- the additional connection of an LED and the current through the LED might influence the state of the signal - especially if it comes from a source with a higher output resistance
- connecting several LEDs to the outputs of, for example an AVR microcontroller, might in the end overload the maximum allowed current output of the chip
- the lighting up of the LED will not securely indicate whether the signal will be interpreted by another chip as a definitive 0 or 1. It will only show that the voltage over the LED is high enough (with variations depending on the LED) to turn on the LED.
So instead you would want to buffer the logic signals and connect the LED to the output of this buffer. Here you have different possibilities:
- using individual transistors for each LEDs, as it was done by Atmel on the STK500 development board for AVR microcontrollers, even though I would disagree with their exact solution
- using a dedicated driver chip with parallel transistors in one package, like the ULN2803 for 8 channels
- using a standard CMOS logic chip with enough driving capability to connect e.g. 8 LEDs to its outputs.
Step 2: The Circuit
Since I probably will have to put together a number of these circuits for my students, I wanted a simple solution with as few components as possible. For once I also wanted to avoid through-the-whole devices in order to minimize the need for drilling. Using the ULN2803 would have been an overkill when it comes to the output capability, checking the availability and considering some additional functionality I decided to use the 74xx573 (74HC573, 74AC573,...) 8-bit transparent latch as buffer. Compared to the similar 74xx373 the '573 has the advantage of a more convenient pinout.
This particular chip also allows latching, i.e. locking, the current state of the chip's inputs and make the display static. This could be used together with an additional signal to allow for more complex diagnostics and debugging.
The function of the '573 as a transparent latch can be described in a few words. When the latch-enable pin 11 is held at a logic 1 or High, the 8 outputs of the chip directly follow the logic state of the corresponding inputs. Actually the logic inside the chip interprets the voltage on the input pins (2-9) according to its own supply voltage and the logic behavior of its technology (AC, HC, HCT,...) and sets the corresponding output to the same value. When the latch-enable pin 11 is set to 0 or Low, the previous state of the outputs is locked, Now the inputs can change without affecting the outputs. A logic 1 or High on the output-enable pin disables the outputs.
The circuit is quite simple: The 8 bit inputs of the '573 are connected to the data signals to be monitored, the latch-enable pin is held at High-level by a 33kΩ pull-up resistor, but can be externally overwritten by a logic Low to latch the current state. Since I want to have an LED indication (remember that's the idea of the project) I connected the output-enable input directly to GND.
Step 3: Preparing the Circuit
Since I plan to use this device on a breadboard, the external connections will be by means of a pin-header connector. The same connector will also be used for the supply voltage and the optional latch-enable signal.
Attached you will find a 1:1 PDF of the circuit board I designed in Eagle, as well as the Eagle-files. As described above I did the layout using SMD components - apart from the pin-header.
I produced the first batch of the circuit boards using the toner-transfer technique - already extensively described here on Instructables, e.g. PCB making guide. Based on my own experience and the tip from my students, the glossy photo paper available at the Swedish chain Biltema works best.
Because it is quite a small board I could fit 28 boards on a single A4 sheet of photo paper. The first batch was manufactured on a piece of circuit board big enough to fit 8 individual boards. The etching went well and I separated the individual boards afterwards. On each board I then have to drill the 13 holes for the pin-header - with my illuminated drill stand.
Step 4: Building the Circuit
After having drilled the holes for the pin-header, it was time to pick up the parts for the complete device. Since I had to do the soldering by hand for now, I started by plating each of the right-hand side pads for the LEDs with tin using the soldering iron.
The next step is to put one LED after the other onto the board, pressing it down while heating up the tin on the pad so that it flows around and under the contact surface of the 1206 package. Of course you should make sure you put the LEDs in the correct direction into the circuit, i.e. with the cathode facing to the common GND connection.
After all LEDs were in place I did the same for the eight 330Ω resistors and the 33kΩ resistor.
In order to solder the TSSOP20 package of the chip onto the board you should start by placing some tin onto opposite corners of the footprint. Then you press down the chip onto the board while heating up these two pins sequentially. Then you go from one of the other pins to the next and solder each pin to its pad. For this you press the pin down onto the pad with the tip of your soldering iron and once pin and pad are hot enough you add a small amount of solder.
Step 5: Correcting the Mistake
Taking all those photos for this instructable I made two mistakes while soldering the devices onto the board. First I forgot to attach one side of all the 330Ω resistors, which I normally would have done before soldering the chip and the pin-header. But this was not the worst thing.
Before I started soldering, I checked in which direction I had to solder in the LEDs. The cathodes of these LEDs is marked with a small green dot on the top of the 1206 package. These dots should of course point to the common GND connection of all LEDs. Well, putting it short, they didn't in the end, none of them.
So I had to desolder all LEDs, turn them around 180 degrees and solder them again onto the board.
Finally everything was in place, I tested the circuit and it works. Now I am waiting for the ordered parts for the next 10 boards.