SlideShare a Scribd company logo
1 of 16
Department of Electrical and Electronic
Engineering
Khulna University of Engineering & Technology
Khulna-9203
Course code : EE 3214
Sessional on
Microprocessors, Micro-controllers and Peripherals
Presented By
Amit Kumer Podder
Experiment No. 04
Design and implementation of traffic light
controller using 8255 PPI in 8085
microprocessor environment
Experiment Name
7/3/2020 Amit Kumer Podder 2
G3 Y3 R3
G4 Y4 R4G2 Y2 R2
G1 Y1 R1Road 1
Road 3 Road 4
Road 2
Traffic Signal Flow diagram
Road 3 & Road 4 are allowing Traffic
7/3/2020 Amit Kumer Podder 3
G3 Y3 R3
G4 Y4 R4G2 Y2 R2
G1 Y1 R1Road 1
Road 3 Road 4
Road 2
Traffic Signal Flow diagram
Road 3 and Road 4 are allowing Traffic but in
delay mode
7/3/2020 Amit Kumer Podder 4
G3 Y3 R3
G4 Y4 R4G2 Y2 R2
G1 Y1 R1Road 1
Road 3 Road 4
Road 2
Traffic Signal Flow diagram
Road 1 & Road 2 are allowing Traffic
7/3/2020 Amit Kumer Podder 5
G3 Y3 R3
G4 Y4 R4G2 Y2 R2
G1 Y1 R1Road 1
Road 3 Road 4
Road 2
Traffic Signal Flow diagram
Road 1 and Road 2 are allowing Traffic but
in delay mode
7/3/2020 Amit Kumer Podder 6
Traffic signal generating coding table
PA7 PA6 PA5 PA4 PA3 PA2 PA1 PA0 PB7 PB6 PB5 PB4 PB3 PB2 PB1 PB0
0 0 G2 Y2 R2 G1 Y1 R1 0 0 G4 Y4 R4 G3 Y3 R3
R1 R2 G3 G4 0 0 0 0 1 0 0 1
= 09H
0 0 1 0 0 1 0 0
=24H
Y1 Y2 Y3 Y4 0 0 0 1 0 0 1 0
= 12H
0 0 0 1 0 0 1 0
= 12H
R3 R4 G1 G2 0 0 1 0 0 1 0 0
= 24H
0 0 0 0 1 0 0 1
= 09H
Y1 Y2 Y3 Y4 0 0 0 0 1 0 1 0
= 12H
0 0 0 1 0 0 1 0
= 12H
7/3/2020 Amit Kumer Podder 7
Main Program in 8085: Traffic signal Control
Label Mnemonics
Opcode Operand
Start MVI A,80H
OUT 23H
MVI A,09H
OUT 20H
MVI A,24H
OUT 21H
CALL DELAY
MVI A,12H
OUT 20H
MVI A,12H
OUT 21H
CALL DELAY
MVI A,24H
OUT 20H
MVI A,09H
OUT 21H
CALL DELAY
MVI A,12H
OUT 20H
MVI A,12H
OUT 21H
CALL DELAY
JMP START
7/3/2020 Amit Kumer Podder 8
Subroutine: Delay
Label Mnemonics T-States
Opcode Operand
Delay MVI D,FFH 7
LOOP1 NOP 4
NOP 4
NOP 4
NOP 4
NOP 4
MVI E,FFH 7
LOOP2 NOP 4
NOP 4
NOP 4
NOP 4
NOP 4
DCR E 4
JNZ LOOP2 7/10
DCR D 4
JNZ LOOP1 7/10
RET 10
7/3/2020 Amit Kumer Podder 9
Delay Calculation
Delays
• Each instruction passes through different combinations of
Fetch, Memory Read, and Memory Write cycles.
• Knowing the combinations of cycles, one can calculate how
long such an instruction would require to complete.
• The table in Appendix F of the book contains a column with
the title B/M/T. – B for Number of Bytes – M for Number of
Machine Cycles – T for Number of T-State.
7/3/2020 Amit Kumer Podder 10
Cycles and States
• From the above discussion, we can define terms that will become
handy later on:
• T- State: One subdivision of an operation. A T-state lasts for one
clock period.
• An instruction’s execution length is usually measured in a
number of T-states. (clock cycles).
• Machine Cycle: The time required to complete one operation of
accessing memory, I/O, or acknowledging an external request.
• This cycle may consist of 3 to 6 T-states.
• Instruction Cycle: The time required to complete the execution of
an instruction.
• In the 8085, an instruction cycle may consist of 1 to 6 machine
cycles.
7/3/2020 Amit Kumer Podder 11
Contd.
• Knowing how many T-States an instruction requires, and
keeping in mind that a T-State is one clock cycle long, we
can calculate the time using the following formula: Delay =
No. of T-States / Frequency
• For example a “MVI” instruction uses 7 T-States. Therefore,
if the Microprocessor is running at 2 MHz, the instruction
would require 3.5 µSeconds to complete.
7/3/2020 Amit Kumer Podder 12
• We can use a loop to produce a certain amount of time delay
in a program.
• The following is an example of a delay loop:
MVI C, FFH 7 T-States
LOOP DCR C 4 T-States
JNZ LOOP 10/7 T-States
• The first instruction initializes the loop counter and is
executed only once requiring only 7 T-States.
• The following two instructions form a loop that requires 14
T-States to execute and is repeated 255 times until C
becomes 0.
Contd.
7/3/2020 Amit Kumer Podder 13
• We need to keep in mind though that in the last iteration
of the loop, the JNZ instruction will fail and require
only 7 T-States rather than the 10.
• Therefore, we must deduct 3 T-States from the total
delay to get an accurate delay calculation.
• To calculate the delay, we use the following formula:
Tdelay = TO + TL – Tdelay
= total delay – TO
= delay outside the loop – TL
= delay of the loop
• TO is the sum of all delays outside the loop.
Contd.
7/3/2020 Amit Kumer Podder 14
Using these formulas, we can calculate the time delay
for the previous example:
TO = 7 T-States – Delay of the MVI instruction
TL = (14 X 255) - 3
= 3567 T-States
14 T-States for the 2 instructions repeated 255 times
(FF16 = 25510) reduced by the 3 T-States for the
final JNZ.
Contd.
7/3/2020 Amit Kumer Podder 15
Now,
Do The Experiment
7/3/2020 Amit Kumer Podder 16

