SlideShare a Scribd company logo
1 of 7
Download to read offline
Seven Segment Interfacing with 8051 T.Srikrishna, M.Sc, M.Tech, GVP
Seven segment interfacing with 8051
The name 7 segments imply there are 7 LED segments arranged as shown
Seven segment displays are used to display digits from 0 to 9 and they also
display letters A to F
Working
There are two main constructions of the seven-segment display modules
Common Cathode: In this type of segments all the cathode terminals are
made common and tied to GND. Thus the segments a to g needs a logic
High signal(5v) in order to glow.
Common Anode: In this type of segments all the anodes terminals are
made common and tied to VCC(5v). Thus the segments a to g needs a
logic LOW signal(GND) in order to glow.
Seven Segment Interfacing with 8051 T.Srikrishna, M.Sc, M.Tech, GVP
Components required
 8051 Microcontroller
 7-Segment-Display
 2:4 Decoder
 NPN bipolar junction transistor –
 5V Power supply
Seven Segment Interfacing with 8051 T.Srikrishna, M.Sc, M.Tech, GVP
We will have two lookup tables that have values that are the
complement of each other depending on whether we are using common
anode/common cathode type seven-segment display.
Seven Segment Interfacing with 8051 T.Srikrishna, M.Sc, M.Tech, GVP
Assembly language program to interface seven segment display (0-9)
ORG 4000H
DB: 3FH, 06H, 5BH, 4FH, 66H, 6DH, 7DH, 07H, 7FH, 6FH, 0
; Lookup table for digits 0 to 9
ORG 0000H
main: MOV DPTR, #4000H
Repeat: CLR A
MOVC A, @A+DPTR ; Copy data from external location to accumulator
MOV P1, A ; Move the pattern of the digit into port P2
ACALL delay ; Call a delay to so that the transition is visible
INC DPTR ; Point to the next pattern
CJNE A, 0, Repeat ; Repeat till 0 (Stop bit) is received
SJMP main ; Run this forever till externally stopped
Seven Segment Interfacing with 8051 T.Srikrishna, M.Sc, M.Tech, GVP
Mode P3.4 P3.3
Active
Module
1 0 0 1
2 0 1 2
3 1 0 3
4 1 1 4
Seven Segment Interfacing with 8051 T.Srikrishna, M.Sc, M.Tech, GVP
Seven segment display – Four Modules
Now to interface more than one module at once with the 8051 microcontroller. Hence, we
connect a 2:4 decoder, whose inputs are given by pin P3.3 and pin P3.4.
Based on the status of these two pins, we come up with four modes that correspond to the
display selected.
Assembly language program to interface quad seven segment displays to 8051
ORG 4000H
DB 06H, 5BH, 4FH, 66H
ORG 0000H
main: MOV DPTR, #4000H
MOV P3, #00H ; clear the port 3 to use it as output port
CLR P3.3 ; Mode 1
CLR P3.4 ; 00
CLR A
MOVC A, @A+DPTR
CPL A
MOV P2, A ; P2 = 00000110b = pattern of digit ‘1’
ACALL delay
INC DPTR
SETB P3.3 ; Mode 2
CLR P3.4 ; 01
CLR A
MOVC A, @A+DPTR
Seven Segment Interfacing with 8051 T.Srikrishna, M.Sc, M.Tech, GVP
CPL A
MOV P2, A ; P2 = 01011011b = pattern of digit ‘2’
ACALL delay
INC DPTR
CLR P3.3 ; Mode 3
SETB P3.4 ; 10
CLR A
MOVC A, @A+DPTR
CPL A
MOV P2, A ; P2 = 01001111b = pattern of digit ‘3’
ACALL delay
INC DPTR
SETB P3.3 ; Mode 4
SETB P3.3 ; 11
CLR A
MOVC A, @A+DPTR
CPL A
MOV P2, A ; P2 = 01100110b = pattern of digit ‘4’
ACALL delay
SJMP main ; Run this program forever

More Related Content

What's hot

Chapter 1 microprocessor introduction
Chapter 1 microprocessor introductionChapter 1 microprocessor introduction
Chapter 1 microprocessor introductionShubham Singh
 
Microcontroller 8051 and its interfacing
Microcontroller 8051 and its interfacingMicrocontroller 8051 and its interfacing
Microcontroller 8051 and its interfacingAnkur Mahajan
 
