Sie sind auf Seite 1von 21

Microprocessors Sessional

CSE3108
8255 Programmable Peripheral Interface
Controller

7-Segment Display PAR 19H

Led Display PBR 1BH

Display PCR 1DH

Control Register CR 1FH

2
I/O Interface Controller
• It has 24 bit input/output pins
• It consists of three ports: port A, port B and port C- all of which are 8
bits
• It also consists of a eight bit control register(CR)
• The eight bit of port C can be used as individual bits or be grouped in
two four bit ports: Cupper(CU) and Clower(CL)
• The functions of these ports are defined by writing a control word in
the control register

Group A Group B

Port A Port B

Port C (Upper 4 bit) Port C (Lower 4 bit)

3
Mode of Operation in 8255

Operation Mode

0
1
BSR Mode
I/O Mode
Bit set and reset mode

Mode 1 Mode 2
Mode 0 Handshaking Mode Only for port A
Simple I/O for port A, port B Port A and/or port B use bits Bidirectional data bus for port
and port C from port C as handshaking A using handshake signals from
signal port C

4
Control Register
D7 D6 D5 D4 D3 D2 D1 D0

1 0 0 0 0 0 0 0

Control Mode selection for Port A Upper 4 Mode selection For For lower
Register group A 0- bit of for group B port B 4 bit of
0- BSR 00- I/O Output port C 0- I/O port C
mode 01- Handshaking 1- Input 1-
1- I/O Handshaking
mode

5
Seven Segment Display
• For seven segment display we use 0 for ON and 1 for OFF
• Two glow four we need to turn on b, c, f and g
• So value will be 99H

PA7 PA6 PA5 PA4 PA3 PA2 PA1 PA0


1 0 0 1 1 0 0 1

g f e d c b a

6
How to Display Output in 8086
Microprocessor
• At first copy paste the .ASM file in the mda folder of computer
• Then open cmd and write cd\ and press enter
• Then type cd mda and press enter
• Then type MASM and press enter
• Then write the .ASM file name and press enter. For our example we
will write S.ASM
• Then write the .OBJ file name and press enter. For our example we
will write S.OBJ
• Then write the .LST file name and press enter. This step is used for
error checking. For our example we will write S.LST

7
How to Display Output in 8086
Microprocessor
• Then when it wants .CRF file simply press enter
• After that type LOD186 and press enter
• Then type .OBJ file name and press enter. For our example we will
write S.OBJ
• Then type .ABS file name and press enter. For our example we will
write S.ABS
• Then type COMM and press enter.
• Then a blue window will occur
• We will now turn on the kit and we will select PC mode from kit mode
• Then press RESET

8
How to Display Output in 8086
Microprocessor
• If your kit is ok then it will show up in the blue screen
• Then type L from keyboard and press enter
• If L does not shows up then it means your PC is not connected and
you have to try in different PC
• Otherwise press F3 and in the pop-up screen write filename.ABS and
press enter. For our example we will write S.ABS
• Then in the kit select kit mode from PC mode
• Then press RESET
• After that press AD
• Then Press GO
• Then you can see the output in the seven segment display

9
LED Display
• For LED display we use 1 for ON and 0 for OFF
• Two glow R1 we need to turn on PB0
• So value will be 01H R1(PB0) G(PB1)

Y(PB2) R2(PB3)

PB7 PB6 PB5 PB4 PB3 PB2 PB1 PB0


0 0 0 0 0 0 0 1

R2 Y G R1

10
How to Display Output in 8086
Microprocessor
• At first copy paste the .ASM file in the mda folder of computer
• Then open cmd and write cd\ and press enter
• Then type cd mda and press enter
• Then type MASM and press enter
• Then write the .ASM file name and press enter. For our example we
will write L.ASM
• Then write the .OBJ file name and press enter. For our example we
will write L.OBJ
• Then write the .LST file name and press enter. This step is used for
error checking. For our example we will write L.LST