More Related Content

What's hot

Microprocessor vs. microcontroller
Microprocessor vs. microcontrollerMicroprocessor vs. microcontroller
Microprocessor vs. microcontrolleraviban
 
Design challenges in embedded systems
Design challenges in embedded systemsDesign challenges in embedded systems
Design challenges in embedded systemsmahalakshmimalini
 
PPT on 8085 Microprocessor
PPT on 8085 Microprocessor  PPT on 8085 Microprocessor
PPT on 8085 Microprocessor DebrajJana4
 
Simple Automatic Water Level Controller
Simple Automatic Water Level ControllerSimple Automatic Water Level Controller
Simple Automatic Water Level Controllerselvalakshmi24
 
8085 Architecture & Memory Interfacing1
8085 Architecture & Memory Interfacing18085 Architecture & Memory Interfacing1
8085 Architecture & Memory Interfacing1techbed
 
Timer And Counter in 8051 Microcontroller
Timer And Counter in 8051 MicrocontrollerTimer And Counter in 8051 Microcontroller
Timer And Counter in 8051 MicrocontrollerJay Makwana
 
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
 
An application of 8085 register interfacing with LED
An application  of 8085 register interfacing with LEDAn application  of 8085 register interfacing with LED
An application of 8085 register interfacing with LEDTaha Malampatti
 