Interfacing with peripherals: analog to digital converters and digital to ana...
Interfacing with peripherals: analog to digital converters and digital to ana...Interfacing with peripherals: analog to digital converters and digital to ana...
Interfacing with peripherals: analog to digital converters and digital to ana...NimeshSingh27
 
Stacks & subroutines 1
Stacks & subroutines 1Stacks & subroutines 1
Stacks & subroutines 1deval patel
 
Sensor interfacing in 8051
Sensor interfacing in 8051Sensor interfacing in 8051
Sensor interfacing in 8051Irfan Ahmad
 
Interfacing external memory in 8051
Interfacing external memory in 8051Interfacing external memory in 8051
Interfacing external memory in 8051ssuser3a47cb
 
8051 microcontroller lecture ppt by Tarun Khaneja ( 9034406598 )
8051 microcontroller lecture ppt by Tarun Khaneja ( 9034406598 )8051 microcontroller lecture ppt by Tarun Khaneja ( 9034406598 )
8051 microcontroller lecture ppt by Tarun Khaneja ( 9034406598 )Tarun Khaneja
 
DAC Interfacing with 8051.pdf
DAC Interfacing with 8051.pdfDAC Interfacing with 8051.pdf
DAC Interfacing with 8051.pdfSrikrishna Thota
 
Lcd interfaing using 8051 and assambly language programming
Lcd interfaing using 8051 and assambly language programmingLcd interfaing using 8051 and assambly language programming
Lcd interfaing using 8051 and assambly language programmingVikas Dongre
 
Memory organization of 8051
Memory organization of 8051Memory organization of 8051
Memory organization of 8051Muthu Manickam
 
Architecture of 8051 microcontroller))
Architecture of 8051 microcontroller))Architecture of 8051 microcontroller))
Architecture of 8051 microcontroller))Ganesh Ram
 
Relay interfacing with 8051
Relay interfacing with 8051Relay interfacing with 8051
Relay interfacing with 8051Pratik Phadte
 

What's hot (20)

LCD Interacing with 8051
LCD Interacing with 8051LCD Interacing with 8051
LCD Interacing with 8051
 
Chapter 1 microprocessor introduction
Chapter 1 microprocessor introductionChapter 1 microprocessor introduction
Chapter 1 microprocessor introduction
 
Microcontroller 8051 and its interfacing
Microcontroller 8051 and its interfacingMicrocontroller 8051 and its interfacing
Microcontroller 8051 and its interfacing
 
Timers and counters of microcontroller 8051
Timers and counters of microcontroller 8051Timers and counters of microcontroller 8051
Timers and counters of microcontroller 8051
 
Interfacing LCD with 8051 Microcontroller
Interfacing LCD with 8051 MicrocontrollerInterfacing LCD with 8051 Microcontroller
Interfacing LCD with 8051 Microcontroller
 
Interrupts in 8051
Interrupts in 8051Interrupts in 8051
Interrupts in 8051
 
Interfacing with peripherals: analog to digital converters and digital to ana...
Interfacing with peripherals: analog to digital converters and digital to ana...Interfacing with peripherals: analog to digital converters and digital to ana...
Interfacing with peripherals: analog to digital converters and digital to ana...
 
Stacks & subroutines 1
Stacks & subroutines 1Stacks & subroutines 1
Stacks & subroutines 1
 
Sensor interfacing in 8051
Sensor interfacing in 8051Sensor interfacing in 8051
Sensor interfacing in 8051
 
8051 interfacing
8051 interfacing8051 interfacing
8051 interfacing
 
Interfacing external memory in 8051
Interfacing external memory in 8051Interfacing external memory in 8051
Interfacing external memory in 8051
 
8051 microcontroller lecture ppt by Tarun Khaneja ( 9034406598 )
8051 microcontroller lecture ppt by Tarun Khaneja ( 9034406598 )8051 microcontroller lecture ppt by Tarun Khaneja ( 9034406598 )
8051 microcontroller lecture ppt by Tarun Khaneja ( 9034406598 )
 
DAC Interfacing with 8051.pdf
DAC Interfacing with 8051.pdfDAC Interfacing with 8051.pdf
DAC Interfacing with 8051.pdf
 
Programmable logic controllers
Programmable logic controllersProgrammable logic controllers
Programmable logic controllers
 
