PC parallel port register

Source: Internet
Author: User

PC parallel port register

This article is excerpted from Wang honghui's book "Practical Guide for developing embedded Linux kernel (ARM platform )".

 

On PCProgramAccess and control the pin signals of the parallel port by accessing the I/O port registers of the parallel port. These ports include the data port, status port, and control port. Each port has its own port number, their addresses. The program accesses the port register through the port number.
The data port number of Port 1 in the PC is 3bch, the status port number is 3bdh, and the control port number is 3beh;
The data port number of Port 2 of the parallel PC is 378 H, the status port number is 379 h, and the control port number is 37ah;
The data port number of Port 3 of the parallel PC is 278 H, the status port number is 279 h, and the control port number is 37ah;
1) Data Register
Data Register (D0 ~ D7) is also called the data port, which stores one byte of data written to the data port pin. The data port can write data (output) or read data (input ). The written data is the data output from the data port pin. The read data is the data written to the data port last time or the data that was originally stored in it, the data is not input from the port pin to the PC. The pin corresponding to the data port is pin2 ~ Pin9: data register definition is shown in Table 10-2.

2) Status Register
Status Register (S0 ~ S7) is also called the status port, which saves 5 inputs (S3 ~ S7) logic status of the pin, S0 ~ The S2 position does not correspond to the pin. In addition to S0, status registers are read-only, and read data information is the logical status on the Status port pins. S0 is a timeout sign that supports EPP transmission and port. It can be cleared by software. In many parallel ports, the status input is connected to the upper-tension resistance. The pin corresponding to the status port is pin10 ~ Pin13 and pin15. The Status Register definition is shown in Table 10-3.

3) control register
control register (C0 ~ C8) is also called the control port, which saves C0 ~ The four-digit control information of C3, C4 ~ C7 does not correspond to pins. These bits are generally used for output. However, in most spp parallel ports, the control bits are in open collector/open drain mode, that is, they can also be used as input. To read the external logic signal from the control bit, first write the corresponding output to "1", and then read the value of the control register. However, in order to increase the switching speed, most of the ports supporting the EPP and ECP modes work in the push-pull mode where the control bit cannot be used as the input. In some multi-mode interfaces, the control bit adopts an improved push-pull mode and can be used as an input. The pins corresponding to the control port are pin1, pin14, pin16, and pin17. The control register definition is shown in Table 10-4.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.