The centronics port - PowerPoint PPT Presentation

About This Presentation
Title:

The centronics port

Description:

Devices are connected to the parallel port (LPT) using a 25-way D-connector. ... To get this output send 10011100 (binary), 156 (decimal) or 9C (hex) to the ... – PowerPoint PPT presentation

Number of Views:254
Avg rating:3.0/5.0
Slides: 12
Provided by: davidsw2
Category:
Tags: centronics | lpt | port

less

Transcript and Presenter's Notes

Title: The centronics port


1
The centronics port
  • Interfacing to a PC

2
Connection
  • Devices are connected to the parallel port (LPT)
    using a 25-way D-connector.

3
Pinout of centronics port
4
Outputs
  • We use D0 to D7 for most outputs
  • D7 is the most significant bit
  • We output all eight bits at once
  • To get this output send 10011100 (binary), 156
    (decimal) or 9C (hex) to the output port

D7 D6 D5 D4 D3 D2 D1 D0
1 0 0 1 1 1 0 0
5
Address
  • The output port is at address 378H
  • Outputs use the command
  • OUT address, data
  • Hexadecimal numbers can be written using h at
    the start
  • You can send 9CH to the output port using
  • OUT h378, h9C

6
Inputs
  • The inputs are at address 379H
  • The inputs can be read using INP(address)
  • INP(h379) behaves like a variable and has a
    value that depends on the inputs so is used in
    statements like this
  • SINP(h379)

7
Addresses of pins
8
Inputting
  • To look at the input from the ERROR pin we need
    to input from the input port
  • SINP(h379)

D7 D6 D5 D4 D3 D2 D1 D0
BUSY ACK PE SLCT ERROR Not used Not used Not used
1 0 0 1 1 1 1 1
S is now equal to 9FH
9
Masking
  • All the bit other than D3 need to be ignored
    this is called masking

D7 D6 D5 D4 D3 D2 D1 D0
BUSY ACK PE SLCT ERROR Not used Not used Not used
1 0 0 1 1 1 1 1
10
Making the mask
  • The function AND is used for masking
  • Put 0s where you want the bits to be ignored
  • If D3 is 0 the answer is zero
  • If D3 is 1 the answer is not zero

D7 D6 D5 D4 D3 D2 D1 D0 Hex
BUSY ACK PE SLCT ERROR Not used Not used Not used
AND 1 0 0 1 1 1 1 1 9F
AND 0 0 0 0 1 0 0 0 08
Answer 0 0 0 0 1 0 0 0 08
11
Code for inputting and masking
  • SINP(h379)
  • SS AND h08
  • IF S0 THEN
  • IF Sgt0 THEN
Write a Comment
User Comments (0)
About PowerShow.com