Lcd interfaing using 8051 and assambly language programming
Lcd interfaing using 8051 and assambly language programmingLcd interfaing using 8051 and assambly language programming
Lcd interfaing using 8051 and assambly language programming
 
8051 Timer
8051 Timer8051 Timer
8051 Timer
 
Memory organization of 8051
Memory organization of 8051Memory organization of 8051
Memory organization of 8051
 
Architecture of 8051 microcontroller))
Architecture of 8051 microcontroller))Architecture of 8051 microcontroller))
Architecture of 8051 microcontroller))
 
8259 a
8259 a8259 a
8259 a
 
Relay interfacing with 8051
Relay interfacing with 8051Relay interfacing with 8051
Relay interfacing with 8051
 

Similar to Seven segment interfacing with 8051.pdf

Ppt on interfacing led and 7 segment with 8951
Ppt on interfacing led and 7 segment with 8951 Ppt on interfacing led and 7 segment with 8951
Ppt on interfacing led and 7 segment with 8951 pooja jaiswal
 
Ppt on interfacing led and 7 segmentwith 8951
Ppt on interfacing led  and 7 segmentwith 8951Ppt on interfacing led  and 7 segmentwith 8951
Ppt on interfacing led and 7 segmentwith 8951pooja jaiswal
 
IRJET - Interfacing Multi-Digit 7-Segment with 8051 Microcontroller
IRJET -  	  Interfacing Multi-Digit 7-Segment with 8051 MicrocontrollerIRJET -  	  Interfacing Multi-Digit 7-Segment with 8051 Microcontroller
IRJET - Interfacing Multi-Digit 7-Segment with 8051 MicrocontrollerIRJET Journal
 
Unit iv microcontrollers final
Unit iv microcontrollers finalUnit iv microcontrollers final
Unit iv microcontrollers finalSARITHA REDDY
 
Electronic code lock device
Electronic code lock deviceElectronic code lock device
Electronic code lock deviceAmitoj Kaur
 
Introduction to embedded system & density based traffic light system
Introduction to embedded system & density based traffic light systemIntroduction to embedded system & density based traffic light system
Introduction to embedded system & density based traffic light systemRani Loganathan
 
Abstract - Interfacing 5 x7 matrix led display to 8051
Abstract - Interfacing 5 x7 matrix led display to 8051 Abstract - Interfacing 5 x7 matrix led display to 8051
Abstract - Interfacing 5 x7 matrix led display to 8051 Vatsal N Shah
 
Nand gate breadboardtask
Nand gate breadboardtaskNand gate breadboardtask
Nand gate breadboardtaskshankarganesh73
 
Eee iv-microcontrollers [10 es42]-assignment
Eee iv-microcontrollers [10 es42]-assignmentEee iv-microcontrollers [10 es42]-assignment
Eee iv-microcontrollers [10 es42]-assignmentGopinath.B.L Naidu
 
IMPLEMENTING A DIGITAL MULTIMETER
IMPLEMENTING A DIGITAL MULTIMETERIMPLEMENTING A DIGITAL MULTIMETER
IMPLEMENTING A DIGITAL MULTIMETERVijay Elavunkal
 
Analog to Digital Converters
Analog to Digital ConvertersAnalog to Digital Converters
Analog to Digital ConvertersAmitabh Shukla
 
Microprocessorlabmanual ee0310
Microprocessorlabmanual ee0310Microprocessorlabmanual ee0310
Microprocessorlabmanual ee0310DHEERAJ DHAKAR
 
Touchpad Monitored Car
Touchpad Monitored CarTouchpad Monitored Car
Touchpad Monitored CarIOSR Journals
 
Touchpad Monitored Car
Touchpad Monitored Car Touchpad Monitored Car
Touchpad Monitored Car IOSR Journals
 

Similar to Seven segment interfacing with 8051.pdf (20)

8051.pdf
8051.pdf8051.pdf
8051.pdf
 
Ppt on interfacing led and 7 segment with 8951
Ppt on interfacing led and 7 segment with 8951 Ppt on interfacing led and 7 segment with 8951
Ppt on interfacing led and 7 segment with 8951
 
Ppt on interfacing led and 7 segmentwith 8951
Ppt on interfacing led  and 7 segmentwith 8951Ppt on interfacing led  and 7 segmentwith 8951
Ppt on interfacing led and 7 segmentwith 8951
 
