You are on page 1of 7

Copyright© 1998 Robert Woudsma



port i)sta--ed o) it 1o--o' the pro&edure out-i)ed be-o'+ Copyright© 1998 Robert Woudsma. -i)e1eed.ed at dire&t-y dri/i)g eight !ED0s 'ith the eight digitaoutputs o1 the !PT port+ #) this &ir&uit 'e 'i-.port+ The &ir&uit &o)sists o1 o)-y t'o &hips a)d the additio) o1 o)e &o)tro. e)sure that the spe&i1i&atio) 1or the pri)ter port is stated as bei)g either EPP 1or E)ha)&ed Para--e.pri)ter port spe&i1i&atio) >&a--ed $PP 1or $ta)dard Para--ePort? did )ot a--o' 1or readi)g 83bit data through the data port.e2pa)d the i)ter1a&e &apabi-ity to i)&-ude both 'riti)g to a)d readi)g 1rom /arious e2ter)a.port spe&i1i&atio)+ Whe) &hoosi)g a para--e.port or mu-ti31u)&tio) #* &ard./arious 1u)&tio)s o1 the pri)ter su&h as i)itia-i.ports+ ) the other ha)d.output e11e&ti/e-y &reati)g a bi3 dire&tio)a. ma)y mu-ti3 1u)&tio) #* &ards that you &a) buy today to p-ug i)to your &omputers motherboard may sti-.a)d pri)ter ports i)tegrated i)to the motherboard &o)tai) bi3dire&tio)a. or busy or pri)ter o)-i)e et&+ These bits are read by readi)g the 5 most sig)i1i&a)t bits 1rom the !PT1 base #* address 91.)o' i1 your &omputer has a) EPP or ECP para--e.i) Atta&hed is a &ir&uit diagram o1 a simp-e !PT port i)ter1a&e that pro/ides 1or eight bits o1 digita. et&+ These bits &a) be &o)tro--ed by 'riti)g to the -east sig)i1i&a)t 6 bits o1 the !PT1 base #* address 9<.Port or ECP 1or E2te)ded Capabi-ities Port+ Either o1 these t'o spe&i1i&atio)s a--o' 1or bi3dire&tio)a.Reading & Writing through the Enhanced Parallel Port (EPP) Part A: Building and Testing the Interface This pro%e&t has t'o parts( &o)stru&ti)g the #)put* utput &ir&uit a)d 'riti)g the test routi)e+ The Simple PT Interface #) pro%e&t .spe&i1i&atio) 1or the !PT port a--o's 1or o)-y data 1-o' i) o)e dire&tio). 1rom the &omputer to the pri)ter+ 4ut the pri)ter port is a&tua--y made up o1 three se&tio)s( the 83bit output data 1-o'+ #) order to .digita.-i)e 1rom the !PT port+ The Parallel Printer Port !ard"are The origi)a.port+ • The DATA port &o)tai)s eight bits o1 data that are a&&essib-e by 'riti)g to the !PT 1 port base #* address. this &apabi-ity bega) appeari)g 'ith #4@0s P$3< -i)e o1 &omputer systems+ @ost &omputer systems today that are so-d 'ith the seria.o)-y &o)tai) the $PP para--e. usua--y 788 He2 or 888 De&+ • 4eside the data output port there is a 1i/e bit $TATU$ i)put port through 'hi&h the &omputer &ou-d get status i)1ormatio) 1rom the pri)ter su&h as paper out. the 53bit i)put port a)d the 63bit output &o)tro. usua--y 789 he2 or 889 De&+ • :i)a--y there is a 1our bit C NTR ! port that is used to &o)tro. UPPER CANADA TECHN ! "#E$ . usua--y 78= he2 or 89= De&+ The #i$directional Printer Port A-though the origi)a.i)put a)d eight bits o1 digita.1 'e -oo.

