SlideShare a Scribd company logo
Date: 28/11/2013

Al-Azhar University-Gaza
Faculty of Engineering & Information Technology
Mechatronices engineering
Microprocessors & Interfacing
(ITCE 3306)
LAB NO.5
Status port
Prepared By:
Ronza sameer Abu jayyab
No. 20111511
Submitted To:
Eng. Mahmoud I. Hasanain
First semester
2013/2014
 Introduction:
We make interfacing with status parallel port to connect our device with PC and
control it by our code design.

 Objective:
After this lab we can answer how i can deal with status port and at which
control circuit I can use it.
We will deal with status port with new IC called 74LS157.
Also we are known how we can use 74LS157 IC and how we can input
data for it and for status port to communicate us with computer and tell
it to do a specific test/task.

 Background:
 Status port:
The PC Parallel Port is commonly used to create an interface between a
computer and an external piece of hardware. Found on the back of a PC,
the parallel port is a D-Type 25 Pin Female Connector. The parallel port is
capable of receiving 9 bits of data or transmitting 12 bits of data, at any
given time.

Figure 1: Parallel Port Connection Pins

Within these lines there are three groups of pins known as the Data Port, Status
Port, and Control Port. The Data Port is composed of 8 lines Data 0 – Data 7 (Pins
2 – 9) that allow data to be transmitted or received to/from an external device.
Figure 2: Data port
The Status Port is a read only port composed of 5 input lines (Pins 10, 11, 12, 13, &
15), an IRQ status register, and two reserved lines.

Figure 3: status port
the Control Port is composed of 8 lines that are used to control the sending and
receiving data. Most importantly is the nStrobe line, which indicates that data is
ready to be sent/received.

Figure 4:control port
When writing/reading from the PC Parallel Port it is important to ensure the proper
address is being used. Normally the PC Parallel Port is given one of three commonly
used base addresses. However, depending on what external devices are active it is
easy to confuse the correct address.

Figure 5: port address
One of the effective way of reading data from an external device is know as Nibble
Mode. Nibble Mode requires the use of a Quad 2 line to 1 line multiplexer.
Although Nibble Mode reads the same amount of information as a bidirectional
connection or the previous method, it is slower and requires the use of an external
IC.

The eight data lines of the external device are connected to the A & B input lines of
the multiplexer. The outputs of the multiplexer are connected to lines on the
Control and Status Ports, as shown below:

Figure 6: Pin Connections for Nibble Mode
Once again, Nibble Mode requires the use of the proper C code to ensure the data is
properly transferred.
This time the LS Nibble read first, followed by the MS nibble. Finally, the LS Nibble is
shifted.
 74LS157 multiplexer:
General purpose of multiplexer:
1. A device to select from a number of input and put that
selected input on an output line.
2. Input are usually called data lines.
3. There must be enough select to unambiguously identify
the unique data line. These select are usually called
address lines.

 Experiments:
Control circuit:

Figure 7: Diagram of the Control circuit
 Experiment no.1 :
Light leds by status port.

Figure 8: experiment no.1.
Control code:
Private Sub Form_Load()
sp.address = 889
End Sub
Private Sub Form_Load()
NTport1.address = 888
End Sub
Private Sub Form_Load()
cp.address = 390
End Sub
Private Sub Timer1_Timer()
cp.Value = 1
sp.address = 889
S3 = (sp.Value And 8) / 8
NTport1.address = 888
If S3 = 1 Then
NTport1.Value = 1
Else: NTport1.Value = 0
Comment:
The circuit shown at Figure_8 _used to interface a set of 1 LED and
one switch connected to the PC using the parallel printer port.
 Experiment no.2:
Scrolling with one status pin:
Control code:
Dim i As Integer
Private Sub Timer1_Timer()
cp.address = &H37A
cp.Value = 1
sp.address = 889
S3 = (sp.Value And 8) / 8
dp.address = 888
If S3 = 1 Then
Timer1.Enabled = True
Else
Timer1.Enabled = False
End Sub
Private Sub Timer2_Timer()
dp.Value = 2 ^ i
i=i+1
If i> 7 Then i= 0
End If
End Sub
Comment:
1. The above visual basic code creates a wave on the LED (scrolling) connected
to the output port 378h according to the status ,the switches connected to the
input port 379h.
2. At timer 1 : initialize the data ,status ,control ports addresses .
At Timer 2: scrolling the LEDs.
 Experiment no.3:
Scrolling with more one status pin:

Figure 9: experiment no.3.
Control code:
Dim i, x1, S345, S7, result As Integer
Private Sub Timer1_Timer()
Control.Value = 1
x1 = Status.Value
S345 = (x1 And &H38) / 2 ^ 3
S7 = ((Not x1) And 2 ^ 7) / 2 ^ 4
result = S345 + S7
End Sub
Private Sub Timer1_Timer()
If S345 = 40 Then
Timer2.Enabled = True
Timer3.Enabled = False
Timer2.Interval = 100
End If
If S345 = 56 Then
Timer2.Enabled = False
Timer3.Enabled = True
Timer2.Interval = 50
End If
Private Sub Timer2_Timer()
dp.Value = 2 ^ i
i=i+1
If i> 7 Then i = 0
End If
End Sub
Private Sub Timer3_Timer()
dp.Value = 2 ^ i
i=i-1
If i< 0 Then i = 7
End If
End Sub
Comment:
In the previous code we just use s3 and make for it shifting by
divide it in 2^3.
In this code if we want to use more than one status pin (s3,s4 &
s5).
Instead of define every status pin alone we'll define one variable
for all these pins and do shifting for this variable .
Also in this code we'll define three timer, the first one for define
the status pin, the second one to do scrolling from right to left,
and the last one for do scrolling from left to right.

 Conclusion:
At this report we clarified a simple model for using status port ,and showed the
communication between it and the PC with external device.

 Reference:
1. 74LS157 IC:
http://www.google.ps/url?sa=t&rct=j&q=&esrc=s&source=web&cd=14&ved=0CIUB
EBYwDQ&url=http%3A%2F%2Fwww.niu.edu%2F~mfortner%2Flabelec%2Flect%2FLe
1_103.pdf&ei=wCCWUv2LEcSB4gTUzoD4DA&usg=AFQjCNHLPaJW7HhVB1JVzOu3oTXYnCPkQ&bvm=bv.57155469,d.bGQ

2. Status port:
http://coecsl.ece.illinois.edu/ge423/sensorprojects/Parallel%20Port%20Interfacing.
doc

More Related Content

What's hot

Digital logic-formula-notes-final-1
Digital logic-formula-notes-final-1Digital logic-formula-notes-final-1
Digital logic-formula-notes-final-1
Kshitij Singh
 
Combinational Circuits
Combinational CircuitsCombinational Circuits
Combinational Circuits
Dilum Bandara
 
C programming session8
C programming  session8C programming  session8
C programming session8
Keroles karam khalil
 
Digital electronics nandhini kusuma
Digital electronics nandhini kusumaDigital electronics nandhini kusuma
Digital electronics nandhini kusuma
kusuma11
 
Digital Logic Rcs
Digital Logic RcsDigital Logic Rcs
Digital Logic Rcs
Ramzi Alqrainy
 
Verilog Lecture2 thhts
Verilog Lecture2 thhtsVerilog Lecture2 thhts
Verilog Lecture2 thhts
Béo Tú
 
0.my book draft chap 1
0.my book draft chap 10.my book draft chap 1
0.my book draft chap 1
manhduc1811
 
Microcontroller part 6_v1
Microcontroller part 6_v1Microcontroller part 6_v1
Microcontroller part 6_v1
Keroles karam khalil
 
Lecture 3
Lecture 3Lecture 3
Lecture 3
RahulRathi94
 
Arduino Functions
Arduino FunctionsArduino Functions
Arduino Functions
mahalakshmimalini
 
