comp.lang.ada
 help / color / mirror / Atom feed
From: aklee@spam.this.interport.net (Albert K. Lee)
Subject: Re: Parallel port in Ada
Date: 1998/06/09
Date: 1998-06-09T00:00:00+00:00	[thread overview]
Message-ID: <slrn6npcva.9ld.aklee@interport.net> (raw)
In-Reply-To: Pine.A32.3.91.980608181344.13484A-100000@alboran.ualm.es


On Mon, 8 Jun 1998 18:16:13 +0100, Fco. Luis Guillen <fguillen@alboran.ualm.es> wrote:
>
>	Yes, I've Gnat 3.08 and i want to control 8 leds conected in the 
>parallel port. 
>
>	Yes I think to make it with the 'LPT1', open a file and print in 
>it, but i think that it isn't very smart. I want to make it with code 
>machine or with interruptions.

So you're using GNAT 3.08 on a 386 class PC running an unspecified
operating system.  Firstly, I'm not sure if the parallel port sinks
enough current to drive 8 LED's.  Be careful to not damage anything.

One way to access the data lines of a parallel port is through in/out
calls to the parallel port's base port.  That is, for LPT1, accessing
the usual base port of 16#378 (0x378) will allow you to converse with
data lines D0 through D7 (DB25 pins 2 through 9).  Accessing ports
16#379 and 16#37A will give you access to the other 9 pins.

That's only half the answer -- I'm not exactly sure how to access
these ports using GNAT.  A while ago, I needed to do this through
Linux, and to get access to the hardware through the OS, I found it
most comfortable to interface to the OS using C and link the resulting
object file with the rest of my Ada program.  In DOS, however, where
there is no protection of hardware at all, it might be simpler to take
an all-Ada approach (I've never really used the DOS distribution).
Are you using Windows or DOS?  (or Linux?)

-Albert




      reply	other threads:[~1998-06-09  0:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-06-08  0:00 Parallel port in Ada Fco. Luis Guillen
1998-06-09  0:00 ` Albert K. Lee [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox