Andreas Jensen wrote:
>> Hvis det ikke lige absolut skal være Seriel-porten, så kan du styre
> direkte
>> via de12 udgange og 5 indgange der er på printerporten
>
> Hmm det lyder interessant og nemt.
> Har du nogle referencer eller guides?
>
> Med venlig hilsen
> Andreas Kryger Jensen
Hvis du f.eks. bruger turbo pascal, så har det en kommando der hedder port
til formålet her er lidt info:
You can read ifl signals from different pins on LPT ports with the
PORT
comand ( =OUT/IN command ifl assembier). Just determine the base
adress of
the LPT port using
}
LPTadress := MemW[$40 : 6 + LPTNr * 2);
{
where LPTNr is the number of the LPT port from i to 3.
Should return O3BCh, 0378h or 0278h.
That has to be done once at the beginning of the program.
Now you can start to read/write values on this port.
The LPT port has:
- 8 data outputs (pin 2 to 9), which can be written using
}
Port[LpTAdress] := B;
{
where B is a byte consisting of the 8 bits. Voitage will be 5V for
1, and 0V
for 0. (but not very high power availabie (TTL/CMOS)
- 4 handshake outs which can be written by
}
Port[LpTAdress + 2) := B;
{
where B is a byte with the iowest 4 bits set to the values of the
pins and
the higher 4 bits always set to zero.
PIN 1:Strobe -->bit 0
PIN 14:AutoFD -->bit i
PIN 16:mit -->bit 2
PIN 17:SeuN -->bit 3
Attention! bit 2/pin 16 is 0V when set to zero, ali others
are INVERTED! (0 --> 5V and vice versa)
5 handshake inputs which can be read by
I
{
B := Port[LPTAdress + i);
After the command, B contains the signais that are connected to the
input pins of the LPT port:
Bit 0-2: no function
Bit 3 --> PIN 15/Error
Bit 4 --> PIN 13/Select
Bit 5 --> PIN 12/PaperEmpty
Bit 6 --> PIN 10/Acknowledge
Bit 7 --> PIN il/Busy ===> Attention! This input is INVERSE!
For information: The pins 18 to 25 are Signal Ground pins.
To use the inputs, connect TTL level 0V for 0, and 5V for i to
them.
(Or just use a resistor lOkOhm against +5V (take it from the
keyboard
connector or 50, don't know what pin that is
and a switch
against GND:
--
Automatik Mekaniker
Calle