Automatic temperature control
Automatic temperature control Automatic temperature control
Automatic temperature control RANJAN KUMAR
 
8096 microcontrollers notes
8096 microcontrollers notes8096 microcontrollers notes
8096 microcontrollers notesDr.YNM
 
Architecture of 8085 microprocessor
Architecture of 8085 microprocessorArchitecture of 8085 microprocessor
Architecture of 8085 microprocessorAMAN SRIVASTAVA
 
Keypad Interfacing with 8051 Microcontroller
Keypad Interfacing with 8051 MicrocontrollerKeypad Interfacing with 8051 Microcontroller
Keypad Interfacing with 8051 MicrocontrollerSudhanshu Janwadkar
 

What's hot (20)

Microprocessor vs. microcontroller
Microprocessor vs. microcontrollerMicroprocessor vs. microcontroller
Microprocessor vs. microcontroller
 
Design challenges in embedded systems
Design challenges in embedded systemsDesign challenges in embedded systems
Design challenges in embedded systems
 
Timing diagram 8085 microprocessor
Timing diagram 8085 microprocessorTiming diagram 8085 microprocessor
Timing diagram 8085 microprocessor
 
Interfacing 8255
Interfacing 8255Interfacing 8255
Interfacing 8255
 
8051 interfacing
8051 interfacing8051 interfacing
8051 interfacing
 
Interfacing LCD with 8051 Microcontroller
Interfacing LCD with 8051 MicrocontrollerInterfacing LCD with 8051 Microcontroller
Interfacing LCD with 8051 Microcontroller
 
PPT on 8085 Microprocessor
PPT on 8085 Microprocessor  PPT on 8085 Microprocessor
PPT on 8085 Microprocessor
 
Simple Automatic Water Level Controller
Simple Automatic Water Level ControllerSimple Automatic Water Level Controller
Simple Automatic Water Level Controller
 
8085 Architecture & Memory Interfacing1
8085 Architecture & Memory Interfacing18085 Architecture & Memory Interfacing1
8085 Architecture & Memory Interfacing1
 
Timer And Counter in 8051 Microcontroller
Timer And Counter in 8051 MicrocontrollerTimer And Counter in 8051 Microcontroller
Timer And Counter in 8051 Microcontroller
 
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
 
An application of 8085 register interfacing with LED
An application  of 8085 register interfacing with LEDAn application  of 8085 register interfacing with LED
An application of 8085 register interfacing with LED
 
Automatic temperature control
Automatic temperature control Automatic temperature control
Automatic temperature control
 
8251 USART
8251 USART8251 USART
8251 USART
 
8096 microcontrollers notes
8096 microcontrollers notes8096 microcontrollers notes
8096 microcontrollers notes
 
Architecture of 8085 microprocessor
Architecture of 8085 microprocessorArchitecture of 8085 microprocessor
Architecture of 8085 microprocessor
 
PLC LADDER DIAGRAM
PLC LADDER DIAGRAMPLC LADDER DIAGRAM
PLC LADDER DIAGRAM
 
ARM Processors
ARM ProcessorsARM Processors
ARM Processors
 
Memory interfacing of microprocessor 8085
Memory interfacing of microprocessor 8085Memory interfacing of microprocessor 8085
Memory interfacing of microprocessor 8085
 
Keypad Interfacing with 8051 Microcontroller
Keypad Interfacing with 8051 MicrocontrollerKeypad Interfacing with 8051 Microcontroller
Keypad Interfacing with 8051 Microcontroller
 

Similar to Traffic Light Controller Using 8255 PPI

8085 Microprocessor Programming and Instruction set
8085 Microprocessor Programming and Instruction set8085 Microprocessor Programming and Instruction set
8085 Microprocessor Programming and Instruction setAmit Kumer Podder
 
Unit 1 8085 Timing diagram - lecture 5b
Unit 1  8085 Timing diagram - lecture 5bUnit 1  8085 Timing diagram - lecture 5b
Unit 1 8085 Timing diagram - lecture 5bDickson Nkongo
 
