SlideShare a Scribd company logo
1 of 25
Dr A Sahu
Dept of Computer Science &
Engineering
IIT Guwahati
• Peripheral communications
• Keyboard
– Simple Switch
– One Dimensional Keyboard (PIANO)
– Two Dimensional (Matrix) Keyboard
• Interfacing 1D Keyboard
• Interfacing Matrix Keyboard
• Modern Keyboard & Scan code
• Timer and Peripheral Controller
• Transmission Controller:
– MPU control, Device Control (DMA)
• Type of IO mapping
– Peripheral (IN/Out), Memory mapped IO (LD/ST,MV)
• Format of communication
– Synchronous (T & R sync with clock), Asynchronous
• Mode of Data Transfer
– Parallel, Serial (UART)
• Condition for data transfer
– Uncond., Polling, Interrupt, Ready signal, Handshake
• Display: Human can’t see the difference after
50Hz
– Displaying speed more then 50Hz is value less
– Human problem, Computer is faster
• Key board
– Computer have to wait for the user Keyboard
response
– Only interrupt or Read form ready buffer
• Keyboard is an input device
• Switch:
OFF ON
0 1 2 3
14 15
+5V
N to Lg(n) decoder
A B C D
. . .
0 1 2 3
14 15
+5V
N to Lg(n) decoder
A B C D
. . .
0 0 1 1
0 1 2 3 1
4
1
5
+5
V
N to Lg(n) decoder
A B C D
. .
.
PIANO
Store
Note
• Problem statement
– A bank of push-button
keys are connected as
inputs to PORTB.
– The pull-up resistors are
internal to PORTB.
– Write a program to
recognize a key pressed,
debounce the key, and
identify its location in the
key bank with numbers
from 0 to 7.
A B
C D
R1
R2
C1 C2
• Two dimensional
– Scan Column for 1
– Scan Row for 1
C1 C2
A B
DC
R2
R1
• Scan C1 & C2: found both are zero
• Scan R1 & R2: found both are zero
• Scan C1 & C2: found C1=1, C2=0
• Scan R1 & R2: found R1=1, R2=0
• So Key pressed: C1R1 is Key ‘A’
Stable
Noise
MPU
Send Data using Data BUS
“D7,D6,D5,D4”
Receive data using Data
BUS “D3,D2,D1,D0”
Identify the column & Row
Display the proper HEX
Digit on LED display
D7
D6
D5
D4
D3
D2
D1
D0
• Software
– To recognize and encode the key pressed, the
program should:
• Ground all the columns by sending zeros.
• Check each key in a row for logic zero.
• Ground one column at a time and check all the rows in
that column.
• Once a key is identified, it is encoded based on its
position in the column.
• Scan Row (6)
• Scan Column (3)
• Send this to Decoder to generate ASCII value or Scan code
R0
R1
C0 C1 C6
R2
R6
R7
C7C2
Scan
Row
R6
Scan Col: C2
6,3
Decode
to
ACSII
(Memory
ROM)
To
Host
(CPU)
• Scan Row (6)
• Scan Column (3)
• Send this to Decoder to generate ASCII value or Scan code
R0
R1
C0 C1 C6
R2
R6
R7
C7C2
Scan
Row
R6
Scan Col: C2
6,3
(Memory
ROM) To
Host
(CPU)
(Memory
ROM)
CAPS
• 104 Key
• PS2 Serial interface
• Scanned code
• Scanned to ASCII by software
Keyboard work is send the code
Software handle the rest of the work
• For most keys:
– Key is pressed
• keyboard sends 8-bit scan code for that key
– Key is released :
• keyboard sends F0
• keyboard sends scan code
• For extended keys:
– Key is pressed
• keyboard sends E0
• may send 1 or more scan codes
– Key is released:
• keyboard sends E0 F0
• keyboard sends scan code
• ASCII is not sent, Scan codes for keys
– Least significant bit first
• Normally translated by software
– You remap your keys, for example
– Software takes care of Shift, caps lock, control
• Scan code generated when you press
• And when you release
– Two bytes: F0 followed by key scan code
– Example:
• Space pressed, 29 sent
• Space released, F0 29 sent
• If you hold key, scan code repeated
23
• Uses a synchronous serial protocol
– What does that mean?
• Timer
– Many devices in system
– MPU use many delay routines
• Interrupt controller
• Programmable Interrupt controller
– ADC/DAC controller
– Keyboard controller
– Display controller
Lec10

