TTL Basics

TTL, or transistor-transistor logic is incredibly important in all forms of digital electronics, including microcontrollers. All of what I have to say about TTL will be based around practical usage regarding the MSP430 microcontroller family. If you want to learn all the specifics about logic gates, go here. Much of what I learned comes from the TTL Cookbook which is an incredibly useful book, especially if you're interested in 74xx series chips. Many/most of the fundamentals described in the book can applied to microcontrollers, though, so even if you're not interested in the old 74xxes, consider getting a copy. It can be found on AbeBooks for about $5.

hi and lo

TTL operates exclusively within the lovely realm of binary; 0s and 1s abound. Despite what you may have learned from such PBS programs as “CyberChase” there are not literal worlds full of people and things within chips and circuitry, instead there are merely pulses of electricity. As such, there has to be some way to represent a 1 or a 0 without an actual 1 or 0. And, as luck should have it, there is: it's voltage.

It's possible to refer to these two states as 0 and 1, and most people will probably understand what you're talking about, but it's generally a bad idea and should be avoided. The proper way to describe these two states is with the words “high” and “low” (often abbreviated as “hi” and “lo”) which represent 1 and 0, respectively. At this point it should be clear to understand why individuals tend to use phrases like “hold such and such a pin high” rather than “hold such and such a pin 1.”

High and low are generally easy to understand provided you don't get them switched around. As stated above, high represents a 1 and low represents a 0 - but what does this mean in terms of voltages? Typically, your high signal is the same as whatever voltage the chip is powered off of - in the case of an MSP430, your chip will often be powered by 3.3-5v, and this will be the threshold for a high signal. To pull a pin low, provide it with 0v - something most easily accomplished by pulling it to ground. However! Neither of these options, holding a pin high or pulling a pin low, can be done directly, they must be performed through the use of pull-up/pull-down resistors.

A simple example of using such a resistor can be found in doing an everyday breadboarding task with the MSP430: holding the reset pin high. For the MSP430 to work, its reset pin must be held high. This is done by bridging the pin and Vcc with a resistor - a value between 1kΩ and 5kΩ should work fine; the launchpad uses a 4.7kΩ. To reset the MSP430, give the reset pin a route to ground that exists before the pull-up resistor. Electricity will take the path of least resistance and the MSP will be reset.

The button on the launchpad works in the same way. The state of P1.3 is naturally high, so under unaltered circumstances it is held to Vcc through a 4.7kΩ resistor. When the button is pressed, a route to ground is inserted between the pin and the resistor. Whether a pin is naturally high or naturally low doesn't really matter as far as the MSP430 is concerned - changing input parameters is very easy to accomplish through software.

ttlbasics.txt · Last modified: 2020/07/24 17:16 (external edit)
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0