8254 Programmable Interval Timer
8254 Programmable Interval Timer8254 Programmable Interval Timer
8254 Programmable Interval TimerAmit Kumer Podder
 
132kV PIPAR CITY GSS - RTU Accessories Pre-SAT Procedure (1).docx
132kV PIPAR CITY  GSS - RTU  Accessories Pre-SAT Procedure (1).docx132kV PIPAR CITY  GSS - RTU  Accessories Pre-SAT Procedure (1).docx
132kV PIPAR CITY GSS - RTU Accessories Pre-SAT Procedure (1).docxAniketSingh198707
 
Caterpillar engine speed timing sensor circuit test
Caterpillar engine speed timing sensor circuit  testCaterpillar engine speed timing sensor circuit  test
Caterpillar engine speed timing sensor circuit testnoelsalazar
 
Design and Implementation of a Robotic Vehicle With Real-Time Video Feedback ...
Design and Implementation of a Robotic Vehicle With Real-Time Video Feedback ...Design and Implementation of a Robotic Vehicle With Real-Time Video Feedback ...
Design and Implementation of a Robotic Vehicle With Real-Time Video Feedback ...Aditya Kumar Tripathy
 
MODULE TITLE PROGRAMMABLE LOGIC CONTROLLERSTOPIC TITLE.docx
MODULE TITLE    PROGRAMMABLE LOGIC CONTROLLERSTOPIC TITLE.docxMODULE TITLE    PROGRAMMABLE LOGIC CONTROLLERSTOPIC TITLE.docx
MODULE TITLE PROGRAMMABLE LOGIC CONTROLLERSTOPIC TITLE.docxroushhsiu
 
Jcb 8052 midi excavator service repair manual sn802000 803999
Jcb 8052 midi excavator service repair manual sn802000 803999Jcb 8052 midi excavator service repair manual sn802000 803999
Jcb 8052 midi excavator service repair manual sn802000 803999jfjnse jmfkdm
 
Jcb 8052 midi excavator service repair manual sn1178000 onwards
Jcb 8052 midi excavator service repair manual sn1178000 onwardsJcb 8052 midi excavator service repair manual sn1178000 onwards
Jcb 8052 midi excavator service repair manual sn1178000 onwardsjsnef kioui
 
JCB 8052 MIDI EXCAVATOR Service Repair Manual SN802000-803999
JCB 8052 MIDI EXCAVATOR Service Repair Manual SN802000-803999JCB 8052 MIDI EXCAVATOR Service Repair Manual SN802000-803999
JCB 8052 MIDI EXCAVATOR Service Repair Manual SN802000-803999jkdjksmde
 
presentation about CCTV concepts and installation
presentation about CCTV  concepts and installationpresentation about CCTV  concepts and installation
presentation about CCTV concepts and installationawad almekawy
 
Timing Diagram.pptx
Timing Diagram.pptxTiming Diagram.pptx
Timing Diagram.pptxISMT College
 
Jcb 8085 midi excavator service repair manual
Jcb 8085 midi excavator service repair manualJcb 8085 midi excavator service repair manual
Jcb 8085 midi excavator service repair manualfjjskedmmemm
 
Jcb 8030 z mini excavator service repair manual sn 1228500 onwards
Jcb 8030 z mini excavator service repair manual sn 1228500 onwardsJcb 8030 z mini excavator service repair manual sn 1228500 onwards
Jcb 8030 z mini excavator service repair manual sn 1228500 onwardsjkmsedopl
 
Jcb 8035 z mini excavator service repair manual sn 1230500 onwards
Jcb 8035 z mini excavator service repair manual sn 1230500 onwardsJcb 8035 z mini excavator service repair manual sn 1230500 onwards
Jcb 8035 z mini excavator service repair manual sn 1230500 onwardsjkmsedopl
 
