An inexpensive parallel interface to a digital pH meter - Journal of

The authors have designed an experiment in which the students build their own parallel interface "card" from inexpensive components...
0 downloads 0 Views 3MB Size
the computer bulletin board phase stepper motor is provided by the manufacturer (9) and is not repeated here. As shown in Figure 1, the electronic components provide four outputs ($1-$4) to turn the TEC stepper motor. The direction and the speed of rotation can be regulated by inputs at the MODE (pin 3) and the COUNT (pin 15) lines, respectively. A high input of +7.5 V a t the former causes anticlockwise motion, whereas 0 V causes motion in the reverse direction. One step rotation of 3.6 degrees could be triggered by the rising edge of a pulse asserted a t the latter line. Hence, by providing the designated number of triggering pulses applied a t the COUNT iuput, the driver chip 10 20

REM REM

30

REM

40

REM

50

REM

60

REM

40

REM

BASIC program to wntrol stepping motor via the homemade stepper motor driver unit and the RS232C modem wntrol register for COM 1 with I10 address 3FC (hex) bit 0 control DTR being wnnected to pin 3 (MODE)of SAA 1027 bit 1 control RTS being connected to pin 15 (COUNT)of SAA 1027

100 CLS 110 LOCATE12,IO 115 lNPUT4'",D% 135 lNPUTmEnter Clockwise (1)or Anticlodcwise (O)>",A%

140 150 160 170 180 190 200 210 220 230 240

IF(A%>I)OR(A% INT(Fl2) then G=lO

80

IF G = 10 then F=F-1

strip offthe lowest bit if set

90

PH = G + ( F ' 0.016) + (E' 0.16) + (D' 1.6)+(C'16)

calculate the

$GO90

print a hexadecimal byte load accumulator from address $GO91

1911-

20 DA FD

JSR $FDDA

1914-

20 48 F9

JSR $F948

1917-

C O O 19

JMP $1900

print a hexadecimal byte print three blank spaces reDeai

sage through a 7404 inverter chip. Then we apply both inverted lines to the input of a 7408 AND gate. The inverted and DECODER output will both be high when active, and they will produce a high output f m c the AND gate. All other combinations of the inverted DS and DECODER outputs yield low outputs from the AND gate. Finally, the outputs from the 7408 AND gates are "ANDmedwith the FVW (readhrite) line on the Apple bus. This is to prevent writing any data to the pH meter instead of reading data from it. The final AND gate results are inverted because the 74373 flip-flops are activated by a low signal. The Output

With the interface card in slot no. 1, reading address 5C090 transfers the binary-coded decimal (BCD) equivalents (0.1,0.2,0.4,0.8,1,2,4, and 8)ofthe pH reading onto the data bus. The BCD's are available from a 30-pin printed circuit tab a t the rear of the Orion meter. Reading $Cog1 captures the pH pinouts: 10, 0.002, 0.004, 0.008, 0.02,0.04, and 0.08. The seventeenth piece of information, the 0.001 pinout, is discarded, so that the collected pH readings will be accurate within 0.002 pH units. Of course, additional 74373's driven by address lines other than A0 could be added to gather the last available bit of data or to interface additional instruments. A158

Journal of Chemical Education

comments

BASIC

statement

100

$GO91

define G = 10 if F is odd, pH 10

PH

PRINT PH

With a dual-channel oscilloscope the students can compare the outputs of the various inverters and gates in the .circuit with the level on the DSJne. Each read of a n appropriate slot address forces the DS line low for the duration of the system clock ($1 only. The HOLD pin of the pH meter is tied to the inverted DS line to halt A/D conversion in the meter and to hold the last converted pH during the time the slot is activated by a read. The students practice addressing 5C090 and 5C091 alternately while observing the scope traces. This exercise must be performed with ASSEMBLY language routines instead of BASIC. In Table 1is a continuous routine we used for this purpose. Table 2 contains an ASSEMBLY language routine that continuously reads the meter and prints the results to screen. A BASIC routine for reading the pH meter requires conversion between the binary-coded decimal format and the decimal format. Examples are given in Table 3.

An Inexpensive Cornputer-Based Autotitrator Edwin F. Meyer DePaul University Chicago, lL 60614

Several descriptions of computer-assisted titrations have appeared in this Journal in recent years (1&12). The novelty of the procedure presented here is the use of time as the primary independent variable, with simultaneous collection of the data required to transform it into volume, so that conventional plots of emf vs. volume and