04 Input and Output Device Interfacing
04 Input and Output Device Interfacing
• Keypad
• Switch
• Case-1:
• Gives a logic 0 on switch close
• Current is 0.5ma on switch close
• Case-2:
• Gives a logic 1 on switch close
• High current on switch close
• Case-3:
• Can damage port if 0 is output
Vcc
OUT
Software Solution
• Wait-and-see technique
• When the input drops
• an “appropriate” delay is executed (10 ms)
• then the value of the line is checked again to make sure the
line has stopped bouncing
• Repeat constantly C1
C2
C3
C4
• Pinout
• 8 data pins D7:D0
• RS: Data or Command
Register Select
• R/W: Read or Write
• E: Enable (Latch data)
• RS – Register Select
• RS = 0 Command Register
• RS = 1 Data Register
• R/W = 0 Write , R/W = 1 Read
• E – Enable
• Used to latch the data present on the data pins.
• D0 – D7
• Bi-directional data/command pins.
• Alphanumeric characters are sent in ASCII format.
LM015
P3.4
RW
P3.5 E
P3.3 RS
P1.7-P1.0 D7-D0