Mini cement plant using plc published in national conference on materials, de...
Mini cement plant using plc published in national conference on materials, de...Mini cement plant using plc published in national conference on materials, de...
Mini cement plant using plc published in national conference on materials, de...Sushil Kundu
 

Similar to Traffic Light Controller Using 8255 PPI (20)

8085 Microprocessor Programming and Instruction set
8085 Microprocessor Programming and Instruction set8085 Microprocessor Programming and Instruction set
8085 Microprocessor Programming and Instruction set
 
Unit 1 8085 Timing diagram - lecture 5b
Unit 1  8085 Timing diagram - lecture 5bUnit 1  8085 Timing diagram - lecture 5b
Unit 1 8085 Timing diagram - lecture 5b
 
8254 Programmable Interval Timer
8254 Programmable Interval Timer8254 Programmable Interval Timer
8254 Programmable Interval Timer
 
132kV PIPAR CITY GSS - RTU Accessories Pre-SAT Procedure (1).docx
132kV PIPAR CITY  GSS - RTU  Accessories Pre-SAT Procedure (1).docx132kV PIPAR CITY  GSS - RTU  Accessories Pre-SAT Procedure (1).docx
132kV PIPAR CITY GSS - RTU Accessories Pre-SAT Procedure (1).docx
 
Caterpillar engine speed timing sensor circuit test
Caterpillar engine speed timing sensor circuit  testCaterpillar engine speed timing sensor circuit  test
Caterpillar engine speed timing sensor circuit test
 
Design and Implementation of a Robotic Vehicle With Real-Time Video Feedback ...
Design and Implementation of a Robotic Vehicle With Real-Time Video Feedback ...Design and Implementation of a Robotic Vehicle With Real-Time Video Feedback ...
Design and Implementation of a Robotic Vehicle With Real-Time Video Feedback ...
 
MODULE TITLE PROGRAMMABLE LOGIC CONTROLLERSTOPIC TITLE.docx
MODULE TITLE    PROGRAMMABLE LOGIC CONTROLLERSTOPIC TITLE.docxMODULE TITLE    PROGRAMMABLE LOGIC CONTROLLERSTOPIC TITLE.docx
MODULE TITLE PROGRAMMABLE LOGIC CONTROLLERSTOPIC TITLE.docx
 
Unit-III.pptx
Unit-III.pptxUnit-III.pptx
Unit-III.pptx
 
Jcb 8052 midi excavator service repair manual sn802000 803999
Jcb 8052 midi excavator service repair manual sn802000 803999Jcb 8052 midi excavator service repair manual sn802000 803999
Jcb 8052 midi excavator service repair manual sn802000 803999
 
Jcb 8052 midi excavator service repair manual sn1178000 onwards
Jcb 8052 midi excavator service repair manual sn1178000 onwardsJcb 8052 midi excavator service repair manual sn1178000 onwards
Jcb 8052 midi excavator service repair manual sn1178000 onwards
 
JCB 8052 MIDI EXCAVATOR Service Repair Manual SN802000-803999
JCB 8052 MIDI EXCAVATOR Service Repair Manual SN802000-803999JCB 8052 MIDI EXCAVATOR Service Repair Manual SN802000-803999
JCB 8052 MIDI EXCAVATOR Service Repair Manual SN802000-803999
 
presentation about CCTV concepts and installation
presentation about CCTV  concepts and installationpresentation about CCTV  concepts and installation
presentation about CCTV concepts and installation
 
mama.pdf
mama.pdfmama.pdf
mama.pdf
 
Timing Diagram.pptx
Timing Diagram.pptxTiming Diagram.pptx
Timing Diagram.pptx
 
Analog to Digital Converter
Analog to Digital ConverterAnalog to Digital Converter
Analog to Digital Converter
 
