Design of handshake mode

Design Of Handshake Mode 8255A Exploitation 8086


8255 is a widely used general intent programmable devices, can be compatible with any microprocessor. The 8255 includes three programmable ports, one of which can be used for bidirectional informations transportation. This is an of import extra characteristic in comparing with the 8155 I/O ports. The 8255 has 24 I/0 pins that can be grouped chiefly in two 8 spot parallel ports. A & A ; B, with the staying eight spots as port c. the eight ports of port degree Celsiuss can be used as single spots or be grouped in two 4-bit ports. The figure shows all the maps of 8255, classified harmonizing to two manners: the BSR manner and I/P manner. The BSR manner is used to put or reset the spots in port c. the I/O manner is farther divided into three manners: manner 0, mode 1 and mode 2. In manner 0, all the ports map as simple I/O ports. Mode 1, is a handshaking manner where by ports A and/or B usage spots from port C as handshaking signals. In the handshaking manner, two types of I/P informations can be transferred enforced: position cheque and interrupt. In manner 2, port A can be set up for bidirectional informations transportation utilizing handshake signals from port C, and port B can be used to put up either in manner 0 or mode 1.

Programmable Parallel Ports And Handshake Input/Output:

We use larboard devices to input informations and end product informations to the microprocessor. Most of the available port devices such as 8255A on the sdk-86 board, contain two or three ports which can be programmed to run in one of the several different manners. The different manners allow us to see for many common types of analogue informations transportation. Assorted methods of parallel input informations transportation are

This text is NOT unique.

Don't plagiarize, get content from our essay writers!
Order now

Simple Input/Output:

When we need to acquire the digital information from a simple switch such as thermoregulator into a microprocessor all we do is that we connect the switch to an input port line and read it anytime. Similarly when we need to end product the informations to a simple end product device such as an LED, all we do is to link the led buffer on an end product port pin and end product the logic degree required to turn on the visible radiation. The led is ever there and ready, so you can direct informations to it at any clip.

We Will Write a Custom Essay Specifically
For You For Only $13.90/page!

order now

Simple Strobe I/O:

In many applications, valid information is present on an external device merely at a certain clip, so it must be read in at that clip. An illustration of this is the ascii-encoded keyboard. When key is pressed. Circuitry on the cardinal board sends out the American Standard Code for Information Interchange codification for the pressed key on eight analogues informations lines, and so sends out a strobe signal on another line to bespeak the valid information is present on the eight informations lines. As shown in fig-4.9 we can link this stroboscope line to an input port line and canvass it to find when we can set valid informations from the keyboard. Another option is to link the stroboscope line to an interrupt input of the processor and have an interrupt service process read in the information when the processor receives an interrupt. The point here is that this transportation is clip dependent. We can read the informations merely when a stroboscope pulsation tells us that the information is valid.

Fig 9 1b shows the timing wave forms which represent this type of operation. The directing device such as a keyboard, outputs parallel informations on the information lines, and so end products at the stb signal to allow us cognize that the valid information is present. For low rates of informations transportation such as from a keyboard to a microprocessor, a simple stroboscope transportation works good. However for higher information transportation velocity this method does non work because there is no signal which tells the sending device when it is safe to direct the following information byte. In other words, he directing system might direct informations bytes faster than the receiving system could read them. To forestall this job a handshaking informations transportation strategy is used.

Single-Handshake I/O:

figure 9-2 shows the circuit connexions and figure 91-c shows some illustration timing wave forms for a handshaking informations transportation from a peripheral device to a microprocessor. The peripheral outputs some parallel informations and sends stb signal on a polled or interrupt footing and reads in the byte of informations. Then the microprocessor sends a acknowledgement signal to the peripheral to bespeak that the information has been read and the peripheral can direct the following byte of informations from the position point of the microprocessor this operation is referred to as handshaking or stroboscope input. These same moving ridge signifiers might stand for a handshaking end product from a microprocessor to parallel pressman. In this instance the microprocessor outputs a character to the pressman and asserts an stb signal to the pressman to state the pressman, “ here is a character for you.” When the pressman is ready it answers back with ack signal to state the microprocessor, “ I got that one” direct me another. The point of this handshaking strategy is that the sending device or system is designed so that it does non direct the following information byte until the having device or system indicates with an ack signal that it is ready to have the following byte.

Double-Handshake Data Transportation:

For information transportations where even more coordination is required between the sending system and the receiving system a dual handshaking is used the directing device asserts its stb line low to inquire “ are you ready” ? the receiving system raises its ack line high to state I m ready. The peripheral device so sends the byte of informations and raises its stb line high to state I have the informations thank you. And I wait your following petition to direct the following byte of informations. For handshaking end product of this type from a microprocessor to a peripheral the wave forms are the same but the microprocessor sends the stb signal and the informations the peripheral sends the ack signal. In the attach toing research lab manual it is shown hoe to interface with a speech-synthesizer device utilizing this type of handshaking system.

