SlideShare a Scribd company logo
6
Most read
13
Most read
18
Most read
THE 8051
MICROCONTROLLER :
I/O INTERFACING
Presented by:-
Abhinav Shubham(131046)
&
Tanmay Kapoor(131053)
11/27/2015
TOPICS OF
DISCUSSION:-
What is IO interfacing?
Recapitulation of PIN Configuration of 8051
Devices to be interfaced
How they are interfaced?
Queries…
11/27/2015
WHAT IS IO INTERFACING
 Input-output interface provides a method for transferring information between
internal storage and external I/O devices.
 Peripherals connected to a microcontroller need special communication links
for interfacing them with the CPU. The purpose of the communication link is to
resolve the differences that exist between the CPU and each peripheral.
The major differences are:
Peripherals are electromechanical and electromagnetic devices and their
manner of operation is different from the operation of the CPU and memory,
which are electronic devices. Therefore, a conversion of signal values may be
required.
The data transfer rate of peripherals is usually slower than the transfer rate of
the CPU, and consequently, a synchronization mechanism may be needed,
etc…..
11/27/2015
PIN CONFIGURATION OF 8051
11/27/2015
Each
port0,port1,port2,
port3 are bidirectional
and 8-bit I/O ports.
Above data for ATMEL
AT89S51
DEVICES WE WILL BE
INTERFACING:-
 LEDS
 LCD
 KEYBOARD
11/27/2015
INTERFACING LEDS
• Connection -Port 0 is connected to eight LEDs,
each of them is connected to 5V through a 330
ohm resistor. Port 1 is connected to a DIP switch
and a 10Kohm resistor
• Condition - Corresponding led should light up
when switch is pressed , i.e. if Switch at P1.0 is
pressed then LED at P0.0 should light up.
11/27/2015
INTERFACING
LEDS(CONTD.)
11/27/2015
CONSIDER…
11/27/2015
HOW TO PROGRAM ?? ..
ASSEMBLY LANGUAGE
LOOP:
mov p1,#0ffh ; To
configure
port1 for input.
mov a,p1
mov p0,a
sjmp LOOP ; Stay in infinite
loop
C LANGUAGE
void main()
unsigned char S;
P1= 0xff; //port1 as input
P0= 0x00; //port0 as output
{
while (1)
{
S=P1; //switch value
P0=P1; //display on led
}
}
11/27/2015
INTERFACING LCD
• LCD is finding widespread use replacing LED
• The declining prices of LCD
• Ability to display numbers, characters and graphics
• Incorporation of a refreshing controller(graphics
controller, e.g. HD44780) within the LCD, there by
relieving the CPU of an additional task.
• LCD is far better than 7 segment display as it has far
better graphics.
• Ease of programming for characters and graphics
11/27/2015
PIN OUT
(LCD)
,16*2
DISPLAY
,
5*7
MATRIX
11/27/2015
11/27/2015
LCD CONNECTIONS
 To send a command :-
 Specify command to
data pins.
 Make R/W=0 (write
operation)
Make RS=0 (select
command register)
Give a H-to-L pulse to
E(enable pin).
 To send data:-
 Write data to data pins
 R/W =0 (write operation)
 Make RS=1 (select data
register)
 Give a H-to-L pulse to