IRJET - Interfacing Multi-Digit 7-Segment with 8051 Microcontroller
IRJET -  	  Interfacing Multi-Digit 7-Segment with 8051 MicrocontrollerIRJET -  	  Interfacing Multi-Digit 7-Segment with 8051 Microcontroller
IRJET - Interfacing Multi-Digit 7-Segment with 8051 Microcontroller
 
Unit iv microcontrollers final
Unit iv microcontrollers finalUnit iv microcontrollers final
Unit iv microcontrollers final
 
Electronic code lock device
Electronic code lock deviceElectronic code lock device
Electronic code lock device
 
Analog to Digital Converter
Analog to Digital ConverterAnalog to Digital Converter
Analog to Digital Converter
 
Lcd interfacing
Lcd interfacingLcd interfacing
Lcd interfacing
 
Introduction to embedded system & density based traffic light system
Introduction to embedded system & density based traffic light systemIntroduction to embedded system & density based traffic light system
Introduction to embedded system & density based traffic light system
 
8051 FINIAL
8051 FINIAL8051 FINIAL
8051 FINIAL
 
LCD WITH 8051.docx
LCD WITH 8051.docxLCD WITH 8051.docx
LCD WITH 8051.docx
 
Abstract - Interfacing 5 x7 matrix led display to 8051
Abstract - Interfacing 5 x7 matrix led display to 8051 Abstract - Interfacing 5 x7 matrix led display to 8051
Abstract - Interfacing 5 x7 matrix led display to 8051
 
Nand gate breadboardtask
Nand gate breadboardtaskNand gate breadboardtask
Nand gate breadboardtask
 
Eee iv-microcontrollers [10 es42]-assignment
Eee iv-microcontrollers [10 es42]-assignmentEee iv-microcontrollers [10 es42]-assignment
Eee iv-microcontrollers [10 es42]-assignment
 
IMPLEMENTING A DIGITAL MULTIMETER
IMPLEMENTING A DIGITAL MULTIMETERIMPLEMENTING A DIGITAL MULTIMETER
IMPLEMENTING A DIGITAL MULTIMETER
 
Analog to Digital Converters
Analog to Digital ConvertersAnalog to Digital Converters
Analog to Digital Converters
 
Microprocessorlabmanual ee0310
Microprocessorlabmanual ee0310Microprocessorlabmanual ee0310
Microprocessorlabmanual ee0310
 
Touchpad Monitored Car
Touchpad Monitored CarTouchpad Monitored Car
Touchpad Monitored Car
 
Touchpad Monitored Car
Touchpad Monitored Car Touchpad Monitored Car
Touchpad Monitored Car
 
Embedded System
Embedded SystemEmbedded System
Embedded System
 

More from Srikrishna Thota

solar energy introduction.pdf
 solar energy introduction.pdf solar energy introduction.pdf
solar energy introduction.pdfSrikrishna Thota
 
8051 Architecture and PIN Configuration.pdf
8051 Architecture and PIN Configuration.pdf8051 Architecture and PIN Configuration.pdf
8051 Architecture and PIN Configuration.pdfSrikrishna Thota
 
Types of Microcontrollers.pdf
Types of Microcontrollers.pdfTypes of Microcontrollers.pdf
Types of Microcontrollers.pdfSrikrishna Thota
 
Addressing modes of 8051.pdf
Addressing modes of 8051.pdfAddressing modes of 8051.pdf
Addressing modes of 8051.pdfSrikrishna Thota
 
Port Organization of 8051 .pdf
Port Organization of 8051 .pdfPort Organization of 8051 .pdf
Port Organization of 8051 .pdfSrikrishna Thota
 
DEVELOPMENT TOOLS FOR MICROCONTROLLERS.pdf
DEVELOPMENT TOOLS FOR MICROCONTROLLERS.pdfDEVELOPMENT TOOLS FOR MICROCONTROLLERS.pdf
DEVELOPMENT TOOLS FOR MICROCONTROLLERS.pdfSrikrishna Thota
 
Interfacing of 8051 with 8255 Programmable Peripheral Interface.pdf
Interfacing of 8051 with 8255 Programmable Peripheral Interface.pdfInterfacing of 8051 with 8255 Programmable Peripheral Interface.pdf
Interfacing of 8051 with 8255 Programmable Peripheral Interface.pdfSrikrishna Thota
 