o) the !PT item i) the -ist+ A APri)ter Port PropertiesB s&ree) 'i-.escription The $imp-e Pri)ter Port #)ter1a&e Cir&uit The &ir&uit 1or a simp-e !PT i)ter1a&e is sho') o) a) atta&hed page+ #t &o)tai)s the 1o--o'i)g se&tio)sE • A 86A!$587 tra)spare)t o&ta. EPP or ECP type+ #1 )ot. doub-e3&-i&.Pa)e. you &a) pur&hase a EPP or ECP pri)ter port board a)d add it to your &omputer at a &ost o1 D7= or -ess+ $e&o)d-y you &a) do')-oad the Interface 'ircuit . o) this item to e2pa)d the -isti)g+ The -ist shou-d &o)tai) at -east o)e !PT port a)d o)e or more C @ ports+ The -isti)g may a-ready state that the !PT port is a) $ used to -ight 8 !EDs or a)y de/i&e that you 'ish to se)d digitasig)a-s to+ Copyright© 1998 Robert bui-di)g here+ #1 it is a $PP though. 'ith this &ir&uit+ Cou the) ha/e t'o optio)s+ :irst-y. 'ith the &ir&uit 'e 'i-.e sure that the . UPPER CANADA TECHN ! "#E$ .e-ice %anager tab is se-e&ted+ Amo)g the de/i&es that are -isted u)der De/i&e @a)ager there shou-d be a) item &a--ed P(RTS ('(% & PT)+ Doub-e3&-i&.se-e&t S+STE%* :rom the system properties dia-og bo2 ma.)ot 'or. se-e&t '()TR( PA)E * :rom the Co)tro.• • • • :rom the A%& 'omputerB i&o) or 1rom the Wi)do's 95 AStartB butto) a)d Settings se-e&tio).output port 'hi&h 'i-.D !at&h to pro/ide a) 83bit digita. it ' disp-ayed as sho') be-o'+ Printer Port Properties Page • #1 the des&riptio) suggests the pri)ter port is a) EPP or ECP type the) it 'i-'or.

/a-ue o1 77+ 'onstructing the Interface The i)itia.ed together to 1orm as -arge a proto3typi)g area as you 'ish+ A diagram o1 a typi&a.tra)s&ei/er to pro/ide a) 83bit digita.1 to a -o'?+ This 'ou-d reFuire a de&ima.1 is -o' the 86<65 'i-.proto3 board se&tio) is sho') be-o'+ .• A 86!$<65 o&ta.&o)tai) data to be read by the &omputer a)d at other times ' =+ Whe) pi) .be tra)s1erred to it0s output a)d &a) be read by by the program+ Whi-e the Co)tro.i)put port 'hi&h i)put data 1rom 8 s'it&hes or a)y de/i&es that you 'ish to read digitai)1ormatio) 1rom+ 'ircuit (peration The 8 data -i)es o1 the !PT port )o' 1orm a data bus. 'hi&h at times ' -at&hed a)d he-d o) it0s output+ Whe) pi) .1 is high data 'ritte) 1rom the !PT port 'i-.1 a high? a)d C5 to a -o' i) order to i)itiate a 'rite+ This 'ou-d reFuire a de&ima/a-ue o1 =+ #) order to i)itiate a read C5 must be brought high a)d C= must be made high >setti)g pi) .the read*'rite operatio)s o1 the !PT port itse-1+ The program must there1ore set both bit C= to a -o' >to ma.&arry the data to be de-i/ered 1rom the &omputer to the digita. UPPER CANADA TECHN ! "#E$ .register is set to a 1 by the program the -ogi& state at pi) 1 o1 the Db3<5 'i-. Co)tro.iagram of a single proto$#oard section Copyright© 1998 Robert Woudsma.register bit C= is used to &o) tra)s1erred to the !EDs through the 86587 'hi-e the 86<65 is iso-ated 1rom the data bus+ Whe) pi) .output+ 4oth #C0s are &o)tro--ed by the Co)tro.bi3dire&tio) e)ab-ed a)d data prese)t o) it0s i)put 'i-.register bit C=+ Note that C= is a) i)/erted output 'hi&h mea)s that 'he) data bit = i) the Co)tro.the t'o &hips i) the &ir&uit.e pi) .1 is brought -o' the data that is prese)t at the i)put o1 the 86587 at that i)sta)t 'i-.register bit C5 is used to &o)tro.&o)stru&tio) o1 the i)ter1a&e shou-d be do)e o) e-e&tro)i& proto3typi)g boards or Aproto3boardsB+ Proto3boards are arra)ged to a&&ept i)tegrated &ir&uit &hips a)d e-e&tro)i& &ompo)e)ts a)d a--o's the i)ter&o))e&tio) o1 the &ompo)e)ts to 1orm &omp-ete &ir&uits+ Proto3boards &a) be i)ter-o&.

