ece 447: lecture 6 input/output interfacing leds, button switches & port multiplexing
TRANSCRIPT
ECE 447: Lecture 6
Input/Output
Interfacing
LEDs, Button Switches
& Port Multiplexing
ECE 447: 68HC11 Current Limits
GND=0 V
VDD=5 V
Maximum sink current
IOLmax = 1.6 mA
VOLmax= 0.4 V
VOHmin=4.5 V
Maximum source current
IOHmax = 0.8 mA
Sufficient to drive one input of a TTL device and about 10 inputs of an LSTTL device
ECE 447: Light Emitting Diode (LED)
IF
Forward current Forward voltage
VF
Typical values for common LEDs
IF = 10-20 mAVF = 1.7-2.4 V
+
–
ECE 447: LED Interfacing
VDD=5 V
I ≈ IF
Forward current
Forward voltageVF
VOL
buffer
Low Level Output Voltage
IOLLow Level Output Current (sink current)
R=?
R ≈ (VDD – VF – VOL) / IF
I ≈ IF IOLmax
VOL
VDD – VF – VOL
ECE 447: LED Interfacing
VDD=5 V
I ≈ IF
Forward current
Forward voltageVF
VCE Collector-Emitter Voltage
ICE Collector-Emitter Current
R1=?
R1 ≈ (VDD – VF – VCE) / IF
R2 (VOH – VBE) / IOHmax
R2=?
VBE
Base-Emitter Voltage
VDD – VF – VCE
I ≈ IF ICEmax IOH IOHmax
ECE 447: MAN-72: 7-Segment LED
ECE 447: LED
ECE 447: Single Switch/Push Button
ECE 447: Switch Key Bouncing
key bounce, tBOUNCE
typically, tBOUNCE < 10 ms
key bounce, tBOUNCE
ECE 447: Key Debounce in Software
key bounce, tBOUNCE
typically, tBOUNCE < 10 ms
debouncing delay debouncing delay
key bounce, tBOUNCE
update display
ECE 447: Key Debounce in Hardware
ECE 447: Port Multiplexing
• Allow multiple devices to share the input and output ports of the microcontroller.
• Additional hardware typically needed to support connection and selection of peripheral devices.
• Software typically selects the peripheral devices using additional output pins.
• Some I/O devices have built-in enable signals.
ECE 447: Port Multiplexing
Port CPort B
I/O device 1
74LS245DIROE
I/O device 8
74LS245DIROE. . . . . . .
. . . . . . .
. . . . .
MC68HC11
ECE 447: Port Multiplexing
Port CPort B
I/O device 1(e.g., LCD display)
I/O device 2(e.g., keypad)
74LS245 74LS244DIROE 1G
8
2G
MC68HC11
ECE 447: Octal Buffer 74LS245
Note: All 8 outputs controlled by one enable, OE
ECE 447: Octal Buffer 74LS244
Note: Outputs controlled by two enables, 1G & 2G
(1G controls 1A1-1A4, 2G controls 2A1-2A4)