Implementing Handshake Data Transportation:

For handshaking informations transfer a microprocessor can find when it is clip to direct the following information byte on a polled or interrupt footing. The interrupt attack is normally used because it makes better usage of the processors clip. The stb or ack signal for these handshake transportations can be produced on a port pin by instructions in the plan. However this method normally uses excessively much processor clip, do parallel port devices such as the 8255A have been designed to automatically pull off the handshaking operation. The 8255A for illustration can be programmed to automatically have an stb signal from a peripheral, direct an interrupt signal to the processor and direct the ack signal to the peripheral at the proper times.

8255A Internal Block Diagram And System Connections:

The diagram shows the internal construction of the 8255A. organize the diagram it is observed that there are 24 input end product lines. Port A can be used as an 8 spot input port or as an end product port. Like port B can be used as an 8 spot input port or as an 8 spot end product port. Port C can b used as an 8 spot input end product port or as 4 spot port or to bring forth handshaking signals for ports a neodymium b. the signal lines used to link to the device to the system busses. 8 information lines allow us to compose informations bytes to a port or the control registry and to read bytes from the port or the position registry under the control of the rd wr lines. The reference inputs A0 and A1 allow us to selectively entree one of the three ports or the control registry. The internal references for the device are port A 00, port B, 01 ; port C ; 10 ; control, 11. Asserting the Cs input of the

8255A enables it for reading or composing. The Cs input will be connected to the end product of the reference decipherer circuitry to choose the device when it is addressed. The reset input of the 8255A is connected to the system reset line so that, when the system is reset all the port lines are initialized as input lines.this is done to forestall devastation of circuitry connected to port lines. If larboard lines are initialized as end products after a power up or reset the port might seek to end product to the end product of the device connected to the port. The possible statement between the two end products might destruct one or both of them. Therefore all the programmable port devices initialize their port lines as inputs when reset. The given figure shows that how a 8255 can be connected to a 8086, here one 8255 is connected to the lower half of the 8086 informations coach and the other is conneceted to the upper half of the 8086. This is done so that byte can be transferred by enabling one device, or a word can be transferred by enabiling both devices at the same clip. Harmonizing to truth tabular array for the input end product port reference decoder the A40 8255A on the lower half of the information coach will be enabled for a base reference of FFF8H, and the A35 8255A will be enabled for a base reference of FFF9H. another point to notice is that system address line A1 is connected to the 8255A A0 inputs, and system address line A2 is connected to the 8255A A1 inputs. With these connexions the system reference for the three ports and the control registry in the A 40 8255A will be FFF8H, FFFAH, FFFCH, FFFEH. Likewise the system reference for three ports and the control registry of the A 35 8255A are FFF9H, FFFBH, FFFDH, and FFFFH.

8255a Operational Modes And Initiallization:


When we want to see the port for simple input or end product without handshaking we initialize the port in manner 0. If both port A and port B are initialized in manner 0, so the two halves of port degree Celsiuss can be used together as an extra 8-bit port or they can be used separately as two 4 spot ports. When used as end products, the port degree Celsius lines can be separately set or reset by directing a particular control word to the control registry reference. The two halves of port C are independent so one half can be initialized as input and the other half as end product.


When we want to utilize port A or port B for handshaking input or end product operation. We initialize that the port in MODE 1. In this manner some of the pins in port C map as handshaking lines. Pins PCO, PC1 and PC2 map as handshaking lines for port B if it is initialized in MODE1. If port A is initialized as handshaking manner input port so pins PC3, PC4, and PC5 map as handshaking signals. Pins PC6 and PC7 are avalible for usage as input lines and end product lines. If port A is initialized as a handshaking end product port, so port degree Celsius pins PC3, PC6, PC7 map as handshaking signals. Port c pins PC4 and PC5 are available for usage as input or end product lines. Since the 8255 frequently used in manner 1.


Merely port a can be initialized in manner 2 port a can be used for bidirectional handshaking informations transportation. This means that informations can be end product or input on the same eight lines. The 8255A might be used in this manner to widen the system coach to break one’s back microprocessor or to reassign informations bytes to and from a floppy disc accountant board. If port A is initialized in MODE 2 so PINS PC3 through PC7 are used as handshaking lines in port A. the other three pins PC0 through PC2 can be used for input end product if port B is in manner 0. The three pins will be used for port B handshaking lines if port B is initialized in manner 1.

Constructing And Sending 8255A Control Wordss:

