Anda di halaman 1dari 8

"

"


.
This release contains a detailed explanation about the
parallel port "printer port" in the computer and how to
control all its registrars Using MATLAB program and
some simple projects proposed for implementation in
the laboratory on scientific boards simulates the real
parallel port.


,
.

2011 ,
.

.


.
.

Programming PC Parallel port by MATLAB


Essentials:
A first step in exploring the parallel port is learning how to get the most from a port with your everyday applications
and peripherals. Things to know include how to find, configure, and install a port, how and when to use the new
bidirectional, EPP , and ECP modes, and how to handle a system with multiple parallel-port peripherals. This paper
presents essential information and tips relating to these topics.

paradigm numerical computing environment and


fourth-generation programming language.
Developed by MathWorks, MATLAB allows
matrix manipulations, plotting of functions and
data, implementation of algorithms creation of
user interfaces, and interfacing with programs
written in other languages, including C, C++,
java, Fortran and Python.
Although MATLAB is intended primarily for
numerical computing, an optional toolbox uses
the MuPAD symbolic engine, allowing access to
symbolic computing capabilities.
An additional package, Simulink, adds graphical
multi-domain simulation and Model-Based
Design for dynamic and embedded systems.
In 2004, MATLAB had around one million users
across industry and academic. MATLAB users
come from various backgrounds of engineering,
science, and economics. MATLAB is widely
used in academic and research institutions as well
as industrial enterprises.

) ( :
.
," "
,
,
,
,C ,
. , , ,C++

,
,MuPAD
.
" ,
,"

.
,2004
.

.

Defining the Port

What is the parallel port?


In the computer world, a port is a set of signal
lines that the microprocessor, or CPU, uses to
exchange data with other components.
Typical uses for ports are communicating with
printers, modems, keyboards, and displays, or just
about any component or device except system
memory. Most computer ports are digital, where
each signal, or bit, is 0 or 1. A parallel port
transfers multiple bits at once, while a serial port
transfers a bit at a time (though it may transfer in
both directions at once).

" "
,
,
.
, ,
, ,
.
, ,
. ,""
, ""
" "
.) (

MATLAB: (matrix laboratory) is a multi-

The original PCs parallel port had eight outputs,


five inputs, and four bidirectional lines. These are
enough for communicating with many types of
peripherals. On many newer PCs, the eight
outputs can also serve as inputs, for faster
communications with scanners, drives, and other
devices that send data to the PC. The parallel port
was designed as a printer port, and many of the
original names for the ports signals )PaperEnd,
AutoLineFeed) reflect that use. But these days,
you can find all kinds of things besides printers
connected to the port. The term peripheral, or
peripheral device is a catch-all category that
includes printers, scanners, modems, and other
devices that connect to a PC.

,
. ,

, .
,
, ,

.

, (
.)

.

.

Parallel Port Types:


1-Original (SPP)
2-PS/2-type (Simple Bidirectional)
3-EPP
4-ECP
5-Multi-mode Ports

Addressing

There are many ways to access a parallel


port in software, but all ultimately read or
write to the ports registers. The registers are
in a special area dedicated to accessing
input and output (I/O) devices, including
printers as well as the keyboard, disk drives,
display, and other components. To
distinguish between I/O ports and system
memory, the microprocessor uses different
instructions and control signals for each. You
can read and write to the ports using
assembly
language
or
higher-level
languages like Basic, Pascal, Matlab, and C.
On the original PC, port addresses could
range from 0 to 3FFh (decimal 1024).
Many newer parallel ports decode an
eleventh address line to extend the range to
7FFh (decimal 2048). The number of
available ports may seem like a lot, but
existing devices use or reserve many of
these, so only a few areas are free for other
uses. Each address stores 8 bits.

,
.

)I / O(

.
.

:
.
0 ,
.)1024 (3FFh

(7FFh
.)2048
,
,
.
. 8

The figure below explains parallel port registers:

Registers Types:
:

The Data Register:

( D0-D7) , ,
.
, ,
) (
Centronics " .
" IEEE-1284 standard" "interface
, D0-D7 , D8 D1
.

The Data port, or Data register, (D0-D7) holds the


byte written to the Data outputs. In bidirectional Data
ports, when the port is configured as input, the Data
register holds the byte read at the connectors Data
pins. Although the Centronics interface and the IEEE1284 standard refer to the Data lines as D1 through
D8, in this paper, I use D0-D7 throughout, to
correspond to the register bits.

The Control Register:

C0 , , ,
. C4 C7 . C3
SPP .
,

.

The Control port, or Control register, holds the states


of four bits, C0 through C3. Bits C4 C7 dont
appear at the connector. Conventionally, the bits are
used as outputs. On most SPPs, however, the Control
bits are open-collector or open-drain type, which
means that they may also function as inputs.

The Status Register:

, ,
S0S2 . S7 S3 ,
.
,S0 ,
, EPP
.

The Status port, or Status register, holds the logic


states of five inputs, S3 through S7. Bits S0S2 dont
appear at the connector. The Status register is readonly, except for S0, which is a timeout flag on ports
that support EPP transfers, and can be cleared by
software.

How we can control on registers of Parallel Port in MATLAB software


digitalio dio

,
. BIOS

addline
,
, 0
1 2 ,
.
putvalue

out in
getvalue(dio.line([2])): 2
.

Eng. Mohanad Adnan Al-Faluji


Islamic college University, B.S.C.
2011.
Interesting areas: DSP, RTS,
Electronics, Design, Mobile
Communication.
4

""Programming PC Parallel port by MATLAB


.
:

1 - Proteus 8 Professional
2 Matlab Advance
3- Ansys
4- AutoCAD
5- Wireless communication
6-Multisim version 13
7- Different Programming languages
8-Labview

40
Eamar Eiit
:
07818658655
:
Babylon.elites@gmail.com
:
www.babylon-elites.com
:

Anda mungkin juga menyukai