You are on page 1of 17
Table 5.12 (Conid.) Signal Return — Signal Direction Pin No. Pin No. 13 = SLCT ouT ‘This signal indicates that the print Sa ‘With this signal being at “low” level, the p AUTO, avtomatically fed one lie after printing. Le ei sean ou can be fixed to “low” with DIPSW Pin 2-3 RED control circuit board.) 15 = NC Not used. 16 ES oy Logic GND Level. CHASIS Printer chasis GND. In the printer, the chasis GND and a sik GND the logic GND are isolated from each other. 18 — NC = Not used. 30 = GND ~ywisted-Pair Return” signal; GND level. When the level of this signal becomes “low” the prt —— controller is reset to its initial state and the fi a ee aN aN Cleared. This signal is normally at “high” level, an width must be more than SO is at the receiving ten ‘The level of this signal becomes “low” when the printer 32 ERROR = OUT “Paper End “state, “Offline” state and “Error” state. 33 as GND ei Same as with pin numbers 19 t@ 30, : 34 et NC = Not used a5 Pulled up to + 5 Vde through 4.7 k-ohms resistance Data entry to the printer is possible only when the lev - this signal is “low”. (Internal fixing can be carried out B= SLCTIN IN ie I DIP SW 1-8. The condition at the time of shipment low’ for this signal.) Note: 1 irecti refers to the direction of signal flow as viewed from the printer. “Return” denotes “Twised-Pair Return” and is to be connected at signal-ground level. When wi interface, be sure to use a twisted-pair cable for each signal and never fail to complete connect the return side, To prevent noise effectively, these cables should be shielded and connected to the eh of the system unit 3. All interface conditions are based on TTL, level. Both the ri 0.2 ps. 4. Data transfer must not be carried out by ignoring the ACKNLG or BUSY signal, (Data transfer printer can be carried out only after interfacing the ACKNLG signal or when the level of the BUS is “low”) 5, Remaining pins on the connector are no connection pins, and fall times of each signal must be 6, x-not available in 25 pins connector, Printer Operation The printer interface connections with 8255 and the printer conne Fig, 5.31 and Fig. 5.32 respectively. First of il the printer should be initialised by sending a pulse on the INIT pin of the printer. Then the BUSY pin is to be checked to confirm if the printer is this signal is low, it indicates that the printer is ready to accept a character from the CPU, Port pins of ‘Scanned with CamScanner not have sufficient drive capacity to drive the printer input signals so that the open are used to enhance the drive capacity, When this happens the ASCII code of the ‘on the eight parallel port lines, Once the data is sent on eight parallel lines, the STRO terat least 0.5 ls, 10 indicate that the data is available on the eight data lines. The falling e signal causes the printer to make its BUSY pin high, indicating that the printer is busy. Af riod of 0.5 pts, the STROBE signal can be sent high. The data must be ‘on the data lir usafter the STROBE signal goes high, After receiving the appropriate STROBE. pulse, necessary electromechanical action to Print the character and when it is ready to receit the next asserts its ACKNLG ‘signal low approximately for 5 ms. The rising edge of the ACKNL San mci to the computer that it is ready to receive the next character. The rising edge of the resets the BUSY signal from the printer, A low on the BUSY pin further indicates that the printer i accept the next character. The ACKNLG and BUSY signals can be used interchangeably for handshaking purposes. The waveforms for the above printer operation are shown in Fig. 5.33. DB; De Ds Ds Dy Dp Dy Dy T [+]ola]Tole lo -—> A2H 1/0 vo | as Port € lower O/P port Port B bit /P port Group A in mode 4 Port B mode 0. Port C upper don't care (as decided by mode 1c of group A) Port O/P port Strobed VO mode control word D; De Ds Ds Ds Dz Dy Do 0 o}o]oj1]ajo i Loe Bit SevReset | Set to enable mode — Bit PCy Sat for sending care 1 |» ODH INTR signal to 8086 oF 8259 Don't Fig. 5.30 Bit Set/Reset Control Word MOV BL,AL 3 Get the ASCII code in BL. MOV AL,OA2H Control word for 8255 OUT OF6H.AL ; Load CHR with the control Busy: IN AL, OF2H : Read printer status from AND AL,O8H : Mask all bits except | - JNZ BUSY If AL#O, printer is busy, ; it becomes free. MOV AL, BL Get the character for pri (QUT OFOH AL ; Send it to the port ft NOP Wait for some time — ALLOB Hoos oy PULL) STROBE AoW on ‘Scanned with CamScanner 10/10 ACKNLG 16439 INIT 19 STB PB PB, PB; PBs PCy PB, PBe PB; PC; Pe, PCs PFFFFIFRBRRERE Scanned with CamScanner () MOPE 2 (Strobed Lickrectomal Th) + x provider an additonal feature of commun ath, 4 peripherad Lewict on 2 @-Lae data Cur + feng(e BL pot tn Group A Ek availath. * PAG pork et butivectona® a4 6. be contrat pre OF vad elle * hret Tp ines one owattarle ak pod & ( Pe 40 Pes) , & Drputs arel Sutputs are Latched. we o- La aAccey 4 On Port A eentrel por ¢ Ce 5 Peg) emer! Soa hardthare 4ymals for @-kce Kate transley a | Conbal Scgnal depenthons cr mode 2 9 INITR COntevrupt Ruyucst) 2 Ceed to extevrupt The micro pre cence ean +o ark toy next haba bate te | From he Fee gutpur operatrens ; chu her written Bale te pot A o ACK CAck noel edge’) t AeR=0 D emnferme Hs receipt of previo cata byte by the oludnaken and reek dale bye meq le 4enk by He pro cerren” o SEF Coulput Buffer Rul): o@F eltes (A flag ateoomed Wek OF) 4 Can be Controlled oi bit cet /aaek mode wih PLE. fer Erpue operakons el = é a a Latches of © ste (Strobe oput): ste -° y date comet ty enput Lat a eS Br COnpick bulbey cfuue)* 1k=| op ARE WAC been riccker alse ie he ee a Deagrame ty be attached. ‘Scanned with CamScanner Fig. .35. (a) Mode 2 pins (b) Mode 2 control v Scanned with CamScanner Fig. 5.36 Interconnections between the two 8255s in Mode 2 for Problem 5.16 Scanned with CamScanner fh eye nraead 8086 system with a 8256 interfaced at port A address FO in it. Another 8086 system with another 8255 interfaced of 100 data bytes stored in it. Interchange these blocks 0 tems. Draw the necessary hardware scheme and write the necessary seque! systems run on the same CLK rate. : Solution The complete hardware schematic is shown in Fig. 5.36. The | 2 is applied to the respective 8086 processor at NMI pin. The inverted IBF signal of connected to ACK of the second and the inverted IBF signal of the second 8255 ‘ACK of the first 8255, so that input buffer full signal of one 8255 acknowledges the rece byle sent by the other. The OBF signal of one 8255 is connected to STB signal of the and vice versa, so that the output buffer full signal of an 8256 informs the other 8255 that is ready on the data bus for it. The 8-bit data bus, i.e. PAy-PA; of the two 8255s are con each other. s ; This program transmits parallel data byte by byte to ai system through ; 8255 IN MODE 2. he DATA SEGMENT CWL EQU = COH BLOCK] DB 100D DUP (?) DATA ENDS ASSUME CS : CODE,DS ; DATA CODE SEGMENT MOV AX, OOQOOH : Initialise interrupt MOV DS, AX 3 veetor table of MOV AX, OFFSET TRANS ; 8086 at table i | MOV [OOOBH],AX ; TRA NOV (OOOAH],SEG TRANS ‘ WOY CL,1010 count CL (one additional) i MOV AX, DATA Initialise data segment MOV DS.AK MOV AL, CW1 + Initialise 8255 in MOV DS, AK + mode 2 QUT F6H, AL . STI i MOV [SI], OFFSET BLOCK1-1 TRANS : INT 2 CALL FAR PTR SYNCHRO + Wait for synchronization INC SI 3 Pointer to block in SI DEC CL ; Decrement count Scanned with CamScanner : them in the array SEGMENT STACKD DB 500H ENDS: SEGMENT CW2 EQU COH BLOCK2 DB 100D DUP (7) DATA ENDS CODE SEGMENT ASSUME CS : CODE, DS ; DATA ,SS: STACK MOV AX, STACK MOV SS. AX MOV AX, 0000H : MOV DS, AK : MOV [0008H],0FFSET NEXT MOV [000AH],SEG NEXT MOV CL,1OL D MOY AX, DATA MOV. DS.Ax mov ‘OUT Mov ame INC DEC Scanned with CamScanner After the transmitter transmits the data bytes, the receiver receives it and stores it in the 2 but acknowledge ACK. is sent to the transinitier immediately. Hence the a a sending the next data byte to the receiver so as to give it the sufficient time to ~ oe for the received data, Transmitter runs its delay procedure SYNCHRO to solve this prol SYNCHRO PROC FAR é Seema INC DI All the instructions in this routint H instructions, just to cause the same de ook ; requires takes, to be prepared for act i the next data ee ; byte after getting interrupted by thi transmitter, OK; IN AU .OFSH 4 MOV [DI] AL : These are comparable with the LRET corresponding receiver program SYNCHRO ENDP instructions. Program 5.10 ALP for Synchronization Delay It may be noted that for the execution of this program, procedure SYNCHRO must be entered transmitter program before the END statement, *oth These programs should be entered in both the 8086 systems. The procedure SYNCHRO is to be¢ with the transmitter program as itis called by it. Thus after entering the complete set of these pi the two 8086 systems, run the receiver program on the receiver 8086 Kit. It will initialise the receiv IVT, its 8255 in receiver mode and wait for the interrupt from the transmitting terminal. Now un gram on the transmitter 8086 kit, This program initialises the transmitter 8086 IVT. Its $255, in ta mode, goes on transmitting data byte by byte and waits for the delay caused by the SYNCHRO before eat byte is transmitted so a to give sulficient time to the receiver 8086 fo read data, store it in aray and counters and pointers, Note that the procedure SYNCHRO contains all the dummy instructions. They do not serve for the algorithm, but just provide their execution delay. The instructions in the procedure are the instructions in the receiving program, from label NEXT to the JMP WAIT instruction. This is @ coincidence but an accurate way of providing the required delay for the receiver. As both the run at the same clock speed, each of the instructions, which from the procedure and coi from the receiver program will take the same time for execution. Thus the transmitter will p delay as requited by the receiver, ‘Scanned with CamScanner Keyponae /DICeAY ConiTasiteR (0244) to ce ee yy ease wat alte used ba enterfack Sate dese bet We dis aduortoye of them od Be that the CPU ¢ to vepeeth THe acngleg arch check he dhatun ved thy ody pervcedically osind polling peck nique, ahes Leads te wactage of cru egeto ound ent oy sthrowphpek * # R47 cA a aprecel PUNpOrE vebeane hs caonttlien Hat vives the Bayley of 2 and inberfaces a Meet sard wh He CPu, ical cru ee few other tate stmuttoncoutl A Wapoark ackvty Seated tA euxeveph raed er) pelle Ong ay preted ther ts code ct rast te the CPU. op OF alte Rramamnty th tate from the CPU te tha clisplag Paves perfrrmed by the Controller an TERY Ensen tha CPU bese fonctont ore Paskcen wether Sharia weotiTe CTURE OF & a . cet of an Gi and £5 woturn + the CY provides & cet of 4 rean Mines Oe ponte fee credo ungboarelt 2 PN ess of 24h output how fee entecfacry Aesplag ake Vario faacherad Blecs of para cuce cu follpos @ +e Control a nel ake pullers 2 centrale tes eh hate foffcom 02744, = hate Laffer catecfoce eetercal Lu of syste wouk onbernt lw of G24, fo tecteon o erabled user aed * 2 se ggictent Croce the Usghowd ae Deigheg mods pregame’ te CPO ‘sy ee awe written wher fo = Terday an centred unth esntrele the Femi of He operations et Hu cut" Scan counter @ Centred asd Jomoy Ragiltts 7 =| aad WR=%7 - divides operetrn frapune fo Dante 40an tagboard Scanned with CamScanner and dean Lisplay freyrenvies. @ Scan (wunter: earned matte and vafvesh te cliaping - eheranes, on a medi G) Cntoded rnode. do Becodted rode: = eroded meds, provide « Lenay count drat Aasdto De arten ~ dlecadsd te proves 404 fone for Maubo aed ard digplay, coded edt, Counter internally decoky, a heat acgeikeane t 5 = had ond yenidy & deeded 2 put of + ccan Boe E ieielesaa” alngl Beep lng beth) once es Ret prods at a partion eat tavck! @ Retwen Bufgers ent tagboard Deborenee and Control +- = ccaus for Wy clommet yen eee: cap habe Usjpoond Auboused He eg lenkogs = Beer Adboune period Cioms) wy cantons do Lx hake ches , code of the "L tert fe finger KAM img somth sHiey ard CONTESL Sead @ Fite] Seacer Ram ard Stat slogtes- Sm tengroand made , 40st Dimew act ad O-La Free RAm . Each wag eds of te preted Mey ck Oakered or te or dee of tntey and ead y He Cpu RIL the Rain 4 zenely On Starned femte mabix mode, the List Ae as Contry RAM Cad reat comm mam & foaded wilh the Ahata of dhe CBN ELp mow of Beno tx tye matrix. ~ Of tenn charge cy state, TRA bine gos high th oterupt Hee CRU @® vee 24 Adletwece = testy ters and Did plea Rami addres vegicters Cantatn Ho addyea of He aerd current bey) written a vend by the chy to/from DéAel Ram. q 4 be /: aT Vea lyte besplay nam > 6-bytedatate La Lux el on 16 4+ Kegment Lirplays &% ancoded ae ‘Scanned with CamScanner DISPLAY ADDRESS REGISTERS DISPLAY REGISTERS OUT Ag-A3 OUT Bo-Bs _ Fig 6.28 8279 Internal Architecture ‘Scanned with CamScanner Bs] 17 oe, L_] 18 pe, 2] 19 = jy Lo) 8279 31 |) oure, 30 5] ours, 29] ours, [ oure, >] out Ay [>] outa; (>) outa: 28 or 26 OUTAs (a) UTADA, La > = Ag eT our 8-8; [a> — ck cpu interfece | aL ise Yes earn (6) Fig. 6.24 8279 Pin Configuration and Logic Diagram (AtCienal discription of each of the pins of 8279 is presented below in brief: DB-DB, These are bidirectional data bus line Nansfetred on these lines CLK This is a clock input used to generate internal RESET This pin is used to reset 8279. A ‘bil display, left entry encoded sean, 2-key high on thi timings required by 8279. .s, The data and command words to and from the CPU are ‘is line resets 8279. After resetting 8279, its in sixteen lock out mode. The clock prescaler is set to 31. ® Chip select: tow on this line enables 8279 for normal read or write operations. Othervise, this pin uld remain high. eatiat on the Ay line indicates the transfer of a 0 SUG the transfer of data, This is used to select one of) (Input/Output) READ/WRITE input pins en command or status information, A low on this line indi- the internal registers of $279. fable the data buffers to receive or send data ‘Scanned with CamScanner a in the FIFO sensor RAM, The intern. he FIFO RAM further contains any ier te an interrupt to the CPU. IRQ This interrupt output line goes high when there is dat goes low with each FIFO RAM read operation. However, if tl Enity to be read by the CPU, this pin again goes high to generate an} Vos Vee These are the ground and power supply lines for the circult. a SLy-SL;-Sean Lines These lines are used to scan the keyboard matrix and display digits. These Tins be programmed as encoded o decaded, using the mode control register. RL,-RL,-Return Lines These are the input lines which are connected 10 one terminal of keys, whi, other terminal of the keys are connected to the decoded scan lines, These are normally high, but Pulled gy. when a key is pressed. aad SHIFT The status of the shift input line is stored along with each key code in FIFO in the scanned keyty, 7 mode. Till it is pulled low with a key closure it is pulled up internally to keep it high CNTUSTB-CONTROL/STROBED 1/P Mode In the keyboard mode, this line is used as a contrl ings and stored in FIFO on a key closure. The line is a strobe line that enters the data into FIFO RAM, in je Strobed input mode. It has an intemal pull up. The line is pulled down with a key closure, BD -Blank Display This output pin is used to blank the display during digit switching or by a blankag command. OUTA,-OUTA, and OUTB,-OUTB, These are the output ports for two 16 x 4 (or one 16 x 8) intemal display refresh registers. The data from these lines is synchronized with the scan lines to scan the display ag Keyboard, The two 4-bit ports may also be used as one 8-bit port. 6.32 Modes of Operation of 8279 The modes of operation of 8279 are next discussed briefly: (i) Input (Keyboard) modes Gi) Output (Display) modes Input (Keyboard) Modes $279 provides three input modes which are discussed below in briet 1, Scanned Keyboard Mode This mode allows a key matrix to be interfaced using either encoded ord coded scans. In the encoded scan, at 8 x 8 keyboard or in decoded scan, a 4 x8 keyboard can be interfaced The code of key pressed with SHIFT and CONTROL status is stored into the FIFO RAM 2. Seanned Sensor Matrix In this mode, a sensor array can be interfaced with 8279 using either encoded cor decoded scans. With encoded scan 8 x 8 sensor matrix or with decoded scan 4 x & sensor mattix ci! interfaced. The sensor codes are stored in the CPU addressable sensor RAM. 3. Strobed input In this mode, ifthe contol line goes low, the data on return lines. i stored in the Ff ile by Byte’ store _ Output (Display) Modes £279 provides two output mode. electi ions. TH are discussed briefly: S for selecting the display options. 7 1. Display Sean In this mode, 8279 provides 8 or 16 charact f 5 ante ore as dual 4-bit or single 8-bit display units, “ter multiplexed displays those can be 2. Display Entry (right entry or left entry mode) 3279 Auten ays: is is i f tions for data e1 the disp! display data is entered for display either from the right side hah the left A foes o ts regarding modes will be more cleat when the commands are discussed later in this chapter, te All these modes may be selected by programming E ‘ isc in significant details. 8 the 8279 suitably. Further, these modes a 4 Scanned with CamScanner ieee me ay controler i at address 0080H. Write an ALP ane . oul Nie rollover mode. Use a 16-¢} 10 sq, i display RAM with zeros. Read the FIFO on CL. Then write the byte 55 to all the isa, iyi it’s ister es lKany Koy is closed, store tS O98 OE operate it at 100 KH re ay format. Then clear the key i ek The clock input to 627: The 82 ie. Dj-D>. Hence the A, input of 8279 ig i i r byte of the data bus, i.e. Dy~D, on Ee econ aN ae register of 8279 isto be addressed = aoe 1.8. Ay=0, Ay already discussed, the tans either read from or written to this address (Ag=0). For addressing the ; mand or status word Ag input of 8279 should be 1 (the address line A, of ae should be 1), ig dress of the command word should be 0082H. Figure 6.25 sha tte interfacing schemati "The next step is to write all the required command words for this probler au Y | SHIFT CNTL RL 8259-IRy Dg-D; Oy-Dy RD RO 8086/ wR WR 6279 a 6259 RESET RESET ae : ; sysiem CLK CLK ae % Ay Ao 7 So$s poe | paste oe ica =< OUT OUT 4:16 DECODER | | MNiNiX CS BBs Ap-Ay | — J + “ oi - | | Select a) | | Display K . _ 8D bit 7 Seg data Aa - ® 16 DIGIT DISPLAY UNIT Ay MAO. Data port address 0080H Fig. 6.25 8279 Interfacing with 8086 x This, oy _ 7» Command byte sets the 8279 in 16-character right if Scanned with CamScanner Blanking code OOH Read FIFO — This command byte enables the programmer to read a key code 0 1 10x = ae a Don't care in keyboard scan mode Write Display RAM This command enables the programmer to write the addressed display locations of the RAM as presented below. : 1 0 Ol 4.0 NOT Oo eer Star from 0000 location salle seis of display RAM Program 6.6 gives the ALP required to initialise the ASSUME cs : CODE ‘CODE SEGMENT ; START: MOV AL, TAH OUT 82H, AL MOV AL, 34H ‘Scanned with CamScanner ts except the of characters bits key is pressed, take ‘action, otherwise isplay write display the byte DISPLAY RAM to read the key ode in CL. 2 d key is assumed aval ‘Scanned with CamScanner

You might also like