SlideShare a Scribd company logo
1 of 4
Aim
To detect which key is pressed on a 16-key keypad (interfaced with Port1) and display the corresponding key number on Port0.
Components/Software
1. Atmel 89C51 microcontroller
2. 8051 simulator- Win8051
3. Universal SP3 Programmer
4. Compiler and Software to load the code into Universal SP3 Programmer
5. Computer System with Windows 98 or later operating system and RS-232 Cable
6. +5V D.C Power Supply
7. 16-key keypad with keys arranged in 4x4 array
8. Resistors
9. Capacitors
10. 10 MHz crystal oscillator
11. Signal Generator and CRO
Description
Keypad is an array of 4x4 keys with each key being a switch. The four rows are connected to pins 0-3 of Port1 and the four columns to pins 4-7 of Port1 as shown in the figure below. Each column is also connected to
supply voltage through a pull up resistor (around 1k Ohms). To read a particular key, the corresponding row is driven to '0'. In a key is pressed and the corresponding row is driven '0' then current flows through the
corresponding pull up resistor and the corresponding column reads '0'. Otherwise the corresponding column reads '1' (open circuit). For example if Key 5 is pressed -
 R1 = 0, C1:C4 = 1111
 R2 = 0, C1:C4 = 1011
Fig 42.1 Keypad schematic
Procedure
1. Write the assembly code in Win8051. Compile and simulate it.
2. Once the code is error free, run it and check output with the Simulator
3. After checking the code in the simulator, the code (file with .HEX extension) is loaded into Atmel 89C51 microcontroller using Universal SP3 Programmer.
4. Now connections are made as shown in the circuit diagram.
5. Switch on the supply and push Reset button
6. Observe the results
7. Switch off the supply
Assembly Code
8051
8051

More Related Content

What's hot

What's hot (9)

Hy jk02-m 5-axis interface board manual
Hy jk02-m 5-axis interface board manualHy jk02-m 5-axis interface board manual
Hy jk02-m 5-axis interface board manual
 
Lab6 s2
Lab6 s2Lab6 s2
Lab6 s2
 
Keypad and dc motor
Keypad and dc motor Keypad and dc motor
Keypad and dc motor
 
Ports 0f 8051
Ports 0f 8051Ports 0f 8051
Ports 0f 8051
 
Jp
Jp Jp
Jp
 
Cataloge ge 3.control and_automation-31_vat300_e_appendix3_5_rev_a
Cataloge ge 3.control and_automation-31_vat300_e_appendix3_5_rev_aCataloge ge 3.control and_automation-31_vat300_e_appendix3_5_rev_a
Cataloge ge 3.control and_automation-31_vat300_e_appendix3_5_rev_a
 
Plc trilogi5 purdue
Plc trilogi5 purduePlc trilogi5 purdue
Plc trilogi5 purdue
 
Gsm Wireless Intercom
Gsm Wireless IntercomGsm Wireless Intercom
Gsm Wireless Intercom
 
I o ports and timers of 8051
I o ports and timers of 8051I o ports and timers of 8051
I o ports and timers of 8051
 

Similar to 8051

Keypad interfacing 8051 -NANOCDAC
Keypad interfacing 8051 -NANOCDACKeypad interfacing 8051 -NANOCDAC
Keypad interfacing 8051 -NANOCDACnanocdac
 
Key board interfacing with 8051
Key board interfacing with 8051Key board interfacing with 8051
Key board interfacing with 8051DominicHendry
 
Microcontroladores: El microcontrolador 8051 con LCD 16x2
Microcontroladores: El microcontrolador 8051 con LCD 16x2Microcontroladores: El microcontrolador 8051 con LCD 16x2
Microcontroladores: El microcontrolador 8051 con LCD 16x2SANTIAGO PABLO ALBERTO
 
8051 MMD Chapter 1.ppt
8051 MMD Chapter 1.ppt8051 MMD Chapter 1.ppt
8051 MMD Chapter 1.pptnotagain0712
 
I Ointerface in mp
I Ointerface in mpI Ointerface in mp
I Ointerface in mpAisu
 