Combinational Logic with MSI and LSI
Combinational Logic with MSI and LSICombinational Logic with MSI and LSI
Combinational Logic with MSI and LSI
Sikder Tahsin Al-Amin
 
C programming part2
C programming part2C programming part2
C programming part2
Keroles karam khalil
 
Fpga 07-port-rules-gate-delay-data-flow-carry-look-ahead-adder
Fpga 07-port-rules-gate-delay-data-flow-carry-look-ahead-adderFpga 07-port-rules-gate-delay-data-flow-carry-look-ahead-adder
Fpga 07-port-rules-gate-delay-data-flow-carry-look-ahead-adder
Malik Tauqir Hasan
 
Encoders and decoders
Encoders and decodersEncoders and decoders
Encoders and decoders
Jher Carlson Atasan
 
Combinational circuits
Combinational circuitsCombinational circuits
Combinational circuits
Nabarun Chakraborty
 
Data link layar
Data link layarData link layar
Data link layar
jaysanshrestha
 
Optimized Floating-point Complex number multiplier on FPGA
Optimized Floating-point Complex number multiplier on FPGAOptimized Floating-point Complex number multiplier on FPGA
Optimized Floating-point Complex number multiplier on FPGA
Dr. Pushpa Kotipalli
 

What's hot (17)

Digital logic-formula-notes-final-1
Digital logic-formula-notes-final-1Digital logic-formula-notes-final-1
Digital logic-formula-notes-final-1
 
Combinational Circuits
Combinational CircuitsCombinational Circuits
Combinational Circuits
 
C programming session8
C programming  session8C programming  session8
C programming session8
 
Digital electronics nandhini kusuma
Digital electronics nandhini kusumaDigital electronics nandhini kusuma
Digital electronics nandhini kusuma
 
Digital Logic Rcs
Digital Logic RcsDigital Logic Rcs
Digital Logic Rcs
 
Verilog Lecture2 thhts
Verilog Lecture2 thhtsVerilog Lecture2 thhts
Verilog Lecture2 thhts
 
0.my book draft chap 1
0.my book draft chap 10.my book draft chap 1
0.my book draft chap 1
 
Microcontroller part 6_v1
Microcontroller part 6_v1Microcontroller part 6_v1
Microcontroller part 6_v1
 
Lecture 3
Lecture 3Lecture 3
Lecture 3
 
Arduino Functions
Arduino FunctionsArduino Functions
Arduino Functions
 
Combinational Logic with MSI and LSI
Combinational Logic with MSI and LSICombinational Logic with MSI and LSI
Combinational Logic with MSI and LSI
 
C programming part2
C programming part2C programming part2
C programming part2
 
Fpga 07-port-rules-gate-delay-data-flow-carry-look-ahead-adder
Fpga 07-port-rules-gate-delay-data-flow-carry-look-ahead-adderFpga 07-port-rules-gate-delay-data-flow-carry-look-ahead-adder
Fpga 07-port-rules-gate-delay-data-flow-carry-look-ahead-adder
 
Encoders and decoders
Encoders and decodersEncoders and decoders
Encoders and decoders
 
Combinational circuits
Combinational circuitsCombinational circuits
Combinational circuits
 
Data link layar
Data link layarData link layar
Data link layar
 
Optimized Floating-point Complex number multiplier on FPGA
Optimized Floating-point Complex number multiplier on FPGAOptimized Floating-point Complex number multiplier on FPGA
Optimized Floating-point Complex number multiplier on FPGA
 

Similar to Report no.5(microprocessor)

Switch Control and Time Delay - Keypad
Switch Control and Time Delay - KeypadSwitch Control and Time Delay - Keypad
Switch Control and Time Delay - Keypad
Ariel Tonatiuh Espindola
 
Chapter5
Chapter5Chapter5
Chapter5
Bisrat Girma
 
Design of dual master i2 c bus controller
Design of dual master i2 c bus controllerDesign of dual master i2 c bus controller
Design of dual master i2 c bus controller
eSAT Publishing House
 