interfacing of temperature sensor LM 35 with 8051.pdf
interfacing of temperature sensor LM 35 with 8051.pdfinterfacing of temperature sensor LM 35 with 8051.pdf
interfacing of temperature sensor LM 35 with 8051.pdfSrikrishna Thota
 
BInary Number Representation
 BInary Number Representation BInary Number Representation
BInary Number RepresentationSrikrishna Thota
 
Number Base Conversion Digital Electronics
Number Base Conversion Digital ElectronicsNumber Base Conversion Digital Electronics
Number Base Conversion Digital ElectronicsSrikrishna Thota
 
Digital Electronics Notes
Digital Electronics Notes Digital Electronics Notes
Digital Electronics Notes Srikrishna Thota
 
Microprocessor Interfacing and 8155 Features
Microprocessor Interfacing and 8155 FeaturesMicroprocessor Interfacing and 8155 Features
Microprocessor Interfacing and 8155 FeaturesSrikrishna Thota
 
Analog to Digital Conversion Basics
Analog to Digital Conversion BasicsAnalog to Digital Conversion Basics
Analog to Digital Conversion BasicsSrikrishna Thota
 
8259 programmable interrupt controller
8259 programmable interrupt controller8259 programmable interrupt controller
8259 programmable interrupt controllerSrikrishna Thota
 
8085 interfacing with memory chips
8085 interfacing with memory chips8085 interfacing with memory chips
8085 interfacing with memory chipsSrikrishna Thota
 

More from Srikrishna Thota (18)

solar energy introduction.pdf
 solar energy introduction.pdf solar energy introduction.pdf
solar energy introduction.pdf
 
8051 Architecture and PIN Configuration.pdf
8051 Architecture and PIN Configuration.pdf8051 Architecture and PIN Configuration.pdf
8051 Architecture and PIN Configuration.pdf
 
Types of Microcontrollers.pdf
Types of Microcontrollers.pdfTypes of Microcontrollers.pdf
Types of Microcontrollers.pdf
 
Addressing modes of 8051.pdf
Addressing modes of 8051.pdfAddressing modes of 8051.pdf
Addressing modes of 8051.pdf
 
interrupts of 8051.pdf
interrupts of 8051.pdfinterrupts of 8051.pdf
interrupts of 8051.pdf
 
Port Organization of 8051 .pdf
Port Organization of 8051 .pdfPort Organization of 8051 .pdf
Port Organization of 8051 .pdf
 
DEVELOPMENT TOOLS FOR MICROCONTROLLERS.pdf
DEVELOPMENT TOOLS FOR MICROCONTROLLERS.pdfDEVELOPMENT TOOLS FOR MICROCONTROLLERS.pdf
DEVELOPMENT TOOLS FOR MICROCONTROLLERS.pdf
 
Interfacing of 8051 with 8255 Programmable Peripheral Interface.pdf
Interfacing of 8051 with 8255 Programmable Peripheral Interface.pdfInterfacing of 8051 with 8255 Programmable Peripheral Interface.pdf
Interfacing of 8051 with 8255 Programmable Peripheral Interface.pdf
 
interfacing of temperature sensor LM 35 with 8051.pdf
interfacing of temperature sensor LM 35 with 8051.pdfinterfacing of temperature sensor LM 35 with 8051.pdf
interfacing of temperature sensor LM 35 with 8051.pdf
 
BInary Number Representation
 BInary Number Representation BInary Number Representation
BInary Number Representation
 
Number Base Conversion Digital Electronics
Number Base Conversion Digital ElectronicsNumber Base Conversion Digital Electronics
Number Base Conversion Digital Electronics
 
Operational amplifiers
Operational amplifiers Operational amplifiers
Operational amplifiers
 
Digital Electronics Notes
Digital Electronics Notes Digital Electronics Notes
Digital Electronics Notes
 
The 8255 PPI
The 8255 PPIThe 8255 PPI
The 8255 PPI
 
Microprocessor Interfacing and 8155 Features
Microprocessor Interfacing and 8155 FeaturesMicroprocessor Interfacing and 8155 Features
Microprocessor Interfacing and 8155 Features
 