Embedded Application : An Autonomous Robot or Line Follower Bot
Embedded Application : An Autonomous Robot or Line Follower BotEmbedded Application : An Autonomous Robot or Line Follower Bot
Embedded Application : An Autonomous Robot or Line Follower BotEr. Raju Bhardwaj
 
Customizable Microprocessor design on Nexys 3 Spartan FPGA Board
Customizable Microprocessor design on Nexys 3 Spartan FPGA BoardCustomizable Microprocessor design on Nexys 3 Spartan FPGA Board
Customizable Microprocessor design on Nexys 3 Spartan FPGA BoardBharat Biyani
 
DIGITAL VOLTMETER USING 8051 MICROCONTROLLER
DIGITAL VOLTMETER USING 8051 MICROCONTROLLERDIGITAL VOLTMETER USING 8051 MICROCONTROLLER
DIGITAL VOLTMETER USING 8051 MICROCONTROLLERChirag Lakhani
 
digitalvoltmeterusing805112b2-170214173216 (1).pdf
digitalvoltmeterusing805112b2-170214173216 (1).pdfdigitalvoltmeterusing805112b2-170214173216 (1).pdf
digitalvoltmeterusing805112b2-170214173216 (1).pdfsatyamsinha37
 
Sensor interfacing in 8051
Sensor interfacing in 8051Sensor interfacing in 8051
Sensor interfacing in 8051Irfan Ahmad
 
Automation and Robotics 20ME51I_Week_2_Practicals.pdf
Automation and Robotics 20ME51I_Week_2_Practicals.pdfAutomation and Robotics 20ME51I_Week_2_Practicals.pdf
Automation and Robotics 20ME51I_Week_2_Practicals.pdfGandhibabu8
 
PROGRAMMABLE KEYBOARD AND DISPLAY INTERFACE(8279).pptx
PROGRAMMABLE KEYBOARD AND DISPLAY INTERFACE(8279).pptxPROGRAMMABLE KEYBOARD AND DISPLAY INTERFACE(8279).pptx
PROGRAMMABLE KEYBOARD AND DISPLAY INTERFACE(8279).pptxSanjayV73
 
EMBEDDED PASSWORD BASED ACESS CONTROL SYSTEM USING I2C PROTOCOL
EMBEDDED PASSWORD BASED ACESS CONTROL  SYSTEM USING I2C PROTOCOLEMBEDDED PASSWORD BASED ACESS CONTROL  SYSTEM USING I2C PROTOCOL
EMBEDDED PASSWORD BASED ACESS CONTROL SYSTEM USING I2C PROTOCOLGaurav Singh
 
microcontroller and embedded system
microcontroller and embedded systemmicrocontroller and embedded system
microcontroller and embedded systempradeep rana
 

Similar to 8051 (20)

Keypad interfacing 8051 -NANOCDAC
Keypad interfacing 8051 -NANOCDACKeypad interfacing 8051 -NANOCDAC
Keypad interfacing 8051 -NANOCDAC
 
Key board interfacing with 8051
Key board interfacing with 8051Key board interfacing with 8051
Key board interfacing with 8051
 
Lab burner
Lab burnerLab burner
Lab burner
 
Microcontroladores: El microcontrolador 8051 con LCD 16x2
Microcontroladores: El microcontrolador 8051 con LCD 16x2Microcontroladores: El microcontrolador 8051 con LCD 16x2
Microcontroladores: El microcontrolador 8051 con LCD 16x2
 
Analog to Digital .pptx
Analog to Digital .pptxAnalog to Digital .pptx
Analog to Digital .pptx
 
8051 MMD Chapter 1.ppt
8051 MMD Chapter 1.ppt8051 MMD Chapter 1.ppt
8051 MMD Chapter 1.ppt
 
I Ointerface in mp
I Ointerface in mpI Ointerface in mp
I Ointerface in mp
 
Embedded Application : An Autonomous Robot or Line Follower Bot
Embedded Application : An Autonomous Robot or Line Follower BotEmbedded Application : An Autonomous Robot or Line Follower Bot
Embedded Application : An Autonomous Robot or Line Follower Bot
 
Customizable Microprocessor design on Nexys 3 Spartan FPGA Board
Customizable Microprocessor design on Nexys 3 Spartan FPGA BoardCustomizable Microprocessor design on Nexys 3 Spartan FPGA Board
Customizable Microprocessor design on Nexys 3 Spartan FPGA Board
 
