SlideShare uma empresa Scribd logo
1 de 7
Baixar para ler offline
Key
Key
Here Rows as INTPUT
If B4 is low the answer will be HEX E (15 - 1 = 14) 1110 Row 1
If B5 is low the answer will be HEX D (15 - 2 = 13) 1101 Row 2
It B6 is low the answer will be HEX B (15 - 4 = 11) 1011 Row 3
If B7 is low the answer will be HEX 7 (15 - 8 = 7) 0111 Row 4
Here Columns as OUTPUT
If B0 is low the low nibble will be HEX E (15 – 1 = 14) 1110 Column 1
If B1 is low the low nibble will be HEX D (15 – 2 = 13) 1101 Column 2
ff B2 is low the low nibble will be HEX B (15 – 4 = 12) 1011 Column 3
If B3 is low the low nibble will be HEX 7 (15 – 8 = 7) 0111 Column 4
Start
Ground all
Columns
All keys
open ?
Read all
Rows
Wait for
key
debounce
Ground
First
Column
Read all
Rows
Wait for
key
debounce
Ground
2nd
Column
Read all
Rows
Wait for
key
debounce
Ground
3rd
Column
Read all
Rows
Wait for
key
debounce
Ground
Fourth
Column
Read all
Rows
Wait for
key
debounce
which key is
pressed?
'1','2','3','4'
which key is
pressed?
''5','6','7','8'
which key is
pressed?
'9','0',' ','E'
which key is
pressed?
'+','- ','x','/ '
Figure . KEY 4 X 4 Scan Flow Chart
NO
YES
YES YES YES
NO
NO NO
YES
Return
match KEY
Return
KEY=’Q’
Return
match KEY
Return
match KEY
Return
match KEY
Return
KEY=’Q’
//Ground all the columns (C1,C2,C3 & C4)
//B0 = B1 = B2 = B3 = 0;
PORTB = 0xF0;
//Wait for key debounce
Delay_ms();
//Read all Rows
Key=Key & 0xF0;
If (Key!=0xF0)
{Key is Pressed, Find which key is pressed.}
Else
{Return (‘Q’); // Key not Pressed}
Key is Pressed, Find which key is pressed
Ground the C1
PORTB = 0xFE;
Delay_ms();
Read all Rows
Key=Key & 0xF0;
Switch(ROW)
{
Case ROW1:
return (‘1’);break;
Case ROW2:
return (‘2’);break;
Case ROW3:
return (‘3’);break;
Case ROW2:
return (‘4’);break;
}
unsignedcharkey-scan(void)
{
unsignedchartemp;
PORTB=0xf0;
Delay_ms(10);
Key=PORTB&0xf0;
if(Key!=0x0f)
{
PORTB=0xff;
PORTB=COL1;
Delay_ms(10);
Key=PORTB&
0xf0;
switch(temp)
{
caseROW1:
return'1';
break;
caseROW2:
return'2';
break;
caseROW3:
return'3';
break;
caseROW4:
return'4';
break;
}
PORTB=0xff;
PORTB=COL2;
Delay_ms(10);
Key=PORTB&
0xf0;
switch(temp)
{
caseROW1:
return'5';
break;
caseROW2:
return'6';
break;
caseROW3:
return'7;
break;
caseROW4:
return'8;
break;
}
PORTB=0xff;
PORTB=COL3
Delay_ms(10);
Key=PORTB&0xf0;
switch(temp)
{
caseROW1:
return'9;
break;
caseROW2:
return'0;
break;
caseROW3:
return''
break;
caseROW4:
return'E’;
break;
}
PORTB=0xff;
PORTB=COL4
Delay_ms(10);
Key=PORTB&0xf0;
switch(temp)
{
caseROW1:
return'+’;
break;
caseROW2:
return'-‘;
break;
caseROW3:
return'x'
break;
caseROW4:
return'/’;
break;
}
}
unsignedcharkey-scan(void)
{
unsignedchartemp;
PORTB=0xf0;
Delay_ms(10);
Key=PORTB&0xf0;
if(Key!=0x0f)
{
PORTB=0xff;
PORTB=COL1;
Delay_ms(10);
Key=PORTB&
0xf0;
switch(temp)
{
caseROW1:
return'1';
break;
caseROW2:
return'2';
break;
caseROW3:
return'3';
break;
caseROW4:
return'4';
break;
}
PORTB=0xff;
PORTB=COL2;
Delay_ms(10);
Key=PORTB&
0xf0;
switch(temp)
{
caseROW1:
return'5';
break;
caseROW2:
return'6';
break;
caseROW3:
return'7;
break;
caseROW4:
return'8;
break;
}
PORTB=0xff;
PORTB=COL3
Delay_ms(10);
Key=PORTB&0xf0;
switch(temp)
{
caseROW1:
return'9;
break;
caseROW2:
return'0;
break;
caseROW3:
return''
break;
caseROW4:
return'E’;
break;
}
PORTB=0xff;
PORTB=COL4
Delay_ms(10);
Key=PORTB&0xf0;
switch(temp)
{
caseROW1:
return'+’;
break;
caseROW2:
return'-‘;
break;
caseROW3:
return'x'
break;
caseROW4:
return'/’;
break;
}
}

Mais conteúdo relacionado

Destaque

Cns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption TechniquesCns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption Techniquesbabak danyal
 
Attacks Attacks AND Attacks!
Attacks Attacks AND Attacks!Attacks Attacks AND Attacks!
Attacks Attacks AND Attacks!Asad Ali
 
Vulnerabilities in IP Protocols
Vulnerabilities in IP ProtocolsVulnerabilities in IP Protocols
Vulnerabilities in IP Protocolsbabak danyal
 
Ciphers modes
Ciphers modesCiphers modes
Ciphers modesAsad Ali
 
Micro Assignment 1
Micro Assignment 1Micro Assignment 1
Micro Assignment 1babak danyal
 
Course outlines
Course outlinesCourse outlines
Course outlinesAsad Ali
 
Master synchronous serial port (mssp)
Master synchronous serial port (mssp)Master synchronous serial port (mssp)
Master synchronous serial port (mssp)babak danyal
 
The Role of Ulema and Mashaikh in the Pakistan Movement
The Role of Ulema and Mashaikh in the Pakistan MovementThe Role of Ulema and Mashaikh in the Pakistan Movement
The Role of Ulema and Mashaikh in the Pakistan Movementbabak danyal
 
History of Cipher System
History of Cipher SystemHistory of Cipher System
History of Cipher SystemAsad Ali
 
Microcontroller Programming Assignment
Microcontroller Programming AssignmentMicrocontroller Programming Assignment
Microcontroller Programming Assignmentbabak danyal
 
Accessing the deep web (2007)
Accessing the deep web (2007)Accessing the deep web (2007)
Accessing the deep web (2007)babak danyal
 
22 Microcontroller Programs
22 Microcontroller Programs22 Microcontroller Programs
22 Microcontroller Programsbabak danyal
 
block ciphers and the des
block ciphers and the desblock ciphers and the des
block ciphers and the desbabak danyal
 

Destaque (20)

Cns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption TechniquesCns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption Techniques
 
Satcom 4
Satcom 4Satcom 4
Satcom 4
 
Mobile comm. 1
Mobile comm. 1Mobile comm. 1
Mobile comm. 1
 
Attacks Attacks AND Attacks!
Attacks Attacks AND Attacks!Attacks Attacks AND Attacks!
Attacks Attacks AND Attacks!
 
Vulnerabilities in IP Protocols
Vulnerabilities in IP ProtocolsVulnerabilities in IP Protocols
Vulnerabilities in IP Protocols
 
Ciphers modes
Ciphers modesCiphers modes
Ciphers modes
 
Micro Assignment 1
Micro Assignment 1Micro Assignment 1
Micro Assignment 1
 
Course outlines
Course outlinesCourse outlines
Course outlines
 
Master synchronous serial port (mssp)
Master synchronous serial port (mssp)Master synchronous serial port (mssp)
Master synchronous serial port (mssp)
 
The Role of Ulema and Mashaikh in the Pakistan Movement
The Role of Ulema and Mashaikh in the Pakistan MovementThe Role of Ulema and Mashaikh in the Pakistan Movement
The Role of Ulema and Mashaikh in the Pakistan Movement
 
History of Cipher System
History of Cipher SystemHistory of Cipher System
History of Cipher System
 
Microcontroller Programming Assignment
Microcontroller Programming AssignmentMicrocontroller Programming Assignment
Microcontroller Programming Assignment
 
Micro controller
Micro controllerMicro controller
Micro controller
 
Interrupt1
Interrupt1Interrupt1
Interrupt1
 
Accessing the deep web (2007)
Accessing the deep web (2007)Accessing the deep web (2007)
Accessing the deep web (2007)
 
Micro assign
Micro assignMicro assign
Micro assign
 
22 Microcontroller Programs
22 Microcontroller Programs22 Microcontroller Programs
22 Microcontroller Programs
 
Tcp sockets
Tcp socketsTcp sockets
Tcp sockets
 
block ciphers and the des
block ciphers and the desblock ciphers and the des
block ciphers and the des
 
Adc
AdcAdc
Adc
 

Mais de babak danyal

Easy Steps to implement UDP Server and Client Sockets
Easy Steps to implement UDP Server and Client SocketsEasy Steps to implement UDP Server and Client Sockets
Easy Steps to implement UDP Server and Client Socketsbabak danyal
 
Java IO Package and Streams
Java IO Package and StreamsJava IO Package and Streams
Java IO Package and Streamsbabak danyal
 
Swing and Graphical User Interface in Java
Swing and Graphical User Interface in JavaSwing and Graphical User Interface in Java
Swing and Graphical User Interface in Javababak danyal
 
key distribution in network security
key distribution in network securitykey distribution in network security
key distribution in network securitybabak danyal
 
Lecture10 Signal and Systems
Lecture10 Signal and SystemsLecture10 Signal and Systems
Lecture10 Signal and Systemsbabak danyal
 
Lecture8 Signal and Systems
Lecture8 Signal and SystemsLecture8 Signal and Systems
Lecture8 Signal and Systemsbabak danyal
 
Lecture7 Signal and Systems
Lecture7 Signal and SystemsLecture7 Signal and Systems
Lecture7 Signal and Systemsbabak danyal
 
Lecture6 Signal and Systems
Lecture6 Signal and SystemsLecture6 Signal and Systems
Lecture6 Signal and Systemsbabak danyal
 
Lecture5 Signal and Systems
Lecture5 Signal and SystemsLecture5 Signal and Systems
Lecture5 Signal and Systemsbabak danyal
 
Lecture4 Signal and Systems
Lecture4  Signal and SystemsLecture4  Signal and Systems
Lecture4 Signal and Systemsbabak danyal
 
Lecture3 Signal and Systems
Lecture3 Signal and SystemsLecture3 Signal and Systems
Lecture3 Signal and Systemsbabak danyal
 
Lecture2 Signal and Systems
Lecture2 Signal and SystemsLecture2 Signal and Systems
Lecture2 Signal and Systemsbabak danyal
 
Lecture1 Intro To Signa
Lecture1 Intro To SignaLecture1 Intro To Signa
Lecture1 Intro To Signababak danyal
 
Lecture9 Signal and Systems
Lecture9 Signal and SystemsLecture9 Signal and Systems
Lecture9 Signal and Systemsbabak danyal
 
Classical Encryption Techniques in Network Security
Classical Encryption Techniques in Network SecurityClassical Encryption Techniques in Network Security
Classical Encryption Techniques in Network Securitybabak danyal
 
Problems at independence
Problems at independenceProblems at independence
Problems at independencebabak danyal
 
Quaid-e-Azam and Early Problems of Pakistan
Quaid-e-Azam and Early Problems of PakistanQuaid-e-Azam and Early Problems of Pakistan
Quaid-e-Azam and Early Problems of Pakistanbabak danyal
 
Aligarh movement new
Aligarh movement newAligarh movement new
Aligarh movement newbabak danyal
 

Mais de babak danyal (20)

applist
applistapplist
applist
 
Easy Steps to implement UDP Server and Client Sockets
Easy Steps to implement UDP Server and Client SocketsEasy Steps to implement UDP Server and Client Sockets
Easy Steps to implement UDP Server and Client Sockets
 
Java IO Package and Streams
Java IO Package and StreamsJava IO Package and Streams
Java IO Package and Streams
 
Swing and Graphical User Interface in Java
Swing and Graphical User Interface in JavaSwing and Graphical User Interface in Java
Swing and Graphical User Interface in Java
 
key distribution in network security
key distribution in network securitykey distribution in network security
key distribution in network security
 
Lecture10 Signal and Systems
Lecture10 Signal and SystemsLecture10 Signal and Systems
Lecture10 Signal and Systems
 
Lecture8 Signal and Systems
Lecture8 Signal and SystemsLecture8 Signal and Systems
Lecture8 Signal and Systems
 
Lecture7 Signal and Systems
Lecture7 Signal and SystemsLecture7 Signal and Systems
Lecture7 Signal and Systems
 
Lecture6 Signal and Systems
Lecture6 Signal and SystemsLecture6 Signal and Systems
Lecture6 Signal and Systems
 
Lecture5 Signal and Systems
Lecture5 Signal and SystemsLecture5 Signal and Systems
Lecture5 Signal and Systems
 
Lecture4 Signal and Systems
Lecture4  Signal and SystemsLecture4  Signal and Systems
Lecture4 Signal and Systems
 
Lecture3 Signal and Systems
Lecture3 Signal and SystemsLecture3 Signal and Systems
Lecture3 Signal and Systems
 
Lecture2 Signal and Systems
Lecture2 Signal and SystemsLecture2 Signal and Systems
Lecture2 Signal and Systems
 
Lecture1 Intro To Signa
Lecture1 Intro To SignaLecture1 Intro To Signa
Lecture1 Intro To Signa
 
Lecture9 Signal and Systems
Lecture9 Signal and SystemsLecture9 Signal and Systems
Lecture9 Signal and Systems
 
Lecture9
Lecture9Lecture9
Lecture9
 
Classical Encryption Techniques in Network Security
Classical Encryption Techniques in Network SecurityClassical Encryption Techniques in Network Security
Classical Encryption Techniques in Network Security
 
Problems at independence
Problems at independenceProblems at independence
Problems at independence
 
Quaid-e-Azam and Early Problems of Pakistan
Quaid-e-Azam and Early Problems of PakistanQuaid-e-Azam and Early Problems of Pakistan
Quaid-e-Azam and Early Problems of Pakistan
 
Aligarh movement new
Aligarh movement newAligarh movement new
Aligarh movement new
 

Último

HED Office Sohayok Exam Question Solution 2023.pdf
HED Office Sohayok Exam Question Solution 2023.pdfHED Office Sohayok Exam Question Solution 2023.pdf
HED Office Sohayok Exam Question Solution 2023.pdfMohonDas
 
How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17Celine George
 
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdfMaximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdfTechSoup
 
How to Show Error_Warning Messages in Odoo 17
How to Show Error_Warning Messages in Odoo 17How to Show Error_Warning Messages in Odoo 17
How to Show Error_Warning Messages in Odoo 17Celine George
 
5 charts on South Africa as a source country for international student recrui...
5 charts on South Africa as a source country for international student recrui...5 charts on South Africa as a source country for international student recrui...
5 charts on South Africa as a source country for international student recrui...CaraSkikne1
 
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRADUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRATanmoy Mishra
 
In - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptxIn - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptxAditiChauhan701637
 
Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.EnglishCEIPdeSigeiro
 
Benefits & Challenges of Inclusive Education
Benefits & Challenges of Inclusive EducationBenefits & Challenges of Inclusive Education
Benefits & Challenges of Inclusive EducationMJDuyan
 
Diploma in Nursing Admission Test Question Solution 2023.pdf
Diploma in Nursing Admission Test Question Solution 2023.pdfDiploma in Nursing Admission Test Question Solution 2023.pdf
Diploma in Nursing Admission Test Question Solution 2023.pdfMohonDas
 
Patient Counselling. Definition of patient counseling; steps involved in pati...
Patient Counselling. Definition of patient counseling; steps involved in pati...Patient Counselling. Definition of patient counseling; steps involved in pati...
Patient Counselling. Definition of patient counseling; steps involved in pati...raviapr7
 
How to Solve Singleton Error in the Odoo 17
How to Solve Singleton Error in the  Odoo 17How to Solve Singleton Error in the  Odoo 17
How to Solve Singleton Error in the Odoo 17Celine George
 
Human-AI Co-Creation of Worked Examples for Programming Classes
Human-AI Co-Creation of Worked Examples for Programming ClassesHuman-AI Co-Creation of Worked Examples for Programming Classes
Human-AI Co-Creation of Worked Examples for Programming ClassesMohammad Hassany
 
How to Add a many2many Relational Field in Odoo 17
How to Add a many2many Relational Field in Odoo 17How to Add a many2many Relational Field in Odoo 17
How to Add a many2many Relational Field in Odoo 17Celine George
 
Education and training program in the hospital APR.pptx
Education and training program in the hospital APR.pptxEducation and training program in the hospital APR.pptx
Education and training program in the hospital APR.pptxraviapr7
 
General views of Histopathology and step
General views of Histopathology and stepGeneral views of Histopathology and step
General views of Histopathology and stepobaje godwin sunday
 
Clinical Pharmacy Introduction to Clinical Pharmacy, Concept of clinical pptx
Clinical Pharmacy  Introduction to Clinical Pharmacy, Concept of clinical pptxClinical Pharmacy  Introduction to Clinical Pharmacy, Concept of clinical pptx
Clinical Pharmacy Introduction to Clinical Pharmacy, Concept of clinical pptxraviapr7
 
Prescribed medication order and communication skills.pptx
Prescribed medication order and communication skills.pptxPrescribed medication order and communication skills.pptx
Prescribed medication order and communication skills.pptxraviapr7
 
Practical Research 1 Lesson 9 Scope and delimitation.pptx
Practical Research 1 Lesson 9 Scope and delimitation.pptxPractical Research 1 Lesson 9 Scope and delimitation.pptx
Practical Research 1 Lesson 9 Scope and delimitation.pptxKatherine Villaluna
 
CapTechU Doctoral Presentation -March 2024 slides.pptx
CapTechU Doctoral Presentation -March 2024 slides.pptxCapTechU Doctoral Presentation -March 2024 slides.pptx
CapTechU Doctoral Presentation -March 2024 slides.pptxCapitolTechU
 

Último (20)

HED Office Sohayok Exam Question Solution 2023.pdf
HED Office Sohayok Exam Question Solution 2023.pdfHED Office Sohayok Exam Question Solution 2023.pdf
HED Office Sohayok Exam Question Solution 2023.pdf
 
How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17
 
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdfMaximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
 
How to Show Error_Warning Messages in Odoo 17
How to Show Error_Warning Messages in Odoo 17How to Show Error_Warning Messages in Odoo 17
How to Show Error_Warning Messages in Odoo 17
 
5 charts on South Africa as a source country for international student recrui...
5 charts on South Africa as a source country for international student recrui...5 charts on South Africa as a source country for international student recrui...
5 charts on South Africa as a source country for international student recrui...
 
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRADUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
 
In - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptxIn - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptx
 
Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.
 
Benefits & Challenges of Inclusive Education
Benefits & Challenges of Inclusive EducationBenefits & Challenges of Inclusive Education
Benefits & Challenges of Inclusive Education
 
Diploma in Nursing Admission Test Question Solution 2023.pdf
Diploma in Nursing Admission Test Question Solution 2023.pdfDiploma in Nursing Admission Test Question Solution 2023.pdf
Diploma in Nursing Admission Test Question Solution 2023.pdf
 
Patient Counselling. Definition of patient counseling; steps involved in pati...
Patient Counselling. Definition of patient counseling; steps involved in pati...Patient Counselling. Definition of patient counseling; steps involved in pati...
Patient Counselling. Definition of patient counseling; steps involved in pati...
 
How to Solve Singleton Error in the Odoo 17
How to Solve Singleton Error in the  Odoo 17How to Solve Singleton Error in the  Odoo 17
How to Solve Singleton Error in the Odoo 17
 
Human-AI Co-Creation of Worked Examples for Programming Classes
Human-AI Co-Creation of Worked Examples for Programming ClassesHuman-AI Co-Creation of Worked Examples for Programming Classes
Human-AI Co-Creation of Worked Examples for Programming Classes
 
How to Add a many2many Relational Field in Odoo 17
How to Add a many2many Relational Field in Odoo 17How to Add a many2many Relational Field in Odoo 17
How to Add a many2many Relational Field in Odoo 17
 
Education and training program in the hospital APR.pptx
Education and training program in the hospital APR.pptxEducation and training program in the hospital APR.pptx
Education and training program in the hospital APR.pptx
 
General views of Histopathology and step
General views of Histopathology and stepGeneral views of Histopathology and step
General views of Histopathology and step
 
Clinical Pharmacy Introduction to Clinical Pharmacy, Concept of clinical pptx
Clinical Pharmacy  Introduction to Clinical Pharmacy, Concept of clinical pptxClinical Pharmacy  Introduction to Clinical Pharmacy, Concept of clinical pptx
Clinical Pharmacy Introduction to Clinical Pharmacy, Concept of clinical pptx
 
Prescribed medication order and communication skills.pptx
Prescribed medication order and communication skills.pptxPrescribed medication order and communication skills.pptx
Prescribed medication order and communication skills.pptx
 
Practical Research 1 Lesson 9 Scope and delimitation.pptx
Practical Research 1 Lesson 9 Scope and delimitation.pptxPractical Research 1 Lesson 9 Scope and delimitation.pptx
Practical Research 1 Lesson 9 Scope and delimitation.pptx
 
CapTechU Doctoral Presentation -March 2024 slides.pptx
CapTechU Doctoral Presentation -March 2024 slides.pptxCapTechU Doctoral Presentation -March 2024 slides.pptx
CapTechU Doctoral Presentation -March 2024 slides.pptx
 

Key