Figure 9-5 shows the formats for the two 8255A control words. Note that the mutual savings bank of the control word tells the 8255A which control word your are directing it. We use the manner definition control word format to state the device what modes we want the ports to run in. we use the spot fit /reset control word format. we want to put or reset the end product on a pin of port degree Celsiuss or when we want to enable the interrupt end product signals for the handshaking informations transportations. Both control words are sent to the control registry reference of the 8255A. as usual, initialising a device such as this consists of working our manner through the stairss as described already. As an illustration for this device suppose that we want to initialise the 8255A in figure 7-8 as follows.

Port B as manner 1 input

Port A manner 0 end product

Port C upper as inputs

Port C bit 3 as end product

The base reference of the A40 8255A is FFF8H, and the control registry reference is FFFEH. The following measure is to do up the control by calculating out what to set in each of the small boxes, one spot at a clip. Figure 9-6a shows the control word which will plan the 8255A as desired for this illustration. The figure alsi shows how we should document any control words to do for usage in our plans utilizing figure 9-5 a work our manner through this word to do certain we see why each spot has the value it does. To direct the control word we load the control word in AL with a MOV AL,10001110B direction point DX at the

port reference with the MOV DX,0FFFEH direction and direct the control word to the 8255A control registry with the out DX, AL direction. An illustration of how to utilize the spot set/reset control word suppose that we want to end product a 1 to ( set ) spot 3 of port degree Celsius, which was initialized as an end product with the manner set control word above. To put or reset a port degree Celsius end product pin, we use the spot set/reset control word shown in figure. Make spot d7 to 0 to place this as a spot set/reset control word and put a 1 in spot d0 to stipulate that we want to put a spot of port c. spots d2 d3 and d1 are used to state the 8255A which spot we want to move on. For this illustration we want to put spot 3 so we put 011 in these three spots. For simpleness and compatibility with future merchandises make the other 3 spots of the control words 0. The consequence 00000111B is shown with proper certification in the figure. To direct this control word to the 8255A merely lade it into AL with the MOV AL,00000111B direction, point dx at the control registry reference with the MOV DX,0FFFEH direction if DX is non already indicating at that place, and direct the control word with the OUT DX, AL direction.

8255A Handshake- Interfacing To A Microcomputer- Controlled Lathe:

All the machines in the machine store of our computing machine controlled electronics mill operate under personal computer. One illustration of these machines is a lathe which makes bolts for long rods of chromium steel steel. The cutting instructions of each type of bolt that we need to do are stored on ? in wode teletype like metal tape. Each direction is represented by a series of holes in the tape. A tape reader pulls the through an optical or mechanical detector to observe the hole forms and converts these to an 8 spot parallel codification. The personal computer reads the direction codifications for the tape reader on a handshake footing and sends the appropriate control instructions to the lathe. The personal computer must besides supervise assorted conditions around the lathe. It must, for illustration make certain the lathe has cutting lubricant oil, is non out of stuff to work on, and is non jammed up in some manner. Machines that operate in this manner are frequently referred to as computing machine numerical control or CNC machines.

The figure given shows from how we might utilize an 8255A to interface a personal computer to the tape reader and lathe. Our first undertaking is to do up the control word which will initialise the 8255A In the right manners for this application. To make this start by doing a list demoing how we want each port or group of pins to map. Then put in the control word bits that implement those pin maps.

Port A demands to be initialized for handshaking input ( mode 1 ) because direction codifications have to be read in from the tape reader on the handshake footing.

Port B needs to be initialized for simple end product ( mode 0 ) no handshake is needed here because this port is being used to end product simple on or off control signals to the lathe.

Port C, bits pc0 pc1 and pc2 are used for simple input of detector signals for the lathe.

Port C bits pc3 pc4 and pc5 map as the handshaking signals for the informations transportation from thr tape reader connected to port A.

Port C spot pc6 is used for end product of the stop/go signal to the tape reader.

Port C spot pc7 is non used for this illustration.

Figure 9-b shows the control word to initialise the 8255A for these pin maps. We send this word to the control registry reference of the 8255A.In order for the handshaking input informations transportation from the tape reader to work right, the interrupt petition signal from spot pc3 has to be enabled. This is done by directing a spot set/reset control word for the appropriate spot of port c. fig 9-9 shows the port c spot that must be set to enable the interrupt end product signal for each of the 8255A handshaking manners. For illustration here port A is being used for handshaking input, so harmonizing to calculate 9-9 port C spot pc4 must be set to enable the interrupt end product for this operation. The spot set/reset control word to make this is 00001001B. we send this spot set/reset control word to the control reference of the 8255A.

Handshake informations transportation from the tape reader to the 8255A can be stopped by disenabling the 8255A interrupt end product on port C, pin c3. This is done by reseting spot pc4 with a spot set/reset control word of 00001000. As another illustration of 8255A interrupt end product enabling suppose that we are utilizing port B as handshaking end product port. Harmonizing to calculate 9-9 we need to put spot pc2 to enable the 8255A interrupt end product signal. The spot set/reset control word to make this is 00000101. Now we see how the existent information transportation takes topographic point in handshaking manner for which the machine would run.

