1 / 11

The centronics port

The centronics port. Interfacing to a PC. Connection. Devices are connected to the parallel port (LPT) using a 25-way D-connector. Pinout of centronics port. Outputs. We use D 0 to D 7 for most outputs D 7 is the most significant bit We output all eight bits at once

nash-smith
Download Presentation

The centronics port

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  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

  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: S=INP(&h379)

  7. Addresses of pins

  8. Inputting • To look at the input from the ERROR pin we need to input from the input port S=INP(&h379) S is now equal to 9FH

  9. Masking • All the bit other than D3 need to be ignored – this is called masking

  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

  11. Code for inputting and masking S=INP(&h379) S=S AND &h08 IF S=0 THEN … IF S>0 THEN …

More Related