E(enable pin).Data is written
on positive edge of enable
signal.
11/27/2015
ANOTHER ASPECT TO BE TAKEN
CARE OF…. BUSY FLAG(D7-PIN)
• Some delay is needed for LCD to successfully process the
command or data(processing time of lcd).
• So, before data to be written, check if lcd is busy(check the D7-
pin status(if 1 then busy)
• Reading the Busy flag.
• Select command register (RS=0)
• Select read operation (R/W=1)
• Send enable signal (E=1)
• Read the flag
11/27/2015
KEYBOARD
INTERFACING
• Keypad(keyboard) is a widely used input device with lots of
application in our everyday life.
• From a simple telephone to keyboard of a computer, ATM,
electronic lock, elevator, etc., keypad is used to take input
from the user for further processing.
• Keypad is organized as a matrix of switches in rows and
column.
11/27/2015
SO HOW DOES KEYPADS
WORK??..
11/27/2015
 It’s a matrix of rows and
columns(here 4*4)
 Rows and columns intersect at
16 points.(when pressed)
 One of them are connected to
power supply and other one
grounded…
CONNECTIONS TO
PORTS
11/27/2015
Initially all the rows are set to
zero by the controller and the
columns are scanned to check
if any key is pressed. In case
no key is pressed the output of
all the columns will be high.
Whenever a key is pressed the
row and column corresponding
to the key will get short, resulting
in the output of the
corresponding column goes to
low (since we have made all the
rows zero). This gives the
column number of the pressed
key.
Once the column number is detected,
the controller set’s all the rows to
high. Now one by one each row is set
to zero by controller and the earlier
detected column is checked if it
becomes zero. The row
corresponding to which the column
gets zero is the row number of the
digit.
THANK YOU!!!
11/27/2015

More Related Content

PPTX
Interfacing Stepper motor with 8051
PDF
Keypad Interfacing with 8051 Microcontroller
PPT
Interfacing LCD with 8051 Microcontroller
PPTX
Sensor interfacing in 8051
PDF
8051 Microcontroller I/O ports
PPTX
Interfacing with peripherals: analog to digital converters and digital to ana...
PPTX
Addressing modes of 8051
PDF
Seven segment interfacing with 8051.pdf
Interfacing Stepper motor with 8051
Keypad Interfacing with 8051 Microcontroller
Interfacing LCD with 8051 Microcontroller
Sensor interfacing in 8051
8051 Microcontroller I/O ports
Interfacing with peripherals: analog to digital converters and digital to ana...
Addressing modes of 8051
Seven segment interfacing with 8051.pdf

What's hot (20)

PPT
Architecture of 8051 microcontroller))
PPTX
Interrupts of 8086
PPTX
8051 MICROCONTROLLER ARCHITECTURE.pptx
PPTX
Key board interfacing with 8051
PPTX
Addressing modes 8085
PPT
8051 instruction set
PPT
Timing diagram 8085 microprocessor
PPT
ARDUINO AND ITS PIN CONFIGURATION
PPT
8051 ch9-950217
PPTX
LCD Interacing with 8051
PPTX
Addressing Modes of 8085 Microprocessor
PPTX
Memory Organisation in embedded systems
PPT
Serial Peripheral Interface(SPI)
PPTX
7 segment led interfacing with 8051
PPT
Adc interfacing
PDF
8085 microprocessor ramesh gaonkar
PPT
Interfacing stepper motor
PPTX
8251 USART
PPT
Memory & I/O interfacing
Architecture of 8051 microcontroller))
Interrupts of 8086
8051 MICROCONTROLLER ARCHITECTURE.pptx
Key board interfacing with 8051
Addressing modes 8085
8051 instruction set
Timing diagram 8085 microprocessor
ARDUINO AND ITS PIN CONFIGURATION
8051 ch9-950217
LCD Interacing with 8051
Addressing Modes of 8085 Microprocessor
Memory Organisation in embedded systems
Serial Peripheral Interface(SPI)
7 segment led interfacing with 8051
Adc interfacing
8085 microprocessor ramesh gaonkar
Interfacing stepper motor
8251 USART
Memory & I/O interfacing
Ad

Similar to 8051 io interface (20)