Jcb 8085 midi excavator service repair manual
Jcb 8085 midi excavator service repair manualJcb 8085 midi excavator service repair manual
Jcb 8085 midi excavator service repair manual
 
Jcb 8030 z mini excavator service repair manual sn 1228500 onwards
Jcb 8030 z mini excavator service repair manual sn 1228500 onwardsJcb 8030 z mini excavator service repair manual sn 1228500 onwards
Jcb 8030 z mini excavator service repair manual sn 1228500 onwards
 
Jcb 8035 z mini excavator service repair manual sn 1230500 onwards
Jcb 8035 z mini excavator service repair manual sn 1230500 onwardsJcb 8035 z mini excavator service repair manual sn 1230500 onwards
Jcb 8035 z mini excavator service repair manual sn 1230500 onwards
 
Lecture 2 timers, pwm, state machine IN PIC
Lecture 2   timers, pwm, state machine IN PIC Lecture 2   timers, pwm, state machine IN PIC
Lecture 2 timers, pwm, state machine IN PIC
 
Mini cement plant using plc published in national conference on materials, de...
Mini cement plant using plc published in national conference on materials, de...Mini cement plant using plc published in national conference on materials, de...
Mini cement plant using plc published in national conference on materials, de...
 

More from Amit Kumer Podder

Familiarization of electronic equipment
Familiarization of electronic equipmentFamiliarization of electronic equipment
Familiarization of electronic equipmentAmit Kumer Podder
 
Arduino Programming on Motor Control
Arduino Programming on Motor ControlArduino Programming on Motor Control
Arduino Programming on Motor ControlAmit Kumer Podder
 
Arduino Programming Familiarization
Arduino Programming FamiliarizationArduino Programming Familiarization
Arduino Programming FamiliarizationAmit Kumer Podder
 
Dot Matrix LED Interfacing using 8255 PPI
Dot Matrix LED Interfacing using 8255 PPIDot Matrix LED Interfacing using 8255 PPI
Dot Matrix LED Interfacing using 8255 PPIAmit Kumer Podder
 
8086 Assembly Language and Serial Monitor Operation of 8086 Trainer Kit
8086 Assembly Language and Serial Monitor Operation of 8086 Trainer Kit8086 Assembly Language and Serial Monitor Operation of 8086 Trainer Kit
8086 Assembly Language and Serial Monitor Operation of 8086 Trainer KitAmit Kumer Podder
 
8086 Micro-processor and MDA 8086 Trainer Kit
8086 Micro-processor and MDA 8086 Trainer Kit8086 Micro-processor and MDA 8086 Trainer Kit
8086 Micro-processor and MDA 8086 Trainer KitAmit Kumer Podder
 
8255 Programmble Peripheral Interface
8255 Programmble Peripheral Interface8255 Programmble Peripheral Interface
8255 Programmble Peripheral InterfaceAmit Kumer Podder
 
Micro-processor, Micro-controller and Peripherals
Micro-processor, Micro-controller and PeripheralsMicro-processor, Micro-controller and Peripherals
Micro-processor, Micro-controller and PeripheralsAmit Kumer Podder
 
Lecture on wire splicing and termination
Lecture on wire splicing and terminationLecture on wire splicing and termination
Lecture on wire splicing and terminationAmit Kumer Podder
 

More from Amit Kumer Podder (11)

Power Amplifier
Power AmplifierPower Amplifier
Power Amplifier
 
Familiarization of electronic equipment
Familiarization of electronic equipmentFamiliarization of electronic equipment
Familiarization of electronic equipment
 
Transducer
Transducer Transducer
Transducer
 
Arduino Programming on Motor Control
Arduino Programming on Motor ControlArduino Programming on Motor Control
Arduino Programming on Motor Control
 
Arduino Programming Familiarization
Arduino Programming FamiliarizationArduino Programming Familiarization
Arduino Programming Familiarization
 
