Board index » delphi » Using Parallel Ports under Pascal

Using Parallel Ports under Pascal

Hi everybody,
    I want to use parallel ports under pascal. I will use this to give
commands to a device that is build by one of my friends. To use this device
I think y will need pulses through specific pins of the port. And maybe
different combinations of the pins.
    Thanks for your attention.

--
Posted via CNET Help.com
http://www.help.com/

 

Re:Using Parallel Ports under Pascal


Hi,

on Sun, 30 Jan 2000 at 20:30:07 o'clock, Emre TOPTANCI wrote:

Quote
>     I want to use parallel ports under pascal.

I assume, out of statistical considerations, that you are using Turbo
Pascal from Borland (or Borland Pascal). This is important, because
things such as hardware access are not part of the language, but of
the specific compiler.

Quote
> To use this device
> I think y will need pulses through specific pins of the port.

This is a little bit too unspecific. I assume that you need to set the
data bits. Most homebrew parallel port devices work this way, partially
because it is so easy to use from the programmer's point of view.

In a normal PC, the port addresses for the parallel port are these:

If you have 1 or 2 of them:

   LPT1: $378
   LPT2: $278

If you have more than 2 of them:

   LPT1: $3BC
   LPT2: $378
   LPT3: $278
   LPT4: $2BC

The parallel connector has (among others) 8 data lines, called D1
through D8, which are pins 2 through 9 on the connector (regardless
whether you have a 25-pin or a 36-pin connector - which is what you
normally have on the printer side). If you send a byte to the port,
the lines are set according to the bits of this byte. That is, if you
send the bit $27, pins D1, D2, D3 and D6 are positive, the others are
grounded.

So far, this is language independent. Accessing a port in Turbo Pascal
is easy; there is a so-called Port array, similar to the Mem array:

   Port[$378] := $A5;

produces the following state of the lines:

   D8 -> 10100101 <- D1

 - Sebastian

Re:Using Parallel Ports under Pascal


Quote
Emre TOPTANCI wrote:

>     I want to use parallel ports under pascal. I will use this to give
> commands to a device that is build by one of my friends. To use this device
> I think y will need pulses through specific pins of the port. And maybe
> different combinations of the pins.

http://bsn.ch/tp-links
chapter "serial" has a "parallel" subchapter. With all information
you need.
--
Franz Glaser, Glasau 3, A-4191 Vorderweissenbach Austria +43-7219-7035-0
Muehlviertler Elektronik Glaser.  Industrial control and instrumentation
http://members.eunet.at/meg-glaser/    http://members.xoom.com/f_glaser/
http://www.geocities.com/~franzglaser/            http://start.at/bedarf

Re:Using Parallel Ports under Pascal


Hi,

its me again, and yes i finally did make that laplink program i was telling you
about in yamanlar, if you like you can use it to generate new code for your
controller, its fully interrupt compatible,

Arash
www.arash.da.ru

Quote
Emre TOPTANCI wrote:
> Hi everybody,
>     I want to use parallel ports under pascal. I will use this to give
> commands to a device that is build by one of my friends. To use this device
> I think y will need pulses through specific pins of the port. And maybe
> different combinations of the pins.
>     Thanks for your attention.

> --
> Posted via CNET Help.com
> http://www.help.com/

Other Threads