More Related Content

What's hot (19)

Arduino based Applications-part 6
Arduino based Applications-part 6Arduino based Applications-part 6
Arduino based Applications-part 6
 
Encoders
EncodersEncoders
Encoders
 
Introduction to digital logic gates
Introduction to digital logic gatesIntroduction to digital logic gates
Introduction to digital logic gates
 
Encoder
EncoderEncoder
Encoder
 
Encoders and types of encodrs
Encoders and types of encodrs Encoders and types of encodrs
Encoders and types of encodrs
 
Combinational Logic Unit 2
Combinational Logic Unit 2Combinational Logic Unit 2
Combinational Logic Unit 2
 
Keypad scanner using Verilog code in VLSI Systems
Keypad scanner using Verilog code in VLSI SystemsKeypad scanner using Verilog code in VLSI Systems
Keypad scanner using Verilog code in VLSI Systems
 
encoder
encoder encoder
encoder
 
Encoder decoder
Encoder decoderEncoder decoder
Encoder decoder
 
Encoders
EncodersEncoders
Encoders
 
Cell phone based dtmf
Cell phone based dtmfCell phone based dtmf
Cell phone based dtmf
 
08 decoder
08 decoder08 decoder
08 decoder
 
Encoders and decoders
Encoders and decodersEncoders and decoders
Encoders and decoders
 
Triadex Muse
Triadex MuseTriadex Muse
Triadex Muse
 
From Arduino to LinnStrument
From Arduino to LinnStrumentFrom Arduino to LinnStrument
From Arduino to LinnStrument
 
Electronics lec 10
Electronics lec 10Electronics lec 10
Electronics lec 10
 
Indroduction the arduino
Indroduction the arduinoIndroduction the arduino
Indroduction the arduino
 
Logic gates
Logic gatesLogic gates
Logic gates
 
Decoders
DecodersDecoders
Decoders
 

Viewers also liked

Pin diagram
Pin diagramPin diagram
Pin diagramparth115
 
DMA controller intel 8257
DMA controller intel 8257DMA controller intel 8257
DMA controller intel 8257Daniel Ilunga
 
Instruction cycle
Instruction cycleInstruction cycle
Instruction cycleKumar
 
1326 Introduction To 8086 Microprocessor
1326 Introduction To 8086 Microprocessor1326 Introduction To 8086 Microprocessor
1326 Introduction To 8086 Microprocessortechbed
 
Queue as data_structure
Queue as data_structureQueue as data_structure
Queue as data_structureeShikshak
 
8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil Kaware8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil KawareProf. Swapnil V. Kaware
 
Queue data structure
Queue data structureQueue data structure
Queue data structureanooppjoseph
 
8085 microprocessor ramesh gaonkar
8085 microprocessor   ramesh gaonkar8085 microprocessor   ramesh gaonkar
8085 microprocessor ramesh gaonkarSAQUIB AHMAD
 
ROBOTICS AND ITS APPLICATIONS
ROBOTICS AND ITS APPLICATIONSROBOTICS AND ITS APPLICATIONS
ROBOTICS AND ITS APPLICATIONSAnmol Seth
 
8085 microprocessor architecture ppt
8085 microprocessor architecture ppt8085 microprocessor architecture ppt
8085 microprocessor architecture pptParvesh Gautam
 
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction setSaumitra Rukmangad
 

Viewers also liked (16)

Pin diagram
Pin diagramPin diagram
Pin diagram
 
Use of ale
Use of aleUse of ale
Use of ale
 
Lec11
Lec11Lec11
Lec11
 
DMA controller intel 8257
DMA controller intel 8257DMA controller intel 8257
DMA controller intel 8257
 
Instruction cycle
Instruction cycleInstruction cycle
Instruction cycle
 
1326 Introduction To 8086 Microprocessor
1326 Introduction To 8086 Microprocessor1326 Introduction To 8086 Microprocessor
1326 Introduction To 8086 Microprocessor
 
Queue as data_structure
Queue as data_structureQueue as data_structure
Queue as data_structure
 
