SlideShare a Scribd company logo
1 of 9
Download to read offline
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-1Kshitij Singh
 
Combinational Circuits
Combinational CircuitsCombinational Circuits
Combinational CircuitsDilum Bandara
 
Digital electronics nandhini kusuma
Digital electronics nandhini kusumaDigital electronics nandhini kusuma
Digital electronics nandhini kusumakusuma11
 
Verilog Lecture2 thhts
Verilog Lecture2 thhtsVerilog Lecture2 thhts
Verilog Lecture2 thhtsBéo Tú
 
0.my book draft chap 1
0.my book draft chap 10.my book draft chap 1
0.my book draft chap 1manhduc1811
 
Combinational Logic with MSI and LSI
Combinational Logic with MSI and LSICombinational Logic with MSI and LSI
Combinational Logic with MSI and LSISikder Tahsin Al-Amin
 
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-adderMalik Tauqir Hasan
 
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 FPGADr. 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)

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 controllereSAT 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. KawareProf. Swapnil V. Kaware
 
Microprocessor and microcontroller
Microprocessor and microcontrollerMicroprocessor and microcontroller
Microprocessor and microcontrollerRavinder Singla
 
Fpga implementation of multi protocol data
Fpga implementation of multi protocol dataFpga implementation of multi protocol data
Fpga implementation of multi protocol dataeSAT Publishing House
 
Pipeline stalling in vhdl
Pipeline stalling in vhdlPipeline stalling in vhdl
Pipeline stalling in vhdlSai Malleswar
 
DLT645 protocol english version
DLT645 protocol english versionDLT645 protocol english version
DLT645 protocol english versionRicky Yang
 
Fpga applications using hdl
Fpga applications using hdlFpga applications using hdl
Fpga applications using hdlSankarshan D
 
Pin configuration of 8085
Pin configuration of 8085Pin configuration of 8085
Pin configuration of 808582338476
 
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 RoboticsNIT Raipur
 
Keypad interfacing 8051 -NANOCDAC
Keypad interfacing 8051 -NANOCDACKeypad interfacing 8051 -NANOCDAC
Keypad interfacing 8051 -NANOCDACnanocdac
 
Advantages And Disadvantages Of Microcontroller
Advantages And Disadvantages Of MicrocontrollerAdvantages And Disadvantages Of Microcontroller
Advantages And Disadvantages Of MicrocontrollerKara Liu
 
Starting with Arduino
Starting with Arduino Starting with Arduino
Starting with Arduino MajdyShamasneh
 

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
 
Advantages And Disadvantages Of Microcontroller
Advantages And Disadvantages Of MicrocontrollerAdvantages And Disadvantages Of Microcontroller
Advantages And Disadvantages Of Microcontroller
 
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
 

Recently uploaded

Monitoring Java Application Security with JDK Tools and JFR Events.pdf
Monitoring Java Application Security with JDK Tools and JFR Events.pdfMonitoring Java Application Security with JDK Tools and JFR Events.pdf
Monitoring Java Application Security with JDK Tools and JFR Events.pdfAna-Maria Mihalceanu
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAshyamraj55
 
5 Considerations For Choosing The Best Gutter Guards
5 Considerations For Choosing The Best Gutter Guards5 Considerations For Choosing The Best Gutter Guards
5 Considerations For Choosing The Best Gutter GuardsCPR Gutter Protection
 
Does AI(Artificial intelligence) need a Working Memory??
Does AI(Artificial intelligence) need a Working Memory??Does AI(Artificial intelligence) need a Working Memory??
Does AI(Artificial intelligence) need a Working Memory??N.K KooZN
 
ServiceNow Integration with MuleSoft.pptx
ServiceNow Integration with MuleSoft.pptxServiceNow Integration with MuleSoft.pptx
ServiceNow Integration with MuleSoft.pptxshyamraj55
 
Chat with your data, privately and locally
Chat with your data, privately and locallyChat with your data, privately and locally
Chat with your data, privately and locallyZilliz
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
What Developers Need to Unlearn for High Performance NoSQL
What Developers Need to Unlearn for High Performance NoSQLWhat Developers Need to Unlearn for High Performance NoSQL
What Developers Need to Unlearn for High Performance NoSQLScyllaDB
 
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...DianaGray10
 
Do we need a new standard for visualizing the invisible?
Do we need a new standard for visualizing the invisible?Do we need a new standard for visualizing the invisible?
Do we need a new standard for visualizing the invisible?SANGHEE SHIN
 
Deliver Latency Free Customer Experience
Deliver Latency Free Customer ExperienceDeliver Latency Free Customer Experience
Deliver Latency Free Customer ExperienceOpsTree solutions
 
GDG Cloud Southlake 31: Santosh Chennuri and Festus Yeboah: Empowering Develo...
GDG Cloud Southlake 31: Santosh Chennuri and Festus Yeboah: Empowering Develo...GDG Cloud Southlake 31: Santosh Chennuri and Festus Yeboah: Empowering Develo...
GDG Cloud Southlake 31: Santosh Chennuri and Festus Yeboah: Empowering Develo...James Anderson
 
Reference Domain Ontologies and Large Medical Language Models.pptx
Reference Domain Ontologies and Large Medical Language Models.pptxReference Domain Ontologies and Large Medical Language Models.pptx
Reference Domain Ontologies and Large Medical Language Models.pptxChimezie Ogbuji
 
DS Lesson 2 - Subsets, Supersets and Power Set.pdf
DS Lesson 2 - Subsets, Supersets and Power Set.pdfDS Lesson 2 - Subsets, Supersets and Power Set.pdf
DS Lesson 2 - Subsets, Supersets and Power Set.pdfROWELL MARQUINA
 