Microprocessor & Interfacing (Part-2) By Er. Swapnil V. Kaware
Microprocessor & Interfacing (Part-2) By Er. Swapnil V. KawareMicroprocessor & Interfacing (Part-2) By Er. Swapnil V. Kaware
Microprocessor & Interfacing (Part-2) By Er. Swapnil V. Kaware
Prof. Swapnil V. Kaware
 
Anup2
Anup2Anup2
Anup2
David Gyle
 
Microprocessor and microcontroller
Microprocessor and microcontrollerMicroprocessor and microcontroller
Microprocessor and microcontroller
Ravinder Singla
 
Fpga implementation of multi protocol data
Fpga implementation of multi protocol dataFpga implementation of multi protocol data
Fpga implementation of multi protocol data
eSAT Publishing House
 
Pipeline stalling in vhdl
Pipeline stalling in vhdlPipeline stalling in vhdl
Pipeline stalling in vhdl
Sai Malleswar
 
DLT645 protocol english version
DLT645 protocol english versionDLT645 protocol english version
DLT645 protocol english version
Ricky Yang
 
Bidirect visitor counter
Bidirect visitor counterBidirect visitor counter
Bidirect visitor counter
Electric&elctronics&engineeering
 
Analog to Digital Converter
Analog to Digital ConverterAnalog to Digital Converter
Analog to Digital Converter
Ariel Tonatiuh Espindola
 
Fpga applications using hdl
Fpga applications using hdlFpga applications using hdl
Fpga applications using hdl
Sankarshan D
 
Pin configuration of 8085
Pin configuration of 8085Pin configuration of 8085
Pin configuration of 8085
82338476
 
Training Report on embedded Systems and Robotics
Training Report on embedded  Systems and RoboticsTraining Report on embedded  Systems and Robotics
Training Report on embedded Systems and Robotics
NIT Raipur
 
Keypad interfacing 8051 -NANOCDAC
Keypad interfacing 8051 -NANOCDACKeypad interfacing 8051 -NANOCDAC
Keypad interfacing 8051 -NANOCDAC
nanocdac
 
Assembler4
Assembler4Assembler4
Assembler4
Omar Sanchez
 
Starting with Arduino
Starting with Arduino Starting with Arduino
Starting with Arduino
MajdyShamasneh
 
Ju2416921695
Ju2416921695Ju2416921695
Ju2416921695
IJERA Editor
 
project 3 full report
project 3 full reportproject 3 full report
project 3 full report
Shubham Shivhare
 
Serial Port Device Driver
Serial Port Device DriverSerial Port Device Driver
Serial Port Device Driver
Emblogic
 

Similar to Report no.5(microprocessor) (20)

Switch Control and Time Delay - Keypad
Switch Control and Time Delay - KeypadSwitch Control and Time Delay - Keypad
Switch Control and Time Delay - Keypad
 
Chapter5
Chapter5Chapter5
Chapter5
 
Design of dual master i2 c bus controller
Design of dual master i2 c bus controllerDesign of dual master i2 c bus controller
Design of dual master i2 c bus controller
 
Microprocessor & Interfacing (Part-2) By Er. Swapnil V. Kaware
Microprocessor & Interfacing (Part-2) By Er. Swapnil V. KawareMicroprocessor & Interfacing (Part-2) By Er. Swapnil V. Kaware
Microprocessor & Interfacing (Part-2) By Er. Swapnil V. Kaware
 
Anup2
Anup2Anup2
Anup2
 
Microprocessor and microcontroller
Microprocessor and microcontrollerMicroprocessor and microcontroller
Microprocessor and microcontroller
 
Fpga implementation of multi protocol data
Fpga implementation of multi protocol dataFpga implementation of multi protocol data
Fpga implementation of multi protocol data
 
Pipeline stalling in vhdl
Pipeline stalling in vhdlPipeline stalling in vhdl
Pipeline stalling in vhdl
 