11
How to Display Output in 8086
Microprocessor
• Then when it wants .CRF file simply press enter
• After that type LOD186 and press enter
• Then type .OBJ file name and press enter. For our example we will
write L.OBJ
• Then type .ABS file name and press enter. For our example we will
write L.ABS
• Then type COMM and press enter.
• Then a blue window will occur
• We will now turn on the kit and we will select PC mode from kit mode
• Then press RESET

12
How to Display Output in 8086
Microprocessor
• If your kit is ok then it will show up in the blue screen
• Then type L from keyboard and press enter
• If L does not shows up then it means your PC is not connected and
you have to try in different PC
• Otherwise press F3 and in the pop-up screen write filename.ABS and
press enter. For our example we will write L.ABS
• Then in the kit select kit mode from PC mode
• Then press RESET
• After that press AD
• Then Press GO
• Then you can see the output in the seven segment display

13
Assignment 01 (Group A1)

Group Seven Segment Display

01 A85

02 L7H

03 063

04 P52

05 4EJ

06 02A

14
Assignment 01 (Group A2)

Group Seven Segment Display

07 L6o

08 P73

09 06H

10 A12

11 0EJ

12 08A

13 5F4

15
Assignment 01 (Group B1)

Group Seven Segment Display

14 A96

15 C3L

16 06H

17 5AP

18 E30

19 A9U

20 1F2

16
Assignment 01 (Group B2)

Group Seven Segment Display

21 L6A

22 20H

23 J5O

24 6E7

25 P5S

26 GD2

27 09E

17
Assignment 02 (Group A1)

Group LED Display

01 R2(ON)-Y(ON)-R2(OFF)-R1+G(ON)

02 G(ON)-R2(ON)-Y(ON)-R2+Y(OFF)

03 R1(ON)-R1(OFF)-Y+G(ON)-R2(ON)

04 Y(ON)-G(ON)-G(OFF)-R1+R2(ON)

05 R1+G(ON)-G(OFF)-Y(ON)-R1(OFF)

06 R2+Y(ON)-G(ON)-Y(OFF)-R1(ON)

18
Assignment 02 (Group A2)

Group LED Display

07 R1(ON)-Y(ON)-Y(OFF)-R2+G(ON)

08 Y(ON)-R2(ON)-Y+R2(OFF)-G(ON)

09 G(ON)-R1(ON)-R1(OFF)-Y+R2(ON)

10 Y(ON)-R1(ON)-G(ON)-R1+Y(OFF)

11 R1(ON)-G+Y(ON)-Y(OFF)-R1(OFF)

12 R2+G(ON)-G(OFF)-Y(ON)-R2(OFF)

13 G+R1(ON)-R1(OFF)-Y(ON)

19
Assignment 02 (Group B1)

Group LED Display

14 R1(ON)-R1(OFF)-Y+G(ON)-R2(ON)

15 R2+G(ON)-G(OFF)-Y(ON)-R2(OFF)

16 R1+G(ON)-G(OFF)-Y(ON)-R1(OFF)

17 R1(ON)-Y(ON)-Y(OFF)-R2+G(ON)

18 R2(ON)-Y(ON)-R2(OFF)-R1+G(ON)

19 G+R1(ON)-R1(OFF)-Y(ON)

20 Y(ON)-G(ON)-G(OFF)-R1+R2(ON)

20
Assignment 02 (Group B2)

Group LED Display

21 G(ON)-R2(ON)-Y(ON)-R2+Y(OFF)

22 Y(ON)-G(ON)-G(OFF)-R1+R2(ON)

23 R2+Y(ON)-G(ON)-Y(OFF)-R1(ON)

24 R1+G(ON)-G(OFF)-Y(ON)-R1(OFF)

25 R1(ON)-R1(OFF)-Y+G(ON)-R2(ON)

26 Y+R1(ON)-Y+R1(OFF)-G(ON)

27 R1(ON)-Y(ON)-G(ON)-R1+G(OFF)

21

Das könnte Ihnen auch gefallen