computer interfacing tutorial-printer, serial, game, usb port
 

 

BACK

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;

BACK

 

Free Software
Delphi

Lesson 1
Delphi Programming
1.1. IDE Delphi
1.2. Component


Lesson 2
Printer Port
/ LPT
1.1.Basic
1.2.Address
1.3.Port Register
1.4.8 Bit Data Input
1.5.Test Circuitry
1.6.Assignment

Lesson 3
Printer Port / LPT
Experiments

3.1.LED
3.2.Swicht
3.3.Motor Stepper
3.4.DAC
3.5.ADC
3.6.Graph Display

Lesson 4
Serial Port

4.1.Basic
4.2.Hardware
4.3.Port Register

Lesson 5
Serial Port Experiments

5.1.LED
5.2.Stepper Motor
5.3.Swicht
5.4.ADC

Lesson 6
Game Port
Joy Stick
6.1. Basic
6.2. Experiments