Dot Matrix LED Interfacing using 8255 PPI
Dot Matrix LED Interfacing using 8255 PPIDot Matrix LED Interfacing using 8255 PPI
Dot Matrix LED Interfacing using 8255 PPI
 
8086 Assembly Language and Serial Monitor Operation of 8086 Trainer Kit
8086 Assembly Language and Serial Monitor Operation of 8086 Trainer Kit8086 Assembly Language and Serial Monitor Operation of 8086 Trainer Kit
8086 Assembly Language and Serial Monitor Operation of 8086 Trainer Kit
 
8086 Micro-processor and MDA 8086 Trainer Kit
8086 Micro-processor and MDA 8086 Trainer Kit8086 Micro-processor and MDA 8086 Trainer Kit
8086 Micro-processor and MDA 8086 Trainer Kit
 
8255 Programmble Peripheral Interface
8255 Programmble Peripheral Interface8255 Programmble Peripheral Interface
8255 Programmble Peripheral Interface
 
Micro-processor, Micro-controller and Peripherals
Micro-processor, Micro-controller and PeripheralsMicro-processor, Micro-controller and Peripherals
Micro-processor, Micro-controller and Peripherals
 
Lecture on wire splicing and termination
Lecture on wire splicing and terminationLecture on wire splicing and termination
Lecture on wire splicing and termination
 

Recently uploaded

MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAbhinavSharma374939
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
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
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 

Recently uploaded (20)

MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog Converter
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
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
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
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
 

