comp.lang.ada
 help / color / mirror / Atom feed
* Parallel port in Ada
@ 1998-06-08  0:00 Fco. Luis Guillen
  1998-06-09  0:00 ` Albert K. Lee
  0 siblings, 1 reply; 2+ messages in thread
From: Fco. Luis Guillen @ 1998-06-08  0:00 UTC (permalink / raw)




	Sorry again.

	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.

	Thank again....  

	




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Parallel port in Ada
  1998-06-08  0:00 Parallel port in Ada Fco. Luis Guillen
@ 1998-06-09  0:00 ` Albert K. Lee
  0 siblings, 0 replies; 2+ messages in thread
From: Albert K. Lee @ 1998-06-09  0:00 UTC (permalink / raw)



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




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1998-06-09  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-06-08  0:00 Parallel port in Ada Fco. Luis Guillen
1998-06-09  0:00 ` Albert K. Lee

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