Behind The Pin: Logic Level Outputs

There is one thing that unites almost every computer and logic circuit commonly used in the hardware hacking and experimentation arena. No matter what its age, speed, or internal configuration, electronics speak to the world through logic level I/O. A single conductor which is switched between voltage levels to denote a logic 1 or logic zero. This is an interface standard that has survived the decades from the earliest integrated circuit logic output of the 1960s to the latest microcontroller GPIO in 2018.

The effect of this tried and true arrangement is that we can take a 7400 series I/O port on an 8-bit microcomputer from the 1970s and know with absolute confidence that it will interface without too much drama to a modern single-board computer GPIO. When you think about it, this is rather amazing.

It’s tempting to think then that all logic level outputs are the same, right? And of course they are from a certain viewpoint. Sure, you may need to account for level shifting between for example 5V and 3.3V families but otherwise just plug, and go, right? Of course, the real answer isn’t quite that simple. There are subtle electrical differences between the properties of I/O lines of different logic and microcontroller families. In most cases these will never be a problem at all, but can rear their heads as edge cases which the would-be experimenter needs to know something about.

Consider the Voltage

These differences are best approached from two angles: voltage and current. We’ve dealt with voltage differences before with a look at level shifters, but it’s worth revisiting some of the ground covered there with a short précis as it contains at least one trap for the unwary. We’ve mentioned that there are several different voltage standards for logic, and of those the two that we will most commonly encounter are the afore-mentioned so-called 5V and 3.3V families. In loose terms both recognise a logic 0 as 0V and a logic 1 as 5v or 3.3V, but of course it is a little more complex.

Each individual family of logic has a voltage range instead of a single voltage that it recognises as a particular logic level, and courtesy of TI’s marketing department we’ve reproduced a handy diagram showing them. The trap for the unwary lies with the two different types of 5V logic, the so-called TTL variants accept a much wider range than their CMOS stablemates. Thus a 5V TTL input will detect logic levels from a 3.3V output while the CMOS version will not, and many an engineer including us has been caught by using the wrong chip to interface between levels, only to find a circuit doesn’t work.

The variants carry the labels “TTL” and “CMOS”, but confusingly these refer to their voltage compatibility with the original TTL and CMOS logic families of the 1960s and 1970s rather than their manufacturing. A more recent chip with a CMOS fabrication process will often be available in both a “TTL” and a “CMOS” version. In the popular “HC” CMOS logic series which dates from the 1980s for example the “TTL” versions are denoted by a “T” in the part number such as “74HCT00” as opposed to “74HC00”.

And Then the Current

Once any concerns over voltage have been overcome, we can move on to the current properties. It’s easy to generalise about logic pins as all being the same: low impedance outputs driving high impedance inputs. A typical output should easily be able to supply enough current to drive a reasonable fan-out of other gates, the base of a transistor, or perhaps an LED through a series resistor. And as above in most cases that’s all a designer needs to know. But again therein lie a few gotchas. And since these are of the variety that can result in destruction of the part in question, it’s imperative to explore a little further.

There are two current figures to bear in mind when looking at an output pin on a logic chip or microcontroller. The first is the current an individual pin can supply, and the second is the total current that can be supplied simultaneously across all pins. Yet again we refer to TI’s 2017 Logic Guide (PDF) for a handy summary of the individual pin current for the multitude of different discrete logic families, and find a significant variation.

As an aside, the TI Logic Guide is an interesting document from a historical perspective, because unlike almost all other semiconductor product lines we find almost all the major logic families produced since the early 1960s together for comparison, and unbelievably still in production after all these years. We celebrate long-lived ICs such as the NE555 or the μA723, we really ought to do the same for the 7400 quad 2-input NAND gate. First brought to market in 1964 and in continuous production ever since, it is arguably the root from which all our current digital devices and computers grew. Without it we would have certainly reached the same point by a different means, but it could be seen as the first link in the chain of integrated circuits that led to our Core i7s or multicore ARMs today.

Back to our pin currents, and paging through the logic guide we find a significant variation in output currents between families. In most cases they list figures for a run-of-the-mill gate and for a buffer designed with a stronger output, so in this case we’re taking the lower figures from the everyday functions.