Data Acquistion ADC with Bidirectional Port
Printer
This circuit is designed for bidirectional
mode for data acquisition ADC, for this experiment your PC should be
have bidirectional facility. Build up your circuit as shown in the picture
bellow.
Table Control Port
Offset
Name
Read/Write
Bit No.
Properties
Base + 2
Control Port
Read/Write
Bit 7
Unused
Bit 6
Unused
Bit 5
Enable Bi-Directional Port
Bit 4
Enable IRQ Via Ack Line
Bit 3
Select Printer
Bit 2
Initialize Printer (Reset)
Bit 1
Auto Linefeed
Bit 0
Strobe
Bits 4 & 5 are internal controls. Bit four will
enable the IRQ (See Using the Parallel Ports IRQ) and Bit 5 will enable
the bi-directional port meaning that you can input 8 bits using (DATA0-7).
This mode is only possible if your card supports it. Bits 6 & 7
are reserved. Any writes to these two bits will be ignored.
Click twice on Timer1 component and insert the following
program :
procedure TForm1.Timer1Timer(Sender: TObject); var data:byte; voltage:real; begin asm mov dx,$37A mov al,32d out dx,al ; mov dx,$378 in al,dx mov data,al end; voltage:=data*5/255; edit1.text:=floattostr(voltage); end;