Hardware Reference
In-Depth Information
Driving Logic Interfaces
For LEDs, the requirements of the interface are rather simple. The interface is a success
if the LED is lit when the output port is in one state, and the LED is dark in the other. The
precise voltage appearing at the GPIO output pin in these two states is of little concern, as
long as the maximum current limits are respected.
When interfacing to logic, the output voltage is critical. For the receiving logic, the
output level must be at least V IH to reliably register a 1 bit (for the BCM2835, this is 1.3 V).
Likewise, the output should present less than V IL to reliably register a 0 in the receiver (for
the BCM2835, this is 0.8V). Any voltage level between these limits is ambiguous and can
cause the receiver to randomly see a 0 or a 1.
There are a fairly large number of approaches to interfacing between different logic
families. A good source of information is provided by the document “Microchip 3V Tips 'n
Tricks.” 31
Another document titled “Interfacing 3V and 5V Applications, AN240” describes the
issues and challenges of interfacing between systems. 32 It describes, for example, how a
5 V system can end up raising the 3 V supply voltage if precautions are not taken.
Approaches to interfacing include direct connections (when safe), voltage-dividing
resistors, diode resistor networks, and the more-complex op-amp comparators.
When choosing an approach, remember to consider the necessary switching speed
of the interface required.
Driving Bi-color LEDs
This is a good point to inject a note about driving bi-color LEDs. Some of these are
configured so that one LED is forward biased while the other is reversed biased. This has
the advantage of needing only the usual two LED leads. To change colors, you simply
change the polarity of the power going into the pair.
To drive these and choose a color, you need a way to reverse the current. This is
normally done using the H-Bridge driver, which is explored in Chapter 7 of Experimenting
with Raspberry Pi (Apress, 2014). There a bipolar stepper motor is driven by the H-Bridge
driver. The LED, however, requires considerably less current, and so this is an easy
assignment. If you choose a bi-color LED requiring 10 mA or less, you can drive it directly
from a pair of GPIO outputs.
Figure 10-7 illustrates the bi-color LED driving arrangement. Compare this
configuration with the H-Bridge in Figure 7-1 in Chapter 7 of Experimenting with
Raspberry Pi (Apress, 2014). Do you see the similarity?
 
Search WWH ::




Custom Search