Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Parrallel turing
1. Using the Parrallel Port in Turing
First we need to look at how the pinouts are used before we start.
Image from: http://webspace.webring.com/people/ot/tfgdfgff/parallel.htm
Pin No Signal Directio Register Pin No Signal Directio Register
(DB25) name n - bit Inverted (DB25) name n - bit Inverted
Control- 10 nAck In Status-6 No
1 nStrobe Out 0 Yes
11 Busy In Status-7 Yes
2 Data0 In/Out Data-0 No
Paper-
12 Out In Status-5 No
3 Data1 In/Out Data-1 No
13 Select In Status-4 No
4 Data2 In/Out Data-2 No
Control-
14 Linefeed Out 1 Yes
5 Data3 In/Out Data-3 No
15 nError In Status-3 No
6 Data4 In/Out Data-4 No
nInitializ Control-
16 e Out 2 No
7 Data5 In/Out Data-5 No
nSelect- Control-
8 Data6 In/Out Data-6 No 17 Printer Out 3 Yes
9 Data7 In/Out Data-7 No 18-25 Ground - - -
Output
pins
Input
Pins
We can see from the shaded areas what pins we can send and receive information on. In Turing to
access the parallel port we need input and output areas we can use “parallelget” and “parallelput.”
2. The example program below listens for the value 24 on S3-S7 (Pins 10-13,15) decimal and responds with
25 decimal on D0-D7 (Pins 2-9). These send and receive values are converted into binary code going out
and inversely to decimal coming in from the port. The program sends and receive a decimal number
which is then convert to base 2. A one is present on the corresponding pin if 5vdc is present. This could
be used to drive leds or any TTL type interface circuit. In order for this to work you will need a way of
inputing a binary value of 24 to Pins 10-13, 15. The use of dip switchs would be appropriate. LEDS could
be hooked up to Pins 2-9 to show the output value. Another method could be to use another computer
running a communication terminal program like hyperterminal with an external cable between ports.
For know we just need to understand how to get and send information to the port.
Her is the program to demonstrate this process:
% The "Parallel Port" program.
var value : int
loop
put"Waiting for a value of 24"
value := parallelget%Get the value from S3-S7(Pins 10-13,15) “parrallelget” transfers the value present
to the “value” variable.
if (value=24) then% wait for a value of 24
parallelput (25)%Send out value on D0-D7(Pins 2-9) “parrallelput” transfers the value “25” out.
exit%Exit Program
end if
% Endlessly repeats until program is stopped by exit statement.
end loop
Here it is again in the Turing Shell.