PPT
PPI-MECHATRONICS
PPT
MECHATRONICS-Unit 3-PROGRAMMABLE PERIPERAL INTERFACE.ppt
PDF
Unit 3-PROGRAMMABLE PERIPERAL INTERFACE.pdf- MECHATRONICS-ENGGINERING
PPT
UNIT III PROGRAMMABLE PERIPHERAL INTERFACE
DOCX
Keypad interfacing 8051 -NANOCDAC
PPT
PROGRAMMABLE PERIPHERAL INTERFCAE.ppt
PDF
Microcontroladores: El microcontrolador 8051 con LCD 16x2
PPT
20ME702– MECHATRONICS -UNIT-3.ppt
PPT
Unit 3-PROGRAMMABLE PERIPHERAL INTERFACE-ME6702– MECHATRONICS
PPTX
Chapter5
PPTX
8086 microprocessor -Input/Output INTERFACING
PPT
Lcd & keypad
PPTX
UNIT 5 Interfacing and Mixed Signal Controller.pptx
PPT
Interfacing ics for microprocessor
PPT
Microcontroller 8051 gs
PDF
Programmable Peripheral Devices
PPTX
UNIT 5.pptx
PPTX
Interfacing of 8255 IC By Er. Swapnil Kaware.
PPTX
MPMC UNIT 3 MPMC UNIT 3 MPMC UNIT 3 MPMC UNIT 3
PPI-MECHATRONICS
MECHATRONICS-Unit 3-PROGRAMMABLE PERIPERAL INTERFACE.ppt
Unit 3-PROGRAMMABLE PERIPERAL INTERFACE.pdf- MECHATRONICS-ENGGINERING
UNIT III PROGRAMMABLE PERIPHERAL INTERFACE
Keypad interfacing 8051 -NANOCDAC
PROGRAMMABLE PERIPHERAL INTERFCAE.ppt
Microcontroladores: El microcontrolador 8051 con LCD 16x2
20ME702– MECHATRONICS -UNIT-3.ppt
Unit 3-PROGRAMMABLE PERIPHERAL INTERFACE-ME6702– MECHATRONICS
Chapter5
8086 microprocessor -Input/Output INTERFACING
Lcd & keypad
UNIT 5 Interfacing and Mixed Signal Controller.pptx
Interfacing ics for microprocessor
Microcontroller 8051 gs
Programmable Peripheral Devices
UNIT 5.pptx
Interfacing of 8255 IC By Er. Swapnil Kaware.
MPMC UNIT 3 MPMC UNIT 3 MPMC UNIT 3 MPMC UNIT 3
Ad

Recently uploaded (20)

PDF
Top 10 read articles In Managing Information Technology.pdf
PPTX
Lesson 3_Tessellation.pptx finite Mathematics
PPTX
24AI201_AI_Unit_4 (1).pptx Artificial intelligence
PPTX
“Next-Gen AI: Trends Reshaping Our World”
PPTX
web development for engineering and engineering
PPTX
ANIMAL INTERVENTION WARNING SYSTEM (4).pptx
PDF
Introduction to Data Science: data science process
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PPTX
Internship_Presentation_Final engineering.pptx
PPTX
MET 305 MODULE 1 KTU 2019 SCHEME 25.pptx
PPTX
Simulation of electric circuit laws using tinkercad.pptx
PPTX
TE-AI-Unit VI notes using planning model
PDF
BRKDCN-2613.pdf Cisco AI DC NVIDIA presentation
PPTX
Fluid Mechanics, Module 3: Basics of Fluid Mechanics
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PDF
Queuing formulas to evaluate throughputs and servers
PDF
Monitoring Global Terrestrial Surface Water Height using Remote Sensing - ARS...
PPTX
anatomy of limbus and anterior chamber .pptx
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
Top 10 read articles In Managing Information Technology.pdf
Lesson 3_Tessellation.pptx finite Mathematics
24AI201_AI_Unit_4 (1).pptx Artificial intelligence
“Next-Gen AI: Trends Reshaping Our World”
web development for engineering and engineering
ANIMAL INTERVENTION WARNING SYSTEM (4).pptx
Introduction to Data Science: data science process
Model Code of Practice - Construction Work - 21102022 .pdf
Internship_Presentation_Final engineering.pptx
MET 305 MODULE 1 KTU 2019 SCHEME 25.pptx
Simulation of electric circuit laws using tinkercad.pptx
TE-AI-Unit VI notes using planning model
BRKDCN-2613.pdf Cisco AI DC NVIDIA presentation
Fluid Mechanics, Module 3: Basics of Fluid Mechanics
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
Queuing formulas to evaluate throughputs and servers
Monitoring Global Terrestrial Surface Water Height using Remote Sensing - ARS...
anatomy of limbus and anterior chamber .pptx
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd

8051 io interface

  • 1. THE 8051 MICROCONTROLLER : I/O INTERFACING Presented by:- Abhinav Shubham(131046) & Tanmay Kapoor(131053) 11/27/2015
  • 2. TOPICS OF DISCUSSION:- What is IO interfacing? Recapitulation of PIN Configuration of 8051 Devices to be interfaced How they are interfaced? Queries… 11/27/2015
  • 3. WHAT IS IO INTERFACING  Input-output interface provides a method for transferring information between internal storage and external I/O devices.  Peripherals connected to a microcontroller need special communication links for interfacing them with the CPU. The purpose of the communication link is to resolve the differences that exist between the CPU and each peripheral. The major differences are: Peripherals are electromechanical and electromagnetic devices and their manner of operation is different from the operation of the CPU and memory, which are electronic devices. Therefore, a conversion of signal values may be required. The data transfer rate of peripherals is usually slower than the transfer rate of the CPU, and consequently, a synchronization mechanism may be needed, etc….. 11/27/2015
  • 4. PIN CONFIGURATION OF 8051 11/27/2015 Each port0,port1,port2, port3 are bidirectional and 8-bit I/O ports. Above data for ATMEL AT89S51
  • 5. DEVICES WE WILL BE INTERFACING:-  LEDS  LCD  KEYBOARD 11/27/2015
  • 6. INTERFACING LEDS • Connection -Port 0 is connected to eight LEDs, each of them is connected to 5V through a 330 ohm resistor. Port 1 is connected to a DIP switch and a 10Kohm resistor • Condition - Corresponding led should light up when switch is pressed , i.e. if Switch at P1.0 is pressed then LED at P0.0 should light up. 11/27/2015
  • 9. HOW TO PROGRAM ?? .. ASSEMBLY LANGUAGE LOOP: mov p1,#0ffh ; To configure port1 for input. mov a,p1 mov p0,a sjmp LOOP ; Stay in infinite loop C LANGUAGE void main() unsigned char S; P1= 0xff; //port1 as input P0= 0x00; //port0 as output { while (1) { S=P1; //switch value P0=P1; //display on led } } 11/27/2015
  • 10. INTERFACING LCD • LCD is finding widespread use replacing LED • The declining prices of LCD • Ability to display numbers, characters and graphics • Incorporation of a refreshing controller(graphics controller, e.g. HD44780) within the LCD, there by relieving the CPU of an additional task. • LCD is far better than 7 segment display as it has far better graphics. • Ease of programming for characters and graphics 11/27/2015
  • 13. LCD CONNECTIONS  To send a command :-  Specify command to data pins.  Make R/W=0 (write operation) Make RS=0 (select command register) Give a H-to-L pulse to E(enable pin).  To send data:-  Write data to data pins  R/W =0 (write operation)  Make RS=1 (select data register)  Give a H-to-L pulse to E(enable pin).Data is written on positive edge of enable signal. 11/27/2015
  • 14. ANOTHER ASPECT TO BE TAKEN CARE OF…. BUSY FLAG(D7-PIN) • Some delay is needed for LCD to successfully process the command or data(processing time of lcd). • So, before data to be written, check if lcd is busy(check the D7- pin status(if 1 then busy) • Reading the Busy flag. • Select command register (RS=0) • Select read operation (R/W=1) • Send enable signal (E=1) • Read the flag 11/27/2015
  • 15. KEYBOARD INTERFACING • Keypad(keyboard) is a widely used input device with lots of application in our everyday life. • From a simple telephone to keyboard of a computer, ATM, electronic lock, elevator, etc., keypad is used to take input from the user for further processing. • Keypad is organized as a matrix of switches in rows and column. 11/27/2015
  • 16. SO HOW DOES KEYPADS WORK??.. 11/27/2015  It’s a matrix of rows and columns(here 4*4)  Rows and columns intersect at 16 points.(when pressed)  One of them are connected to power supply and other one grounded…
  • 17. CONNECTIONS TO PORTS 11/27/2015 Initially all the rows are set to zero by the controller and the columns are scanned to check if any key is pressed. In case no key is pressed the output of all the columns will be high. Whenever a key is pressed the row and column corresponding to the key will get short, resulting in the output of the corresponding column goes to low (since we have made all the rows zero). This gives the column number of the pressed key. Once the column number is detected, the controller set’s all the rows to high. Now one by one each row is set to zero by controller and the earlier detected column is checked if it becomes zero. The row corresponding to which the column gets zero is the row number of the digit.

Editor's Notes

  • #14: Note- port1 used as output, port2 used as control port of lcd