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

 

PREVIOUS NEXT


3.1. Basic Experiment Printer Port to Output Data

Refer to the figure titled Figure #1 - Printer Port Test Circuitry. This illustrates a very simple test fixture to allow you to figure out what inversions are taking place in the hardware associated with the printer port.

3.1.1. Basic Turn On and Off 8 LED

Program test_output1.pas turns the 8 LED's on and then off on 8 bit port Data. In this experiment, we used two button to control 8 LED to turn on or off. Note that an LED is turned off with a logic one.

Delphi Programming ( download file exp311.zip )

 

procedure TLED.Button1Click(Sender: TObject);
begin
asm
mov dx,$378
mov al,00000000b
out dx,al
end;
end;
procedure TLED.Button2Click(Sender: TObject);
begin
 asm
  mov dx,$378
  mov al,11111111b
  out dx,al
 end;
end;

After inserting those instruction then hit F9 on your keyboard to run the program, then you'll see picture as shown in the bellow


        

Click on Turn On button to turn on 8 LED that connected to Port Data, and click on Turn Off to turn off 8 LED.

PREVIOUS NEXT

 

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