Académique Documents
Professionnel Documents
Culture Documents
International Scholarly and Scientific Research & Innovation 5(12) 2011 1494 scholar.waset.org/1307-6892/5447
World Academy of Science, Engineering and Technology
International Journal of Computer and Information Engineering
Vol:5, No:12, 2011
I/O control lines are connected with DMA module and the VDD
+
C25 C26
system buses are used by the main processor and the DMA 47uF 10n
GND
controller alternatively.
The main part which involved in the parallel input/ output
interface system are two IC8255A, 74LS138, eight 7-
VDD VDD
segments, parallel printer port . 8255A has two address lines, D[0..15]
26
26
U26 U27
indicating that it has 4 read/write registers within it which the D0 34
D0 PA0
4 PA0 D0 34
D0 PA0
4 PD0
VC C
VC C
VDD D1 33 3 PA1 D1 33 3 PD1
D2 32 D1 PA1 2 PA2 D2 32 D1 PA1 2 PD2
CPU has to address. The address bits from PIO chips are D3
D4
31
30
D2
D3
PA2
PA3
1
40
PA3
PA4
PA[0..7]
D3
D4
31
30
D2
D3
PA2
PA3
1
40
PD3
PD4
PD[0..7]
D5 D4 PA4 PA5 D5 D4 PA4 PD5
connected to the 74LS138 decoder of the address lines to R61
2.2k
R62 R63 R65
2.2k 2.2k 2.2k D6
D7
29
28
27
D5
D6
PA5
PA6
39
38
37
PA6
PA7
D6
D7
29
28
27
D5
D6
PA5
PA6
39
38
37
PD6
PD7
D7 PA7 D7 PA7
decode the address from the 16 address bits from the trainer. IORD
IORD
IOWR
5
RD PB0
18 PB0
PB1
IORD
IOWR
5
RD PB0
18 PE0
PE1
IOWR 36 19 36 19
WR PB1 WR PB1
The 74LS138 is used to produce chip selects signals for 8255 9
8 A0
A1
PB2
PB3
20
21
PB2
PB3
PB[0..7]
9
8 A0
A1
PB2
PB3
20
21
PE2
PE3
PE[0..7]
35 22 PB4 35 22 PE4
RESET
and other I/O devices. This will generate the appropriate VDD
6 RESET
CS
PB4
PB5
PB6
23
24
PB5
PB6
6 RESET
CS
PB4
PB5
PB6
23
24
PE5
PE6
R64 25 PB7 25 PE7
output to drive the chip selects of the respective chips. The 1k U19 PB7 PB7
16
15 16 PC2 16 PF2
Y0 14 PC2 17 PC3 PC2 17 PF3
Y1 PC3 PC[0..7] PC3 PF[0..7]
A4 1 13 13 PC4 13 PF4
At first, in one of the 8255 PIO device, port C is initialized A5 2
A6 3
A Y2
B Y3
12
11
PC4
PC5
12
11
PC5
PC6
PC4
PC5
12
11
PF5
PF6
C Y4 PC6 PC6
G N D
G N D
PC7 PF7
in mode 1 for handshaking data transfer and Port A is used as 4
Y5
Y6
10
9
7
PC7
10
PC7
10
8255 8255
G2A Y7
the data port. Port C 4 is used as the strobed line for the printer
7
5
G2B
G N D
connected to the printer port of pin number 10. The input A[0..15]
A0
A1
International Scholarly and Scientific Research & Innovation 5(12) 2011 1495 scholar.waset.org/1307-6892/5447
World Academy of Science, Engineering and Technology
International Journal of Computer and Information Engineering
Vol:5, No:12, 2011
T10
T11
T12
T13
T14
T15
T16
T17
T18
T19
T20
T21
T22
T23
T24
T25
T26
T27
T28
T29
T30
T31
T32
T33
T34
T35
T36
T37
T38
T39
T40
T10
T1
T2
T3
T4
T5
T6
T7
T8
T9
T1
T2
T3
T4
T5
T6
T7
T8
T9
POWER
1
2
3
4
5
6
7
8
9
D9 10
D10 11
D11 12
D12 13
D13 14
D14 15
D15 16
MEMWR 17
MEMRD 18
19
20
A0 21
A1 22
A2 23
A3 24
A4 25
A5 26
A6 27
A7 28
A8 29
A9 30
A10 31
A11 32
A12 33
A13 34
A14 35
A15 36
DMA ACK37
DMA REQ38
KEY INT 39
RESET 40
1
2
3
4
5
6
7
8
9
10
J2
BUS
J1
D0
D1
D2
D3
D4
D5
D6
D7
D8
VDD
IOWR
IORD
1. Flow of the Download Program
This software is written on the PC to download the test
PD0
PD1
PD2
PD3
PD4
PD5
PD6
PD7
PE0
PE1
PE2
PE3
PE4
PE5
PE6
PE7
PF0
PF1
PF2
PF3
PF4
PF5
PF6
PF7
download program from it. First a number of lines are
40
39
38
37
18
19
20
21
22
23
24
25
14
15
16
17
13
12
11
10
4
3
2
1
PA0
PA1
PA2
PA3
PA4
PA5
PA6
PA7
PB0
PB1
PB2
PB3
PB4
PB5
PB6
PB7
PC0
PC1
PC2
PC3
PC4
PC5
PC6
PC7
calculated to get a line in the test download program and
T1 T1
PC0 1 T2 PF0 1 T2
PC1 2 T3 PF1 2 T3
3 3
VDD
PORTC
5 5
extract byte count, address MSB, address LSB and data type.
PORTF
PC4 T6 PF4 T6
8255
U27
WR
PC5 6 PF5 6
RD
CS
D0
D1
D2
D3
D4
D5
D6
D7
T7 T7
A0
A1
PC6 7 T8 PF6 7 T8
PC7 8 T9 PF7 8 T9
34
33
32
31
30
29
28
27
5
36
9
8
35
6
9 T10 9 T10
If the data type is equal to 01, the data byte is sent zero and
10 10
J5
J8
D0
D1
D2
D3
D4
D5
D6
D7
A0
A1
A5
PB0
PB1
PB2
1
2
3
T1
T2
T3
T4
PE0
PE1
PE2
1
2
3
T1
T2
T3
T4
sent the address MSB, sent the address LSB and sent the data
PORTB
PB3 4 T5 PE3 4 T5
type 01- the end of the signal. The length or byte count,
PORTE
PB4 5 T6 PE4 5 T6
PB5 6 T7 PE5 6 T7
PB6 7 T8 PE6 7 T8
PB7 8 T9 PE7 8 T9
9 9
PB0
PB1
PB2
PB3
PB4
PB5
PB6
PB7
J4
J7
checking the data type is equal to 00. Sending the start signal,
40
39
38
37
18
19
20
21
22
23
24
25
14
15
16
17
13
12
11
10
4
3
2
1
IOWR
T1
IORD
PA0 1 T2 T1
PA0
PA1
PA2
PA3
PA4
PA5
PA6
PA7
PB0
PB1
PB2
PB3
PB4
PB5
PB6
PB7
PC0
PC1
PC2
PC3
PC4
PC5
PC6
PC7
PA1 2 T3 PD0 1 T2
PA2 3 T4 PD1 2 T3
PORTA
4 3
checking the busy signal, and sending strobed signal use write
PA3 T5 PD2 T4
PORTD
PA4 5 PD3 4
VDD
VCC GND T6 T5
26 7 PA5 6 T7 PD4 5 T6
RESET
PA6 7 T8 PD5 6 T7
8255
U26
8 7
WR
PA7 PD6
RD
CS
D0
D1
D2
D3
D4
D5
D6
D7
T9 T8
A0
A1
port program.
9 T10 PD7 8 T9
10 9 T10
34
33
32
31
30
29
28
27
5
36
9
8
35
6
10
J3
J6
D0
D1
D2
D3
D4
D5
D6
D7
A6
IOWR
IORD
C26
10n
checked. If the ACK isn’t send from the PIO, the counter is
2.2k
R65
International Science Index, Computer and Information Engineering Vol:5, No:12, 2011 waset.org/Publication/5447
VDD
47uF
C25
2.2k
R63
+
2.2k
R62
R64
1k
message is displayed that the port is busy. But if not, the start
2.2k
R61
GND
VDD
International Scholarly and Scientific Research & Innovation 5(12) 2011 1496 scholar.waset.org/1307-6892/5447
World Academy of Science, Engineering and Technology
International Journal of Computer and Information Engineering
Vol:5, No:12, 2011
Send Acknowledge
Signal to PC (ACK) Store in Address
Counter LSB
Yes
Is it Stop Signal? halt
Divide Word Counter
By 2 to get word No
Store in Address
Counter MSB Store in Data LSB
Register
Send Acknowledge
Signal to PC (ACK) Increase Address
Counter
C Word Counter = 0?
No
Yes
Fig.3 (a) Flow Chart of Parallel Port Driver
A
Fig. 3(b) Flow Chart of Parallel Port Driver (Continued)
International Scholarly and Scientific Research & Innovation 5(12) 2011 1497 scholar.waset.org/1307-6892/5447
World Academy of Science, Engineering and Technology
International Journal of Computer and Information Engineering
Vol:5, No:12, 2011
Polling
Download
B Get a Line
Is it Set ?
No
Yes
Extract
Byte Count
Read Data Port Address MSB
Address LSB
Data Type
International Science Index, Computer and Information Engineering Vol:5, No:12, 2011 waset.org/Publication/5447
Return
No
Fig. 4 Flow Chart of Polling Is Data Type = Is Data Type =
00? 01?
Yes Yes
Convert Length, Send Byte: 0
Address MSB, Address Send Address
LSB to MSB
Hex Number Send Address
LSB
Send Type: 01
Ack Send Start Signal
“:” (Write Port) Exit
Clear Acknowledge
Received Ack Signal Yes
Pin A
from the Device?
No
Wait Count + +
No Yes
Count = 3? Abort
Set Acknowledge
Pin
Fig. 6(a) Flow Chart of Download
Wait
Return
International Scholarly and Scientific Research & Innovation 5(12) 2011 1498 scholar.waset.org/1307-6892/5447
World Academy of Science, Engineering and Technology
International Journal of Computer and Information Engineering
Vol:5, No:12, 2011
Write Port
No
Device Acknowledge? Abort
Yes
No
Is Port Busy?
Send
Address MSB
Yes
No
Has Time Out?
Send
Address MSB
Yes
International Science Index, Computer and Information Engineering Vol:5, No:12, 2011 waset.org/Publication/5447
Send Data to
Return Printer Port LPT1
Is Data Length > 0? No
B
Yes
Generate Strobed pulse
Send Data byte
No
No Device
Decrease Data Length
Has Time Out? Acknowledged ?
Return
VDD
GND R3 R4 R5 R6 R7 R8 R9 R10
4.7k 4.7k 4.7k 4.7k 4.7k 4.7k 4.7k 4.7k
Q2SA733 Q2SA733 Q2SA733 Q2SA733 Q2SA733 Q2SA733 Q2SA733 Q2SA733
Fig. 8 Flow Chart of Write Port
Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8
R11 R12 R13 R14 R15 R16 R17 R18
4.7k 4.7k 4.7k 4.7k 4.7k 4.7k 4.7k 4.7k
Dg
Da
Db
Dg
Da
Db
Dg
Da
Db
Dg
Da
Db
Ag
Aa
Ab
Ag
Aa
Ab
Ag
Aa
Ab
Ag
Aa
Ab
Df
Df
Df
Df
Af
Af
Af
Af
1
2
3
4
5
1
2
3
4
5
1
2
3
4
5
1
2
3
4
5
1
2
3
4
5
1
2
3
4
5
1
2
3
4
5
1
2
3
4
5
Ae10
Ad 9
8
Ac 7
6
Ae10
Ad 9
8
Ac 7
6
Ae10
Ad 9
8
Ac 7
6
D e1 0
Dd 9
8
Dc 7
6
D e1 0
Dd 9
8
Dc 7
6
D e1 0
Dd 9
8
Dc 7
6
D e1 0
Dd 9
8
Dc 7
6
U4 VDD
74LS573
20
20
GND
DIO7 9 D7 Q7 12 U6 U8
D8 Q8 GND 1 ULN2004A GND 1 ULN2004A
VCC
VCC
OC OC
9
11 4.7k 11 47
C C
10
C OM
GND
C3 DIO7 D7 Q7 7B 7C DIO7 D7 Q7 7B 7C
9 12 9 12
GND
GND
C4 D8 Q8 D8 Q8
C4
10
10
8
DIO[0..8]
DIO[0..15]
LATD
LATA
International Scholarly and Scientific Research & Innovation 5(12) 2011 1499 scholar.waset.org/1307-6892/5447
World Academy of Science, Engineering and Technology
International Journal of Computer and Information Engineering
Vol:5, No:12, 2011
Start Start
Set up 8255
Load LED Pattern
Wait
Count = 8
R3 to Port A
Clear Port C7
Shift R3 Left
International Scholarly and Scientific Research & Innovation 5(12) 2011 1500 scholar.waset.org/1307-6892/5447
World Academy of Science, Engineering and Technology
International Journal of Computer and Information Engineering
Vol:5, No:12, 2011
ACKNOWLEDGMENT
First of all, the author would like to express Her Gratitude
to Professor Dr. Nilar Thein, Rector of University of
Computer Studies, Yangon, for overall supporting during her
paper and encouragement for this paper.
The author would like to express Her Deep Appreciation to
Pro Rector U Kyaw Swa Soe, University of Computer Studies,
Yangon, for providing the facilities, guidance, invaluable
advice and supervision throughout her paper.
The author would like to thank Deputy Director General U
Win Khine Moe, Myanmar Science and Technological
Research Department who advise her to do this paper.
The author is also grateful to Professor Daw New Ni,
University of Computer Studies, Yangon, for this suggestion
and helpful advice throughout her paper.
International Science Index, Computer and Information Engineering Vol:5, No:12, 2011 waset.org/Publication/5447
REFERENCES
[ 1] Andrew S. Tanenbaum, “structured computer organization”
[ 2] Arthur B. Williams, Editor in Chief Research, and Development
“Designer’s andbook of integrated circuits” Coherent
Communications Systems Cop. Hauppauge, N.Y
[ 3] Douglas V.Hall, “Microprocessors and interfacing programming and
hardware” econd edition
[ 4] Hutchings, Howard “British Library Cataloguing in Publication Data”
Interfacing with C/ Howard Hutchings. First published 1995
[ 5] John Uffenbeck, “Microcomputers and microprocessors” the 8080,
8085, and Z-80 programming, interfacing, and troubleshooting. Second
Edition. ©1991, 1985 by Prentice-Hall, Inc. A Division of Simon &
Schuster Englewood Clifts. NJ 07632
[ 6] Ken Arnold, Embedded Controller Hardware Design”.
[ 7] Mark Balch, “COMPLETE DIGITAL DESIGN” A Comprehensive
Guide to Digital Electronics and Computer System Architecture.
[ 8] Martin Bates, “Interfacing PIC Microcontrollers Embedded Design by
Interactive Simulation”.
[ 9] Murry Sargent 111 and Richard L. Shoemaker, “The IBM personal
computer rom the inside out” revised edition.
[10] Roy goody, “Programming and interfacing the 8086/8088
microprocessor”.
[11] Sajjan G. Shiva,“Computer design and architecture” third addition,
revised and expended.
[12] S.A.Money, “Microprocessor data book”.
[13] Jan Axelson, “Parallel Port Complete Programming, Interfacing, &
Using the PC's Parallel Printer”
[14] James M.Sibigtroth, “M68HC05 Family, Understanding Small
Microcontrollers-Rev. 2.0”,
International Scholarly and Scientific Research & Innovation 5(12) 2011 1501 scholar.waset.org/1307-6892/5447