8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil Kaware8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil Kaware
 
Queue data structure
Queue data structureQueue data structure
Queue data structure
 
8085 microprocessor ramesh gaonkar
8085 microprocessor   ramesh gaonkar8085 microprocessor   ramesh gaonkar
8085 microprocessor ramesh gaonkar
 
ROBOTICS AND ITS APPLICATIONS
ROBOTICS AND ITS APPLICATIONSROBOTICS AND ITS APPLICATIONS
ROBOTICS AND ITS APPLICATIONS
 
8085 microprocessor architecture ppt
8085 microprocessor architecture ppt8085 microprocessor architecture ppt
8085 microprocessor architecture ppt
 
Instruction cycle
Instruction cycleInstruction cycle
Instruction cycle
 
robotics ppt
robotics ppt robotics ppt
robotics ppt
 
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
 
Robotics project ppt
Robotics project pptRobotics project ppt
Robotics project ppt
 

Similar to Lec10

LinnStrument : the ultimate open-source hacker instrument
LinnStrument : the ultimate open-source hacker instrumentLinnStrument : the ultimate open-source hacker instrument
LinnStrument : the ultimate open-source hacker instrumentGeert Bevin
 
Basic of Computer.pptx
Basic of Computer.pptxBasic of Computer.pptx
Basic of Computer.pptxtitasdasgupta1
 
Lec 5 input unit
Lec 5 input unitLec 5 input unit
Lec 5 input unitProtik Roy
 
Lec 5 input unit
Lec 5 input unitLec 5 input unit
Lec 5 input unitProtik Roy
 
Chapter 4 : I/O devices
Chapter   4 : I/O devicesChapter   4 : I/O devices
Chapter 4 : I/O devicesKaushik Panta
 
B.sc cs-ii-u-2.2-overview of register transfer, micro operations and basic co...
B.sc cs-ii-u-2.2-overview of register transfer, micro operations and basic co...B.sc cs-ii-u-2.2-overview of register transfer, micro operations and basic co...
B.sc cs-ii-u-2.2-overview of register transfer, micro operations and basic co...Rai University
 
Bca 2nd sem-u-2.2-overview of register transfer, micro operations and basic c...
Bca 2nd sem-u-2.2-overview of register transfer, micro operations and basic c...Bca 2nd sem-u-2.2-overview of register transfer, micro operations and basic c...
Bca 2nd sem-u-2.2-overview of register transfer, micro operations and basic c...Rai University
 
MCA-I-COA- overview of register transfer, micro operations and basic computer...
MCA-I-COA- overview of register transfer, micro operations and basic computer...MCA-I-COA- overview of register transfer, micro operations and basic computer...
MCA-I-COA- overview of register transfer, micro operations and basic computer...Rai University
 
teststststststLecture_3_2022_Arduino.pptx
teststststststLecture_3_2022_Arduino.pptxteststststststLecture_3_2022_Arduino.pptx
teststststststLecture_3_2022_Arduino.pptxethannguyen1618
 
Computer system Hardware components.pptx
Computer system Hardware components.pptxComputer system Hardware components.pptx
Computer system Hardware components.pptxRoshni814224
 
Computer system Hardware components.pptx
Computer system Hardware components.pptxComputer system Hardware components.pptx
Computer system Hardware components.pptxRoshni814224
 
Chapter 1 Introduction to computer components
Chapter 1 Introduction to computer componentsChapter 1 Introduction to computer components
Chapter 1 Introduction to computer componentsBoonsaaMulataa
 
Introduction to arduino!
Introduction to arduino!Introduction to arduino!
Introduction to arduino!Makers of India
 
One-Wire-Serial-Communication.pdf
One-Wire-Serial-Communication.pdfOne-Wire-Serial-Communication.pdf
One-Wire-Serial-Communication.pdfshamtekawambwa1
 
IOT ARDUINO UNO.pptx
IOT ARDUINO UNO.pptxIOT ARDUINO UNO.pptx
IOT ARDUINO UNO.pptxSanaMateen7
 

Similar to Lec10 (20)

LinnStrument : the ultimate open-source hacker instrument
LinnStrument : the ultimate open-source hacker instrumentLinnStrument : the ultimate open-source hacker instrument
LinnStrument : the ultimate open-source hacker instrument
 