Microcontroller- An overview
Microcontroller- An overviewMicrocontroller- An overview
Microcontroller- An overview
 
DIGITAL VOLTMETER USING 8051 MICROCONTROLLER
DIGITAL VOLTMETER USING 8051 MICROCONTROLLERDIGITAL VOLTMETER USING 8051 MICROCONTROLLER
DIGITAL VOLTMETER USING 8051 MICROCONTROLLER
 
digitalvoltmeterusing805112b2-170214173216 (1).pdf
digitalvoltmeterusing805112b2-170214173216 (1).pdfdigitalvoltmeterusing805112b2-170214173216 (1).pdf
digitalvoltmeterusing805112b2-170214173216 (1).pdf
 
Sensor interfacing in 8051
Sensor interfacing in 8051Sensor interfacing in 8051
Sensor interfacing in 8051
 
8051 FINIAL
8051 FINIAL8051 FINIAL
8051 FINIAL
 
Final Presentation
Final PresentationFinal Presentation
Final Presentation
 
Automation and Robotics 20ME51I_Week_2_Practicals.pdf
Automation and Robotics 20ME51I_Week_2_Practicals.pdfAutomation and Robotics 20ME51I_Week_2_Practicals.pdf
Automation and Robotics 20ME51I_Week_2_Practicals.pdf
 
PROGRAMMABLE KEYBOARD AND DISPLAY INTERFACE(8279).pptx
PROGRAMMABLE KEYBOARD AND DISPLAY INTERFACE(8279).pptxPROGRAMMABLE KEYBOARD AND DISPLAY INTERFACE(8279).pptx
PROGRAMMABLE KEYBOARD AND DISPLAY INTERFACE(8279).pptx
 
EMBEDDED PASSWORD BASED ACESS CONTROL SYSTEM USING I2C PROTOCOL
EMBEDDED PASSWORD BASED ACESS CONTROL  SYSTEM USING I2C PROTOCOLEMBEDDED PASSWORD BASED ACESS CONTROL  SYSTEM USING I2C PROTOCOL
EMBEDDED PASSWORD BASED ACESS CONTROL SYSTEM USING I2C PROTOCOL
 
microcontroller and embedded system
microcontroller and embedded systemmicrocontroller and embedded system
microcontroller and embedded system
 
8279 d
8279 d8279 d
8279 d
 

8051

  • 1. Aim To detect which key is pressed on a 16-key keypad (interfaced with Port1) and display the corresponding key number on Port0. Components/Software 1. Atmel 89C51 microcontroller 2. 8051 simulator- Win8051 3. Universal SP3 Programmer 4. Compiler and Software to load the code into Universal SP3 Programmer 5. Computer System with Windows 98 or later operating system and RS-232 Cable 6. +5V D.C Power Supply 7. 16-key keypad with keys arranged in 4x4 array 8. Resistors 9. Capacitors 10. 10 MHz crystal oscillator 11. Signal Generator and CRO Description Keypad is an array of 4x4 keys with each key being a switch. The four rows are connected to pins 0-3 of Port1 and the four columns to pins 4-7 of Port1 as shown in the figure below. Each column is also connected to supply voltage through a pull up resistor (around 1k Ohms). To read a particular key, the corresponding row is driven to '0'. In a key is pressed and the corresponding row is driven '0' then current flows through the corresponding pull up resistor and the corresponding column reads '0'. Otherwise the corresponding column reads '1' (open circuit). For example if Key 5 is pressed -  R1 = 0, C1:C4 = 1111  R2 = 0, C1:C4 = 1011 Fig 42.1 Keypad schematic Procedure 1. Write the assembly code in Win8051. Compile and simulate it. 2. Once the code is error free, run it and check output with the Simulator 3. After checking the code in the simulator, the code (file with .HEX extension) is loaded into Atmel 89C51 microcontroller using Universal SP3 Programmer. 4. Now connections are made as shown in the circuit diagram.
  • 2. 5. Switch on the supply and push Reset button 6. Observe the results 7. Switch off the supply Assembly Code