Analog to Digital Conversion Basics
Analog to Digital Conversion BasicsAnalog to Digital Conversion Basics
Analog to Digital Conversion Basics
 
8259 programmable interrupt controller
8259 programmable interrupt controller8259 programmable interrupt controller
8259 programmable interrupt controller
 
8085 interfacing with memory chips
8085 interfacing with memory chips8085 interfacing with memory chips
8085 interfacing with memory chips
 

Recently uploaded

Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 

Recently uploaded (20)

Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 

Seven segment interfacing with 8051.pdf

  • 1. Seven Segment Interfacing with 8051 T.Srikrishna, M.Sc, M.Tech, GVP Seven segment interfacing with 8051 The name 7 segments imply there are 7 LED segments arranged as shown Seven segment displays are used to display digits from 0 to 9 and they also display letters A to F Working There are two main constructions of the seven-segment display modules Common Cathode: In this type of segments all the cathode terminals are made common and tied to GND. Thus the segments a to g needs a logic High signal(5v) in order to glow. Common Anode: In this type of segments all the anodes terminals are made common and tied to VCC(5v). Thus the segments a to g needs a logic LOW signal(GND) in order to glow.
  • 2. Seven Segment Interfacing with 8051 T.Srikrishna, M.Sc, M.Tech, GVP Components required  8051 Microcontroller  7-Segment-Display  2:4 Decoder  NPN bipolar junction transistor –  5V Power supply
  • 3. Seven Segment Interfacing with 8051 T.Srikrishna, M.Sc, M.Tech, GVP We will have two lookup tables that have values that are the complement of each other depending on whether we are using common anode/common cathode type seven-segment display.
  • 4. Seven Segment Interfacing with 8051 T.Srikrishna, M.Sc, M.Tech, GVP Assembly language program to interface seven segment display (0-9) ORG 4000H DB: 3FH, 06H, 5BH, 4FH, 66H, 6DH, 7DH, 07H, 7FH, 6FH, 0 ; Lookup table for digits 0 to 9 ORG 0000H main: MOV DPTR, #4000H Repeat: CLR A MOVC A, @A+DPTR ; Copy data from external location to accumulator MOV P1, A ; Move the pattern of the digit into port P2 ACALL delay ; Call a delay to so that the transition is visible INC DPTR ; Point to the next pattern CJNE A, 0, Repeat ; Repeat till 0 (Stop bit) is received SJMP main ; Run this forever till externally stopped
  • 5. Seven Segment Interfacing with 8051 T.Srikrishna, M.Sc, M.Tech, GVP Mode P3.4 P3.3 Active Module 1 0 0 1 2 0 1 2 3 1 0 3 4 1 1 4
  • 6. Seven Segment Interfacing with 8051 T.Srikrishna, M.Sc, M.Tech, GVP Seven segment display – Four Modules Now to interface more than one module at once with the 8051 microcontroller. Hence, we connect a 2:4 decoder, whose inputs are given by pin P3.3 and pin P3.4. Based on the status of these two pins, we come up with four modes that correspond to the display selected. Assembly language program to interface quad seven segment displays to 8051 ORG 4000H DB 06H, 5BH, 4FH, 66H ORG 0000H main: MOV DPTR, #4000H MOV P3, #00H ; clear the port 3 to use it as output port CLR P3.3 ; Mode 1 CLR P3.4 ; 00 CLR A MOVC A, @A+DPTR CPL A MOV P2, A ; P2 = 00000110b = pattern of digit ‘1’ ACALL delay INC DPTR SETB P3.3 ; Mode 2 CLR P3.4 ; 01 CLR A MOVC A, @A+DPTR
  • 7. Seven Segment Interfacing with 8051 T.Srikrishna, M.Sc, M.Tech, GVP CPL A MOV P2, A ; P2 = 01011011b = pattern of digit ‘2’ ACALL delay INC DPTR CLR P3.3 ; Mode 3 SETB P3.4 ; 10 CLR A MOVC A, @A+DPTR CPL A MOV P2, A ; P2 = 01001111b = pattern of digit ‘3’ ACALL delay INC DPTR SETB P3.3 ; Mode 4 SETB P3.3 ; 11 CLR A MOVC A, @A+DPTR CPL A MOV P2, A ; P2 = 01100110b = pattern of digit ‘4’ ACALL delay SJMP main ; Run this program forever