DLT645 protocol english version
DLT645 protocol english versionDLT645 protocol english version
DLT645 protocol english version
 
Bidirect visitor counter
Bidirect visitor counterBidirect visitor counter
Bidirect visitor counter
 
Analog to Digital Converter
Analog to Digital ConverterAnalog to Digital Converter
Analog to Digital Converter
 
Fpga applications using hdl
Fpga applications using hdlFpga applications using hdl
Fpga applications using hdl
 
Pin configuration of 8085
Pin configuration of 8085Pin configuration of 8085
Pin configuration of 8085
 
Training Report on embedded Systems and Robotics
Training Report on embedded  Systems and RoboticsTraining Report on embedded  Systems and Robotics
Training Report on embedded Systems and Robotics
 
Keypad interfacing 8051 -NANOCDAC
Keypad interfacing 8051 -NANOCDACKeypad interfacing 8051 -NANOCDAC
Keypad interfacing 8051 -NANOCDAC
 
Assembler4
Assembler4Assembler4
Assembler4
 
Starting with Arduino
Starting with Arduino Starting with Arduino
Starting with Arduino
 
Ju2416921695
Ju2416921695Ju2416921695
Ju2416921695
 
project 3 full report
project 3 full reportproject 3 full report
project 3 full report
 
Serial Port Device Driver
Serial Port Device DriverSerial Port Device Driver
Serial Port Device Driver
 

Recently uploaded

UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
Data structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdfData structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdf
TIPNGVN2
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Vladimir Iglovikov, Ph.D.
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 

Recently uploaded (20)

UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
Data structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdfData structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdf
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 