Traffic Light Controller Using 8255 PPI

  • 1. Department of Electrical and Electronic Engineering Khulna University of Engineering & Technology Khulna-9203 Course code : EE 3214 Sessional on Microprocessors, Micro-controllers and Peripherals Presented By Amit Kumer Podder Experiment No. 04
  • 2. Design and implementation of traffic light controller using 8255 PPI in 8085 microprocessor environment Experiment Name 7/3/2020 Amit Kumer Podder 2
  • 3. G3 Y3 R3 G4 Y4 R4G2 Y2 R2 G1 Y1 R1Road 1 Road 3 Road 4 Road 2 Traffic Signal Flow diagram Road 3 & Road 4 are allowing Traffic 7/3/2020 Amit Kumer Podder 3
  • 4. G3 Y3 R3 G4 Y4 R4G2 Y2 R2 G1 Y1 R1Road 1 Road 3 Road 4 Road 2 Traffic Signal Flow diagram Road 3 and Road 4 are allowing Traffic but in delay mode 7/3/2020 Amit Kumer Podder 4
  • 5. G3 Y3 R3 G4 Y4 R4G2 Y2 R2 G1 Y1 R1Road 1 Road 3 Road 4 Road 2 Traffic Signal Flow diagram Road 1 & Road 2 are allowing Traffic 7/3/2020 Amit Kumer Podder 5
  • 6. G3 Y3 R3 G4 Y4 R4G2 Y2 R2 G1 Y1 R1Road 1 Road 3 Road 4 Road 2 Traffic Signal Flow diagram Road 1 and Road 2 are allowing Traffic but in delay mode 7/3/2020 Amit Kumer Podder 6
  • 7. Traffic signal generating coding table PA7 PA6 PA5 PA4 PA3 PA2 PA1 PA0 PB7 PB6 PB5 PB4 PB3 PB2 PB1 PB0 0 0 G2 Y2 R2 G1 Y1 R1 0 0 G4 Y4 R4 G3 Y3 R3 R1 R2 G3 G4 0 0 0 0 1 0 0 1 = 09H 0 0 1 0 0 1 0 0 =24H Y1 Y2 Y3 Y4 0 0 0 1 0 0 1 0 = 12H 0 0 0 1 0 0 1 0 = 12H R3 R4 G1 G2 0 0 1 0 0 1 0 0 = 24H 0 0 0 0 1 0 0 1 = 09H Y1 Y2 Y3 Y4 0 0 0 0 1 0 1 0 = 12H 0 0 0 1 0 0 1 0 = 12H 7/3/2020 Amit Kumer Podder 7
  • 8. Main Program in 8085: Traffic signal Control Label Mnemonics Opcode Operand Start MVI A,80H OUT 23H MVI A,09H OUT 20H MVI A,24H OUT 21H CALL DELAY MVI A,12H OUT 20H MVI A,12H OUT 21H CALL DELAY MVI A,24H OUT 20H MVI A,09H OUT 21H CALL DELAY MVI A,12H OUT 20H MVI A,12H OUT 21H CALL DELAY JMP START 7/3/2020 Amit Kumer Podder 8
  • 9. Subroutine: Delay Label Mnemonics T-States Opcode Operand Delay MVI D,FFH 7 LOOP1 NOP 4 NOP 4 NOP 4 NOP 4 NOP 4 MVI E,FFH 7 LOOP2 NOP 4 NOP 4 NOP 4 NOP 4 NOP 4 DCR E 4 JNZ LOOP2 7/10 DCR D 4 JNZ LOOP1 7/10 RET 10 7/3/2020 Amit Kumer Podder 9
  • 10. Delay Calculation Delays • Each instruction passes through different combinations of Fetch, Memory Read, and Memory Write cycles. • Knowing the combinations of cycles, one can calculate how long such an instruction would require to complete. • The table in Appendix F of the book contains a column with the title B/M/T. – B for Number of Bytes – M for Number of Machine Cycles – T for Number of T-State. 7/3/2020 Amit Kumer Podder 10
  • 11. Cycles and States • From the above discussion, we can define terms that will become handy later on: • T- State: One subdivision of an operation. A T-state lasts for one clock period. • An instruction’s execution length is usually measured in a number of T-states. (clock cycles). • Machine Cycle: The time required to complete one operation of accessing memory, I/O, or acknowledging an external request. • This cycle may consist of 3 to 6 T-states. • Instruction Cycle: The time required to complete the execution of an instruction. • In the 8085, an instruction cycle may consist of 1 to 6 machine cycles. 7/3/2020 Amit Kumer Podder 11
  • 12. Contd. • Knowing how many T-States an instruction requires, and keeping in mind that a T-State is one clock cycle long, we can calculate the time using the following formula: Delay = No. of T-States / Frequency • For example a “MVI” instruction uses 7 T-States. Therefore, if the Microprocessor is running at 2 MHz, the instruction would require 3.5 µSeconds to complete. 7/3/2020 Amit Kumer Podder 12
  • 13. • We can use a loop to produce a certain amount of time delay in a program. • The following is an example of a delay loop: MVI C, FFH 7 T-States LOOP DCR C 4 T-States JNZ LOOP 10/7 T-States • The first instruction initializes the loop counter and is executed only once requiring only 7 T-States. • The following two instructions form a loop that requires 14 T-States to execute and is repeated 255 times until C becomes 0. Contd. 7/3/2020 Amit Kumer Podder 13
  • 14. • We need to keep in mind though that in the last iteration of the loop, the JNZ instruction will fail and require only 7 T-States rather than the 10. • Therefore, we must deduct 3 T-States from the total delay to get an accurate delay calculation. • To calculate the delay, we use the following formula: Tdelay = TO + TL – Tdelay = total delay – TO = delay outside the loop – TL = delay of the loop • TO is the sum of all delays outside the loop. Contd. 7/3/2020 Amit Kumer Podder 14
  • 15. Using these formulas, we can calculate the time delay for the previous example: TO = 7 T-States – Delay of the MVI instruction TL = (14 X 255) - 3 = 3567 T-States 14 T-States for the 2 instructions repeated 255 times (FF16 = 25510) reduced by the 3 T-States for the final JNZ. Contd. 7/3/2020 Amit Kumer Podder 15
  • 16. Now, Do The Experiment 7/3/2020 Amit Kumer Podder 16