Basic of Computer.pptx
Basic of Computer.pptxBasic of Computer.pptx
Basic of Computer.pptx
 
Lec 5 input unit
Lec 5 input unitLec 5 input unit
Lec 5 input unit
 
Lec 5 input unit
Lec 5 input unitLec 5 input unit
Lec 5 input unit
 
Lec08
Lec08Lec08
Lec08
 
Arduino
ArduinoArduino
Arduino
 
5059734.ppt
5059734.ppt5059734.ppt
5059734.ppt
 
tCh12.ppt
tCh12.ppttCh12.ppt
tCh12.ppt
 
arduinoedit.pptx
arduinoedit.pptxarduinoedit.pptx
arduinoedit.pptx
 
Chapter 4 : I/O devices
Chapter   4 : I/O devicesChapter   4 : I/O devices
Chapter 4 : I/O devices
 
B.sc cs-ii-u-2.2-overview of register transfer, micro operations and basic co...
B.sc cs-ii-u-2.2-overview of register transfer, micro operations and basic co...B.sc cs-ii-u-2.2-overview of register transfer, micro operations and basic co...
B.sc cs-ii-u-2.2-overview of register transfer, micro operations and basic co...
 
Bca 2nd sem-u-2.2-overview of register transfer, micro operations and basic c...
Bca 2nd sem-u-2.2-overview of register transfer, micro operations and basic c...Bca 2nd sem-u-2.2-overview of register transfer, micro operations and basic c...
Bca 2nd sem-u-2.2-overview of register transfer, micro operations and basic c...
 
MCA-I-COA- overview of register transfer, micro operations and basic computer...
MCA-I-COA- overview of register transfer, micro operations and basic computer...MCA-I-COA- overview of register transfer, micro operations and basic computer...
MCA-I-COA- overview of register transfer, micro operations and basic computer...
 
teststststststLecture_3_2022_Arduino.pptx
teststststststLecture_3_2022_Arduino.pptxteststststststLecture_3_2022_Arduino.pptx
teststststststLecture_3_2022_Arduino.pptx
 
Computer system Hardware components.pptx
Computer system Hardware components.pptxComputer system Hardware components.pptx
Computer system Hardware components.pptx
 
Computer system Hardware components.pptx
Computer system Hardware components.pptxComputer system Hardware components.pptx
Computer system Hardware components.pptx
 
Chapter 1 Introduction to computer components
Chapter 1 Introduction to computer componentsChapter 1 Introduction to computer components
Chapter 1 Introduction to computer components
 
Introduction to arduino!
Introduction to arduino!Introduction to arduino!
Introduction to arduino!
 
One-Wire-Serial-Communication.pdf
One-Wire-Serial-Communication.pdfOne-Wire-Serial-Communication.pdf
One-Wire-Serial-Communication.pdf
 
IOT ARDUINO UNO.pptx
IOT ARDUINO UNO.pptxIOT ARDUINO UNO.pptx
IOT ARDUINO UNO.pptx
 

More from siddu kadiwal (13)

Chp10 sw constr
Chp10 sw constrChp10 sw constr
Chp10 sw constr
 
Lec14
Lec14Lec14
Lec14
 
Lec13
Lec13Lec13
Lec13
 
Lec12
Lec12Lec12
Lec12
 
Lec09
Lec09Lec09
Lec09
 
Lec07
Lec07Lec07
Lec07
 
Lec06
Lec06Lec06
Lec06
 
Lec05
Lec05Lec05
Lec05
 
Lec04
Lec04Lec04
Lec04
 
Lec03
Lec03Lec03
Lec03
 
Lec02
Lec02Lec02
Lec02
 
Lec04
Lec04Lec04
Lec04
 
Ece iv-fundamentals of hdl [10 ec45]-notes
Ece iv-fundamentals of hdl [10 ec45]-notesEce iv-fundamentals of hdl [10 ec45]-notes
Ece iv-fundamentals of hdl [10 ec45]-notes
 

Recently uploaded

IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxvipinkmenon1
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfme23b1001
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 

Recently uploaded (20)

IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdf
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 

