Interfacing 8086 With 8255
Interfacing 8086 With 8255
Ex.No Date:
AIM:
To write an assembly language program to interface 8255 with 8086.
COMPONENTS REQUIRED:
8086 Microprocessor kit, LED interface, flat cable
ALGORITHM:
Step 1 : Start
Step 2 : Send the control word to the control register
Step 3 : Send the data for which the LED will glow
Step 4 : Stop
CONTROL WORD
D7 D6 D5 D4 D3 D2 D1 D0
Group B
1 – 1/0 mode Port C lower
0 - BSR 1 – input
0 – output
Port B
1 – input
0 – output
Mode:
0 – mode 0
1 – mode 1
Group A
Port C Upper
1 – input
0 – output
Port A
1 – input
0 – output
Mode:
00 – mode 0
01 – mode 1
10 – mode 2
CONTROL WORD
1 0 0 0 0 0 0 0 = 80H
Programe Name: Programming in 8085 (16 – bit addition)
FLOW CHART
Start
Stop
OUTPUT
DATA = 54H
S1 S2 S3 S4 S5 S6 S7 S8
0 1 0 1 0 1 0 0
OFF ON OFF ON OFF ON OFF OFF
RESULT:
Thus the assembly language program to interface 8086 with 8255 was written and
verified.
INTERFACING 8255 INPUT PORTS IN MODE 0
PA1 B
U
F
+5V
F
PA0 E
R
LEDS
8
2
A15 CS 5 PC1
5
A1 A1 PC4
A0 A0 PC3
MEMR RD PC0
MEMW WR PB7
RESET OUT CS
RESET PB0
(8086)
BLOCK DIAGRAM OF 8255
Group Group
+5V A A
Gnd Port Port
A A
Group A
Port C
Upper
Data
bus
D 7 – D0 buffer
8 bit Group A
internal
Port C
data bus
Lower
Group
Read B Group
Control B
Write
Port
Control B
Logic
INTERFACING OF 8254 WITH 8086
Ex.No. Date:
AIM:
To interface 8254 with 8086 and to generate a square waveform.
COMPONENT REQUIRED:
8086 microprocessor kit, flat cable, 8254 interface, CRO, Probe.
ALGORITHM:
Step 1 : Start
Step 2 : Send the control word to control register
Step 3 : Send the lower byte of the count through port A
Step 4 : Send the upper byte of the count through port A
Step 5 : Stop
CONTROL WORD:
SC1 SC0 M2 M1 M0
0 0 Select counter 0 0 0 0 Mode 0
0 1 Select counter 1 0 0 1 Mode 1
1 0 Select counter 2 0 1 0 Mode 2
1 1 Read back command X 1 1 Mode 3
1 0 0 Mode 4
1 0 1 Mode 5
OUTPUT
Amplitude 2.2V
Time Period :
V TON 0.6 0.1 ms
t
TOFF 0.6 0.1 ms
1 1
Frequency 8.33kHZ
T 1.2 0.1 ms
Programe Name: Interfacing of 8253 with 8086
RESULT:
Thus the assembly language program to interface 8254 with 8086 was written and
verified.
INTERFACING 8086 WITH 8259
Ex.No. Date:
AIM:
To write an assembly language program to interface 8259 programmable interrupt
controller with 8086.
ALGORITHM :
Step 1 : Start
Step 2 : Move the different control word to their respective control register
Step 3 : Move the control word in interrupt the Led in operational command
word.
Step 4 : Set interrupt.
ICW1
ICW2
A0 A15/T7 A14/T6 A13/T5 A12/T4 A11/T3 A10 A9 A8
OCW1 M7 M6 M5 M4 M3 M2 M1 M0
M7 – M0 - eight mask bit
M = 0 channel is enable
M = 1 channel is masked
ICW1 0 0 0 1 0 1 1 1 17H
ICW2 0 0 0 0 1 0 0 0 08H
ICW4 0 0 0 0 0 0 0 1 01H
OCW1 1 1 1 1 1 1 1 0 FEH
RESULT:
Thus the assembly language program to interface 8259 with 8086 was written and
verified.
INTERFACING 8086 WITH 8279
Ex.No Date:
AIM:
To write an assembly language program to interface 8279 with 8086
microprocessor kit.
COMPONENTS REQUIRED:
8086 Microprocessor kit, Flate cable, 8279 interface
ALGORITHM:
Step 1 : Get the control words for keyboard / display mode, clear
display mode and to rotate display RAM.
Step 2 : Send the control words to control register
Step 3 : Get the control words to display letters
Step 4 : Send it to the interface through the port A
Step 5 : Stop
8279 COMMANDS
D D
0 0 8 8 bit Character display Left entry
0 1 16 8 bit Character display Left entry
1 0 8 8 bit Character display Right entry
1 1 16 8 bit Character display Right entry
K K K
0 0 0 Encoded scan keyboard 2 key lock kit
0 0 1 Decoded scan keyboard 2 Key lock out
0 1 0 Encoded scan keyboard N key lock kit
0 1 1 Decoded scan keyboard N Key lock out
1 0 0 Encoded scan Sensor Matrix
1 0 1 Decoded scan Sensor Matrix
1 1 0 Stored input encoded Display scan
1 1 1 Stored input decoded Display scan
ii) Read FIFO / Sensor RAM
0 1 0 A1 X A A A
0 1 1 A1 A A A A
Address bits of
display RAM
1 0 0 A1 A A A A
1 1 0 CD CD CD CF CA
0X – All zeros
1 0 – AB = Hex 20 (0010 0000)
1 1 – All ones
vi) FIFO Status Word
DU S/E O U F N N N
No. of characters in
FIFO
FIFO FULL
Display
unavailable Error Under run
0 0 0 1 0 1 1 1 00H
Clear Mode
0 0 0 0 1 0 0 0 CCH
0 0 0 0 1 0 0 0 90H
FIFO Status
0 0 0 0 0 0 0 1 07H
Read FIFO
1 1 1 1 1 1 1 0 40H
1200 OC 9F 4A 0B
1204 99 29 28 0F
1208 08 09 88 38
120C 0C 1A 68 E8
1200 FF
1201 FF
1202 FF
1203 FF
1204 FF
1205 98 H
1206 68 E
1207 7C L
1208 C8 P
1209 FF
120A 1C U
120B 29 S
120C FF
120D FF
RESULT:
Thus the assembly language program to interface 8299 with 8086 was written ad
verified.
SERIAL COMMUNICATION OF 8086
Ex.No. Date:
AIM:
To write an assembly language program to establish serial communication
between two 8086 microprocessor kit.
ALGORITHM:
Step 1 : Initialize SI with 1500
Step 2 : Send the mode word through port 16
Step 3 : Send the command word through port 10
Step 4 : Assign the count
Step 5 : Read the status whether transmitter is empty or not
Step 6 : If transmitter is empty, send the data through port 08 and
increment SI
Step 7 : Compare the data with 3FH, if flag is not zero execute from step 4.
Step 8 : Otherwise decrement the count and on No zero execute from step 5
Step 9 : Stop
RECEIVER:
Step 1 : Initialize the SI with 1500
Step 2 : Assign the respective control word and count
Step 3 : Read the status whether receiver is ready or not. It it is ready
accept the data from port 08.
Step 4 : Increment SI and decrement the count
Step 5 : On No zero repeat from step 3 else stop.
COMPONENTS REQUIRED:
8086 Microprocessor kit, RS 232 Cable
D7 D6 D5 D4 D3 D2 D1 D0 Band rate
00 – SYN mode
01 – AGYN x 1
10 – ASYN x 16
11 – ASYN x 64
Framing
control
00 – NOT Valid Character
01 – 1 stop bit 00 – 5 bit
Parity control 01 – 6 bit
10 – 1 ½ stop bit X0 – No parity 10 – 7 bit
01 – ODD parity 11 – 8 bit
11 – EVEN parity
COMMAND WORD FORMAT
SYN TX RX TX
DSR FE OE PE
DET EMPY RDY RDY
MODE WORD
0 0 1 1 0 1 1 0
=36 OUTPUT:
STATUS WORD
0 0 0 0 0 1 0 0
=04
0 0 0 0 0 0 1 0
=02
Programe Name: Serial Communication (between two 8086 Microprocessor kit)
TRANSMITTER
AIM:
To write an assembly language program to transmit a byte from one 8086
microprocessor to another 8086 processor.
COMPONENTS REQUIRED:
8086 Microprocessor kits, 26 pin flat cable
ALGORITHMS:
TRANSMITTER
RECEIVER
1000 MOV AL, 9BH C6 Move the control
1001 C0 word to the al
1002 9B
1003 OUT 26, AL E6 Send it to control
1004 26 register
1005 MOV AL, 4BH E4 Get the data through
1006 20 Port 20
1007 88 Move the content
1008 OUT 20, AL 06 of AL in the
1009 00 Memory location
100A 12
100B HLT F4 Terminate the programe
RESULT:
Thus the assembly language program to perform parallel communication between
two 8086 microprocessor kit was written and verified.
INTERFACING ADC WITH 8086
Ex. No. Date:
AIM:
To write an assembly language program to convert an analog quantity into a
equivalent digital value using ADC interfaced with 8086.
ALGORITHM:
RESULT:
Thus the assembly language program to convert an analog input into digital
equivalent was written and verified.
INTERFACING DAC WITH 8086
Ex. No. Date:
AIM:
To generate different types of wave forms by interfacing a DAC card with 8086
microprocessor.
ALGORITHM:
SQUARE WAVE:
Step 1 : send low value to DAC and call delay
Step 2 : send high value to DAC and call delay
Step 3 : repeat from step 1
Step 4 : stop
TRIANGULAR WAVE:
Step 1 : send low value from BL to DAC
Step 2 : increment the value in BL
Step 3 : if BL is not zero, repeat from step 1 else move high value to BL
Register
Step 4 : send high value in BL
Step 5 : decrement the value in BL
Step 6 : if BL is not zero, repeat from step 4 else repeat from step 1
SAWTOOTH WAVE:
Step 1 : send the low value from AL to DAC
Step 2 : increment AL and send it to DAC, repeat from step 2 till it is not
Zero
Step 3 : go to step 1
RESULT:
Thus the assembly language program to generate different types of waveforms by
DAC was written and verified.
INTERFACING STEPPER MOTOR
Ex. No. Date:
AIM:
To interface a stepper more with 8086 microprocessor and to run it at different
speed.
COMPONENTS REQUIRED:
8086 Microprocessor, flat cable, stepper motor interface
ALGORITHM
Step 1 : get the data which indicates the direction of rotation of motor in
destination index
Step 2 : store the count in CL register
Step 3 : get the speed of the motor in AX register
Step 4 : get the data in AL register from DI
Step 5 : send the data through output port
Step 6 : keep decrementing the value in DX register till it becomes zero
Step 7 : increment DI and repeat from step 4
Step 8 : loop till the count becomes zero
Step 9 : jump to step 1
STEPPER MOTOR
A stepper motor is a device used to obtain an accurate position control of rotating shafts.
It employs rotation of its shaft in terms of steps, rather than continuous rotation as in case
of AC or DC motors. To rotate the shaft of the stepper motor, A sequence of pulses is
needed to b applied to the windings of the stepper motor in a proper sequence
With a pulse applied to the winding input the rotor rotates by one teeth position or an
angle x. The angle x may be calculated as
X = 360 / no. of rotor teeth
RESULT
Thus the assembly language perform to interface the stepper motor with 8086 was
written and verified.
DC MOTOR CONTROL AND SPEED MEASUREMENT
AIM:
To write an assembly language program to control DC motor and measure the
speed.
COMPONENTS REQUIRED:
8086 Microprocessor Kit,, DC motor interface
ALGORITHM:
Step 1 : Start
Step 2 : Set the high value for DAC to make active
Step 3 : Make the gate signal low for 8253 to be low and call the delay
Step 4 : Initialize the control word format of 8253 and initialize the count
to the counter of 8253.
Step 5 : Make the gate signal high and call delay and once again make the
gate signal to low
Step 6 : Store the lower byte and upper byte of the count to different
Addresses
Step 7 : In delay move the high value to register and it is decrement until
each on set the zero flag according to the loop
Step 8 : Stop
SPEED CALACULATION
RESULT:
Thus the assembly language program to control a DC motor was written and
verified.