Report no.5(microprocessor)

  • 1. Date: 28/11/2013 Al-Azhar University-Gaza Faculty of Engineering & Information Technology Mechatronices engineering Microprocessors & Interfacing (ITCE 3306) LAB NO.5 Status port Prepared By: Ronza sameer Abu jayyab No. 20111511 Submitted To: Eng. Mahmoud I. Hasanain First semester 2013/2014
  • 2.  Introduction: We make interfacing with status parallel port to connect our device with PC and control it by our code design.  Objective: After this lab we can answer how i can deal with status port and at which control circuit I can use it. We will deal with status port with new IC called 74LS157. Also we are known how we can use 74LS157 IC and how we can input data for it and for status port to communicate us with computer and tell it to do a specific test/task.  Background:  Status port: The PC Parallel Port is commonly used to create an interface between a computer and an external piece of hardware. Found on the back of a PC, the parallel port is a D-Type 25 Pin Female Connector. The parallel port is capable of receiving 9 bits of data or transmitting 12 bits of data, at any given time. Figure 1: Parallel Port Connection Pins Within these lines there are three groups of pins known as the Data Port, Status Port, and Control Port. The Data Port is composed of 8 lines Data 0 – Data 7 (Pins 2 – 9) that allow data to be transmitted or received to/from an external device.
  • 3. Figure 2: Data port The Status Port is a read only port composed of 5 input lines (Pins 10, 11, 12, 13, & 15), an IRQ status register, and two reserved lines. Figure 3: status port the Control Port is composed of 8 lines that are used to control the sending and receiving data. Most importantly is the nStrobe line, which indicates that data is ready to be sent/received. Figure 4:control port When writing/reading from the PC Parallel Port it is important to ensure the proper address is being used. Normally the PC Parallel Port is given one of three commonly
  • 4. used base addresses. However, depending on what external devices are active it is easy to confuse the correct address. Figure 5: port address One of the effective way of reading data from an external device is know as Nibble Mode. Nibble Mode requires the use of a Quad 2 line to 1 line multiplexer. Although Nibble Mode reads the same amount of information as a bidirectional connection or the previous method, it is slower and requires the use of an external IC. The eight data lines of the external device are connected to the A & B input lines of the multiplexer. The outputs of the multiplexer are connected to lines on the Control and Status Ports, as shown below: Figure 6: Pin Connections for Nibble Mode Once again, Nibble Mode requires the use of the proper C code to ensure the data is properly transferred. This time the LS Nibble read first, followed by the MS nibble. Finally, the LS Nibble is shifted.
  • 5.  74LS157 multiplexer: General purpose of multiplexer: 1. A device to select from a number of input and put that selected input on an output line. 2. Input are usually called data lines. 3. There must be enough select to unambiguously identify the unique data line. These select are usually called address lines.  Experiments: Control circuit: Figure 7: Diagram of the Control circuit  Experiment no.1 : Light leds by status port. Figure 8: experiment no.1.
  • 6. Control code: Private Sub Form_Load() sp.address = 889 End Sub Private Sub Form_Load() NTport1.address = 888 End Sub Private Sub Form_Load() cp.address = 390 End Sub Private Sub Timer1_Timer() cp.Value = 1 sp.address = 889 S3 = (sp.Value And 8) / 8 NTport1.address = 888 If S3 = 1 Then NTport1.Value = 1 Else: NTport1.Value = 0 Comment: The circuit shown at Figure_8 _used to interface a set of 1 LED and one switch connected to the PC using the parallel printer port.
  • 7.  Experiment no.2: Scrolling with one status pin: Control code: Dim i As Integer Private Sub Timer1_Timer() cp.address = &H37A cp.Value = 1 sp.address = 889 S3 = (sp.Value And 8) / 8 dp.address = 888 If S3 = 1 Then Timer1.Enabled = True Else Timer1.Enabled = False End Sub Private Sub Timer2_Timer() dp.Value = 2 ^ i i=i+1 If i> 7 Then i= 0 End If End Sub Comment: 1. The above visual basic code creates a wave on the LED (scrolling) connected to the output port 378h according to the status ,the switches connected to the input port 379h. 2. At timer 1 : initialize the data ,status ,control ports addresses . At Timer 2: scrolling the LEDs.
  • 8.  Experiment no.3: Scrolling with more one status pin: Figure 9: experiment no.3. Control code: Dim i, x1, S345, S7, result As Integer Private Sub Timer1_Timer() Control.Value = 1 x1 = Status.Value S345 = (x1 And &H38) / 2 ^ 3 S7 = ((Not x1) And 2 ^ 7) / 2 ^ 4 result = S345 + S7 End Sub Private Sub Timer1_Timer() If S345 = 40 Then Timer2.Enabled = True Timer3.Enabled = False Timer2.Interval = 100 End If If S345 = 56 Then Timer2.Enabled = False Timer3.Enabled = True Timer2.Interval = 50 End If Private Sub Timer2_Timer() dp.Value = 2 ^ i i=i+1 If i> 7 Then i = 0 End If End Sub Private Sub Timer3_Timer()
  • 9. dp.Value = 2 ^ i i=i-1 If i< 0 Then i = 7 End If End Sub Comment: In the previous code we just use s3 and make for it shifting by divide it in 2^3. In this code if we want to use more than one status pin (s3,s4 & s5). Instead of define every status pin alone we'll define one variable for all these pins and do shifting for this variable . Also in this code we'll define three timer, the first one for define the status pin, the second one to do scrolling from right to left, and the last one for do scrolling from left to right.  Conclusion: At this report we clarified a simple model for using status port ,and showed the communication between it and the PC with external device.  Reference: 1. 74LS157 IC: http://www.google.ps/url?sa=t&rct=j&q=&esrc=s&source=web&cd=14&ved=0CIUB EBYwDQ&url=http%3A%2F%2Fwww.niu.edu%2F~mfortner%2Flabelec%2Flect%2FLe 1_103.pdf&ei=wCCWUv2LEcSB4gTUzoD4DA&usg=AFQjCNHLPaJW7HhVB1JVzOu3oTXYnCPkQ&bvm=bv.57155469,d.bGQ 2. Status port: http://coecsl.ece.illinois.edu/ge423/sensorprojects/Parallel%20Port%20Interfacing. doc