After initialising everything we would likely read port C, bits pc0 pc1 and pc2 to look into if the lathe was ready to run. For any 8255A manner we read larboard C by simplt traveling an input from the port C reference. Then we end product a start bid to the tape reader on the spot pc6.this is done with a spot set/reset bid. Assuming that we want to reset spot pc6 to get down the tape reader, the spot set/reset control word for this is 00001100. When the tape reader receives the spell bid. It will get down the handshaking informations transportation to the 8255A.

The tape reader starts the procedure by directing out a byte of informations by directing out a byte of informations to port A on its eight informations lines. The tape reader so asserts its stb line low to state the 8255A that a new byte of information has been sent. In response the 8255A raises its input buffer full ( IBF ) signal on pc5 high to state the tape reader that it is ready for the informations. When the tape reader detects the IBF signal at a high degree, it raises its stb signal high once more. The lifting border of the stb signal has two effects on the 8255A. it foremost latches the informations byte in the input latches of the 8255A. one time the information is latched the tape reader can take the informations byte in readying for directing the following information byte. This is shown by the dotted subdivision on the right side of the informations wave form in figure. The lifting border on the stb signal will do the 8255A to end product an interruot petition signal in the microprocessor on spot pc3.

The processors response to the interrupt petition will be to travel to an interrupt service process which reads in the byte of informations latched in port A. when the RD signal from the microprocessor goes low for this read of port A, the 8255A will automatically reset its interrupt petition signa on pc3. This is done so that a 2nd interrupt can non be caused by the sane informations transportation, when the processor raises its RD signal high once more at the terminal of the read operation, the 8255A automatically drops its IBF signal on pc5 low once more. IBF traveling low once more is the signal to the tape reader that the informations transportation is complete and that it can be direct the following byte of informations. The clip between when the 8255A sends the interrupt petition signal and when the processor reads the informations byte from port A depends on when the processor gets about to serving that interrupt. The point here is that this clip does n’t count. The tape reader will non direct the following byte until it detects the IBF signal has gone low once more. The transportation rhythm will so reiterate for the following information byte. After the processor reads in the lathe control direction byte from the tape reader, it will decrypt this direction and end product the appropriate control byte to the lathe on port B of the 8255A. the tape reader so sends the following direction byte. If the direction tape is made into a uninterrupted cringle, the lathe will maintain doing the specified parts until it runs out of stuff. The fresh spot of port degree Celsius, pc7 could be connected to a mechanism which loads In more stuff so the lathe can go on.

Parallel Printer Interface—Handshake Output Example:

This refers to the hardware connexions and the package required to interface with a parallel pressman in a system which does non hold a BIOS process we can all to make the occupation. For most common pressmans such as IBM personal computer pressmans, the Epson point matrix pressmans informations to be printed is sent to the pressmans, and the Panasonic dot-matrix pressmans informations printed is sent to the pressman as ASCII characters on eight parallel lines. The pressman receives the characters to be printed and shops them in an internal RAM buffer. When the pressman detects a 2nd passenger car return, It prints out the 2nd row of characters, etc. the procedure continues until all the desired characters have been printed.

Transportation of the ASCII codifications from a personal computer to a pressman must be done on a handshake footing because the personal computer can direct characters much faster than the pressman can publish them. The pressman must in some manner let the personal computer know that its buffer is full and that it can non accept any more characters until ir prints some out. A common criterion for interfacing with parallel pressmans is the centronics parallel interface criterion, named for the company that developed it.


Microprocessors and interfacing scheduling and hardware 2nd edition by Douglas V. Hall TATA McGRAW-hill edition.

Microprocessor architecture, scheduling, and applications with the 8085 by Ramesh Gaonkar 5th edition, penram international publication

Fundementals of microprocessor and personal computers byB. Ram, Dhanpat Raipublication.

Related essay samples:

  1. Interrupts and interrupt applications
  2. Traffic light controller using microprocessor
  3. Computer Program And Is The Primary Element
  4. The Communication And Control Of Semi Information Technology Essay
  5. Control System Is Combination Of Various Devices Information Technology Essay
  6. ?What’s RFID? Essay Sample
  7. String, procedure and macros in microprocessor
  8. A power amplifier
  9. Lcd Based Voting Machine
  10. Active and Passive – Devices Essay
  11. Design Of A Low Noise Amplifier Engineering Essay
  12. Motor Speed Control Essay
  13. Microprocessor based system
  14. Modulation is the process
  15. Total, Average, and Marginal Product Essay