PicPay - GenAI Finance Assistant - ChatGPT for Customer Service
PicPay - GenAI Finance Assistant - ChatGPT for Customer ServicePicPay - GenAI Finance Assistant - ChatGPT for Customer Service
PicPay - GenAI Finance Assistant - ChatGPT for Customer ServiceRenan Moreira de Oliveira
 
Building AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxBuilding AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxUdaiappa Ramachandran
 
Babel Compiler - Transforming JavaScript for All Browsers.pptx
Babel Compiler - Transforming JavaScript for All Browsers.pptxBabel Compiler - Transforming JavaScript for All Browsers.pptx
Babel Compiler - Transforming JavaScript for All Browsers.pptxYounusS2
 
COMPUTER_GROUP 7_10 ST. JOHN VIANNEY.pptx
COMPUTER_GROUP 7_10 ST. JOHN VIANNEY.pptxCOMPUTER_GROUP 7_10 ST. JOHN VIANNEY.pptx
COMPUTER_GROUP 7_10 ST. JOHN VIANNEY.pptxabalosyvonne42
 
Unleashing the power of AI in UiPath Studio with UiPath Autopilot.
Unleashing the power of AI in UiPath Studio with UiPath Autopilot.Unleashing the power of AI in UiPath Studio with UiPath Autopilot.
Unleashing the power of AI in UiPath Studio with UiPath Autopilot.DianaGray10
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URLRuncy Oommen
 

Recently uploaded (20)

Monitoring Java Application Security with JDK Tools and JFR Events.pdf
Monitoring Java Application Security with JDK Tools and JFR Events.pdfMonitoring Java Application Security with JDK Tools and JFR Events.pdf
Monitoring Java Application Security with JDK Tools and JFR Events.pdf
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
 
5 Considerations For Choosing The Best Gutter Guards
5 Considerations For Choosing The Best Gutter Guards5 Considerations For Choosing The Best Gutter Guards
5 Considerations For Choosing The Best Gutter Guards
 
Does AI(Artificial intelligence) need a Working Memory??
Does AI(Artificial intelligence) need a Working Memory??Does AI(Artificial intelligence) need a Working Memory??
Does AI(Artificial intelligence) need a Working Memory??
 
ServiceNow Integration with MuleSoft.pptx
ServiceNow Integration with MuleSoft.pptxServiceNow Integration with MuleSoft.pptx
ServiceNow Integration with MuleSoft.pptx
 
Chat with your data, privately and locally
Chat with your data, privately and locallyChat with your data, privately and locally
Chat with your data, privately and locally
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
What Developers Need to Unlearn for High Performance NoSQL
What Developers Need to Unlearn for High Performance NoSQLWhat Developers Need to Unlearn for High Performance NoSQL
What Developers Need to Unlearn for High Performance NoSQL
 
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
 
Do we need a new standard for visualizing the invisible?
Do we need a new standard for visualizing the invisible?Do we need a new standard for visualizing the invisible?
Do we need a new standard for visualizing the invisible?
 
Deliver Latency Free Customer Experience
Deliver Latency Free Customer ExperienceDeliver Latency Free Customer Experience
Deliver Latency Free Customer Experience
 
GDG Cloud Southlake 31: Santosh Chennuri and Festus Yeboah: Empowering Develo...
GDG Cloud Southlake 31: Santosh Chennuri and Festus Yeboah: Empowering Develo...GDG Cloud Southlake 31: Santosh Chennuri and Festus Yeboah: Empowering Develo...
GDG Cloud Southlake 31: Santosh Chennuri and Festus Yeboah: Empowering Develo...
 
Reference Domain Ontologies and Large Medical Language Models.pptx
Reference Domain Ontologies and Large Medical Language Models.pptxReference Domain Ontologies and Large Medical Language Models.pptx
Reference Domain Ontologies and Large Medical Language Models.pptx
 
DS Lesson 2 - Subsets, Supersets and Power Set.pdf
DS Lesson 2 - Subsets, Supersets and Power Set.pdfDS Lesson 2 - Subsets, Supersets and Power Set.pdf
DS Lesson 2 - Subsets, Supersets and Power Set.pdf
 
PicPay - GenAI Finance Assistant - ChatGPT for Customer Service
PicPay - GenAI Finance Assistant - ChatGPT for Customer ServicePicPay - GenAI Finance Assistant - ChatGPT for Customer Service
PicPay - GenAI Finance Assistant - ChatGPT for Customer Service
 
Building AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxBuilding AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptx
 
Babel Compiler - Transforming JavaScript for All Browsers.pptx
Babel Compiler - Transforming JavaScript for All Browsers.pptxBabel Compiler - Transforming JavaScript for All Browsers.pptx
Babel Compiler - Transforming JavaScript for All Browsers.pptx
 
COMPUTER_GROUP 7_10 ST. JOHN VIANNEY.pptx
COMPUTER_GROUP 7_10 ST. JOHN VIANNEY.pptxCOMPUTER_GROUP 7_10 ST. JOHN VIANNEY.pptx
COMPUTER_GROUP 7_10 ST. JOHN VIANNEY.pptx
 
Unleashing the power of AI in UiPath Studio with UiPath Autopilot.
Unleashing the power of AI in UiPath Studio with UiPath Autopilot.Unleashing the power of AI in UiPath Studio with UiPath Autopilot.
Unleashing the power of AI in UiPath Studio with UiPath Autopilot.
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URL
 

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