ZX Computings - OpenLibra
ZX Computings - OpenLibra
ZX Computings - OpenLibra
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
and 2.5 volts. This will produce<br />
a number between 0 and 255<br />
on PEEKing at the INPUT from<br />
the port. There are + 5 volts<br />
and 0 volts connections from<br />
the pack, so these can be used<br />
to create the voltage required.<br />
These should be used with care<br />
as they may cause the crash of<br />
the computer if too much current<br />
is taken.<br />
The output of the Digital to<br />
Analogue converter will convert<br />
the number between 0 and<br />
255 into a voltage between 0<br />
and 2.55 volts. This can be adjusted<br />
within the port, if it is not<br />
correct, and a complete circuit<br />
diagram is given. The accuracy<br />
is ± 5% on both the analogue<br />
input and output.<br />
The resistor could be<br />
measured using this device by<br />
connecting them as shown in<br />
Fig. 1. By knowing the voltage<br />
across the known resistor and<br />
the voltage output by the<br />
analogue port, the resistance<br />
can be calculated. As the<br />
resistance of the unknown<br />
resistance rises, the measured<br />
voltage across the known<br />
resistor will fall. The computer<br />
can then be used to work out<br />
the unknown resistance.<br />
The C Pack<br />
The 'C' pack again requires the<br />
use of a *P' pack or another<br />
port. The 'C pack can plug<br />
directly onto the connectors at<br />
the back of the 'P'.<br />
The 'C' pack provides eight<br />
relays which can be controlled<br />
by the output of the port. The<br />
relays are turned on by making<br />
any of the eight bits Binary 0.<br />
The outputs from the back are<br />
by the same 2 mm sockets as<br />
used on the 'A' pack. The outputs<br />
consist of eight single contact<br />
switches, which connect<br />
to a common wire. They are not<br />
connected to the computer at<br />
all. The contacts are normally<br />
closed and can carry 12 volts at<br />
1 amp maximum. Therefore<br />
when the computer is switched<br />
on and the output from the port<br />
is 255, all the switches are<br />
closed. I would have thought<br />
this would be a disadvantage in<br />
a controlled situation, as all the<br />
devices would be turned on<br />
under no control from the computer.<br />
The inputs consist of a set of<br />
eight resistors connecting each<br />
of the input connectors to 0<br />
volts. This means that when<br />
PEEKing the port with nothing<br />
connected the user will see 0.<br />
There is no buffering between<br />
these input pins and the input to<br />
the port, so that the application<br />
of any voltage above + 5 volts<br />
could not only damage the 'C'<br />
Port 'P' pack<br />
pack, but also burn out the 'P'<br />
pack as well.<br />
These devices are intended for<br />
use in educational or control<br />
purposes. Games could be<br />
another possible use, but the<br />
price of these packs might put<br />
that out of bounds. The limit of<br />
only 5K of RAM and only one<br />
port might prove restrictive in<br />
use, but up to 128 different<br />
1 bit devices can be controlled.<br />
The boxes are robust and<br />
could be used in schools without<br />
needing a set of expensive<br />
plugs and sockets. I have<br />
doubts, however, over the inputs<br />
to the 'C' pack. If any<br />
voltage over + 5 volts is used,<br />
some form of protection will be<br />
required to stop the port blowing<br />
up.<br />
The documentation that<br />
comes with the port is very<br />
clear and simple to understand.<br />
The leaflet included with each<br />
pack details its uses and gives a<br />
program to demonstrate its<br />
capabilities. The current drawn<br />
by these packs is shown in table<br />
1. DCP packs cost £37.95 for<br />
the price of the 'P' pack,<br />
£29.95 for the 'A' pack and<br />
£1 9.95 for the 'C' pack. Both<br />
'A' and 'C' packs must be used<br />
with a 'P' pack or other ports.<br />
Table 1.<br />
45 ma.<br />
'A' pack 80 ma.<br />
'C' pack 775 ma. (Max.)<br />
Solving Equations<br />
This clever routine, written by<br />
Jeremy Ruston, uses Newton's<br />
method for solving equations.<br />
Enter the equation you want<br />
solved for X when prompted by<br />
line 10, then — in reply to the<br />
prompt from line 40 — enter a<br />
starting position for the <strong>ZX</strong>81<br />
to work from. This should be<br />
M"<br />
either an answer somewhere<br />
near what you believe the correct<br />
answer to be, or — if there<br />
is more than one correct<br />
answer — a number near the<br />
answer you are seeking. Then<br />
press NEWLINE and sit back<br />
and watch the fun as the computer<br />
verges towards the<br />
answer.<br />
To try it out, enter X*X-5<br />
(to find the square root of five)<br />
or X*'3-27.6 to find the<br />
cube root of 27.6.<br />
L- RTF-.N WEWTONS METHOD- FOR<br />
SOL^XHG EOLTRT TON 5<br />
REM BY UEREMY RUSTON<br />
PRINT "ENTER P FUNCTION ";<br />
20 INPUT F S<br />
30 PRINT F$<br />
4-0 PR IMT "ENTER R STRRTIN6 POX<br />
50 INPUT S<br />
60 PRINT 3<br />
7"0 PRINT '* INPUT MAXIMUM ERROR<br />
©0 INPUT ERR<br />
90 PRINT ERR<br />
1O0 PRINT RT 10,10;3<br />
110 LET X=3<br />
120 IF RB5 VURL L'F$.» > -: ERR THEN<br />
3"! OP<br />
130 LET T=URL LF$><br />
140 LET X =X +0- 00001<br />
150 LET B = (URL TF$> -T> Y0.00001<br />
163 LET 5 = 3-T.'B<br />
1*7® GOTO 100<br />
<strong>ZX</strong> COMPUTING SUMMER 1982 69