Lec10

  • 1. Dr A Sahu Dept of Computer Science & Engineering IIT Guwahati
  • 2. • Peripheral communications • Keyboard – Simple Switch – One Dimensional Keyboard (PIANO) – Two Dimensional (Matrix) Keyboard • Interfacing 1D Keyboard • Interfacing Matrix Keyboard • Modern Keyboard & Scan code • Timer and Peripheral Controller
  • 3. • Transmission Controller: – MPU control, Device Control (DMA) • Type of IO mapping – Peripheral (IN/Out), Memory mapped IO (LD/ST,MV) • Format of communication – Synchronous (T & R sync with clock), Asynchronous • Mode of Data Transfer – Parallel, Serial (UART) • Condition for data transfer – Uncond., Polling, Interrupt, Ready signal, Handshake
  • 4. • Display: Human can’t see the difference after 50Hz – Displaying speed more then 50Hz is value less – Human problem, Computer is faster • Key board – Computer have to wait for the user Keyboard response – Only interrupt or Read form ready buffer
  • 5. • Keyboard is an input device • Switch: OFF ON
  • 6. 0 1 2 3 14 15 +5V N to Lg(n) decoder A B C D . . .
  • 7. 0 1 2 3 14 15 +5V N to Lg(n) decoder A B C D . . . 0 0 1 1
  • 8. 0 1 2 3 1 4 1 5 +5 V N to Lg(n) decoder A B C D . . . PIANO Store Note
  • 9. • Problem statement – A bank of push-button keys are connected as inputs to PORTB. – The pull-up resistors are internal to PORTB. – Write a program to recognize a key pressed, debounce the key, and identify its location in the key bank with numbers from 0 to 7.
  • 10.
  • 11. A B C D R1 R2 C1 C2 • Two dimensional – Scan Column for 1 – Scan Row for 1 C1 C2 A B DC R2 R1
  • 12. • Scan C1 & C2: found both are zero • Scan R1 & R2: found both are zero
  • 13. • Scan C1 & C2: found C1=1, C2=0 • Scan R1 & R2: found R1=1, R2=0 • So Key pressed: C1R1 is Key ‘A’
  • 15. MPU Send Data using Data BUS “D7,D6,D5,D4” Receive data using Data BUS “D3,D2,D1,D0” Identify the column & Row Display the proper HEX Digit on LED display D7 D6 D5 D4 D3 D2 D1 D0
  • 16. • Software – To recognize and encode the key pressed, the program should: • Ground all the columns by sending zeros. • Check each key in a row for logic zero. • Ground one column at a time and check all the rows in that column. • Once a key is identified, it is encoded based on its position in the column.
  • 17. • Scan Row (6) • Scan Column (3) • Send this to Decoder to generate ASCII value or Scan code R0 R1 C0 C1 C6 R2 R6 R7 C7C2 Scan Row R6 Scan Col: C2 6,3 Decode to ACSII (Memory ROM) To Host (CPU)
  • 18. • Scan Row (6) • Scan Column (3) • Send this to Decoder to generate ASCII value or Scan code R0 R1 C0 C1 C6 R2 R6 R7 C7C2 Scan Row R6 Scan Col: C2 6,3 (Memory ROM) To Host (CPU) (Memory ROM) CAPS
  • 19. • 104 Key • PS2 Serial interface • Scanned code • Scanned to ASCII by software
  • 20. Keyboard work is send the code Software handle the rest of the work
  • 21. • For most keys: – Key is pressed • keyboard sends 8-bit scan code for that key – Key is released : • keyboard sends F0 • keyboard sends scan code • For extended keys: – Key is pressed • keyboard sends E0 • may send 1 or more scan codes – Key is released: • keyboard sends E0 F0 • keyboard sends scan code
  • 22. • ASCII is not sent, Scan codes for keys – Least significant bit first • Normally translated by software – You remap your keys, for example – Software takes care of Shift, caps lock, control • Scan code generated when you press • And when you release – Two bytes: F0 followed by key scan code – Example: • Space pressed, 29 sent • Space released, F0 29 sent • If you hold key, scan code repeated
  • 23. 23 • Uses a synchronous serial protocol – What does that mean?
  • 24. • Timer – Many devices in system – MPU use many delay routines • Interrupt controller • Programmable Interrupt controller – ADC/DAC controller – Keyboard controller – Display controller