&ause a si)g-e read 1rom the !PT port a)d disp-ay it i) the te2t bo2 to the right o1 the butto)+ To 'rite a /a-ue out o1 the !PT e)ter a /a-id /a-ue i) the A'riteB te2t bo2 a)d either press ENTER or &-i&. o) the AWrite DataB &omma)d butto)+ #1 the e)tered data is /a-id. bet'ee) = a)d < a)d 'rite test program 'ith sour&e &ode has bee) i)&-uded i) Gisua.register 1or read a)d 'rite operatio)s+ The user i)ter1a&e is sho') be-o'+ The &ode -isti)gs 1or the ARead DataB a)d AWrite DataB &omma)d butto)s are a-so sho') i) the tab-e be-o'+ The program operatio) is Fuite straight1or'ard+ C-i&.adapter a)d &o))e&t it i)to the &ir&uit as you 'ou-d the battery+ The 88=5 regu-ator &a) regu-ate a)y supp-y /o-tage 1rom 8 to <5/ DC do') to the reFuired 5 / 1or this &ir&uit+ Programming the Interface A simp-e 'ritte)+ Copyright© 1998 Robert Woudsma.The reFuired #Cs a)d /arious other parts 1or the i)ter1a&e are -isted be-o'+ Use the &ir&uit sho') to bui-d the &omp-ete pri)ter port i)ter1a&e+ The -ayout o1 the parts shou-d o&&upy < proto3boards.ip 1i-e+ #t sho's the basi& 1ormat 1or setti)g the bits i) !PT &o)tro.i)g o) the ARead DataB &omma)d butto) 'i-.e troub-e3shooti)g easier i1 it is )e&essary -ater+ Note that pi)s 18 through <5 o) the !PT port are i)ter)a--y &o))e&ted together a)d to grou)d+ Co))e&t po'er supp-y grou)d to a)y o)e o1 these pi)s+ Po"er Suppl& This se&o)d pro%e&t )eeds a) e2ter)a. the 83bit D#P s'it&h a)d the 8 !EDs+ Ta. o)e 1or the D#P3<6 &o))e&tor 1rom the !PT port &ab-e a)d a)other to ho-d the t'o #C0s. the) the /a-ue 'i-.a-'ays ma.po'er supp-y to operate+ The &ir&uit is po'ered by a si)g-e 5 /o-t supp-y 'hi&h &a) be app-ied dire&t-y or &o)stru&ted usi)g a 9/o-t battery a)d the 88=5 /o-tage regu-ator+ A) a-ter)ate arra)geme)t is to use a 8/DC or higher 'a-. UPPER CANADA TECHN ! "#E$ .e the time to -ay out a )eat &ir&uit+ This 'i-.4asi& /ersio) 5+= i) the A!PTD# B .

a--o' 'riti)g o1 data 'ithout ha/i)g to e)ter it )umeri&a--y i) the te2t bo2+ As the bar is mo/ed by the mouse /a-ues 'i-.The 'i-.&o)ditio) a)d error &he&.s&ro-.o)ta. UPPER CANADA TECHN ! "#E$ .i)g at the &ode 1or the A'riteB te2t bo2 'hi&h &o)tai)s some 'ritte) to the !PT port a)d -isted i) the AWriteB te2t bo2+ $pe)d some time -oo.i)g routi)es that you may 'a)t to -ater i)&-ude i) your o') programs+ Copyright© 1998 Robert Woudsma.

Read a digital -alue from the .-oo.1 to go -o'.1 to go high. e)ab-i)g the 86!$<65 Ioport4*address 5 #ase 6 0 Ioport4*7alue 5 88 HNo' read the !PT Data port >base? pi)s a)d disp-ay the /a-ue Ioport4*address 5 #ase 7alue 5 Ioport4*7alue t9tread*Te9t 5 7alue End Su# Write a digital -alue through the . e)ab-i)g the 86A!$587 Ioport4*address 5 #ase 6 0 Ioport4*7alue 5 : HNo' 'rite the /a-ue i) the I'riteI te2t bo2 to the !PT data register >base? Ioport4*address 5 #ase Ioport4*7alue 5 7al(t9t"rite*Te9t) End Su# )e9t Pro. UPPER CANADA TECHN ! "#E$ .register >base 9 <? bit HC5 >si2th bit? to = to a--o' a 'rite a)d bit C= >1irst bit? to a = Hto to &ause the pi) .8 Pri-ate Su# cmd"rite2'lic3() HTo 'rite to the port p-a&e &o)tro./ S0/1 Pri-ate Su# cmdread2'lic3() HTo read 1rom the port p-a&e &o) a)a-og &o)/erter+ Copyright© 1998 Robert Woudsma.register >base 9 <? bit HC5 >si2th bit? to 1 to a--o' a read a)d bit C= >1irst bit? to a 1 Hto to &ause the pi) ./A S1.&o)/erter a)d digita.ect from <'T The third pro%e&t i) this i)ter1a&i)g series 'i-. at e2pa)di)g the !PT i)ter1a&e &ir&uit to i)&-ude a) 83bit a)a-og to digita.