Module6 8086 Microprocessor and Peripherals part3 .

Parallel Printer Interface:

For the most common printer such as the IBM PC printer, the Epson dot matrix printers and the Panasonic dot matrix printers, data to be printed is sent to the printer as ASCII characters on eight parallel lines. The printer receives the characters to be printed and stores them in an internal RAM buffers. When the printer detects a carriage return character, it prints out the first row of characters from the print buffer. When the printer detects a second carries return, it prints out the second row of characters etc. The process continuous until the desired characters have been printed.

Transfer of the ASCII codes from a microcomputer to a printer must be done on a handshake basis because the microcomputer can send characters much faster than a printer can print them. The printer must in some way let the microcomputer know that its buffer is full and that is cannot accept any more characters until it prints some out. A common standard for interface with parallel printers in the centronics parallel interface standard, named for the company that developed it.

Centronics type printers usually have a 36-pin interface connected. This 36- pin connector fall into two categories, i. Signals sent to the printer to tell it what operation to do and ii. signals form the printer that indicate its status.

The major control signals to the printer are INIT on pin 31, which tells the printer to perform its initialization sequence, and STROBE on pin1 which tells the printer “Here is a character for you”. The two addition input pins pin14 and pin16 are usually taken care of inside the printer.

The major status signals output from the printer are

1. The ACKNLG signal on pin10, which when low indicates that the character has been accepted and the printer is ready for the next character.

2. The BUSY signal on pin11, which is high if, for some reason such as being out of paper, the printer is not ready to receive a character.

3. The PE signal on pin12 which goes high if the out of paper switch in the printer is activated.

4. The SLCT signal on pin13, which goes high if the printer is selected for receiving data

5. The ERROR signal on pin32, which goes low for a variety of problem conditions in the printer.

image

image

Example: Interface a standard IEEE-488 parallel bus printer with 8086. Draw the necessary hardware scheme required for the same and write an ALP to print a character whose ASCII code is available in AL.

Solution: Before going through this solution, one should refer to the standard Centronix, INB or EPSON printer pin configuration, given in Table 5.11. There are two types of parallel cables used to connect a microcomputer with a printer, viz. 25 pin cables and 36 pin cables. Basically the 25 pin and the 36 pin cables are similar except for the 11 extra pins for ground (GND) used as ‘RETURN’ lines for different signals.

The group A is used in mode 1 for handshake data transfer so that port A is used for data transfer and port Clines PC3-PC5 are used as handshake lines. Port B lines are used for checking the printer status; hence port B is used as input port in mode o. Port C lower is used as output port for enabling the printer. The control words are shown in Fig. 1.4

image

image

image

Operation: The printer interface connections with 8255 and the printer connector in Fig.1.1 and Fig.1.2 respectively. First of all the printer should be initialised by a 50 µ S (minimum) pulse on the INIT pin of the printer. Then BUSY pin is to be to confirm if the printer is ready. If this signal is low, it indicates that the printer is to accept a character from the CPU. Port pins of 8255 may not have sufficient drive capacity to drive the printer input signals so the open collector buffers 74LSOY are used to enhance the drive capacity. Then the ASCII code of the character to be printed is sent on the eight parallel port lines. Once the data is sent on eight parallel lines, the STROBE signal is activated after at least 0.5µ s, to indicate that the data is available on the eight data lines. The falling edge of the STROBE signal causes the printer to make its BUSY pin high, indicating that the printer is busy. After a minimum period of 0.5µ S, the STROBE signal can be sent high. The data must be valid on the data lines for at least 0.5µ S after the STROBE signal goes high. After receiving the appropriate STROBE pulse, the printer starts the necessary electromechanical action to print the character and when it is ready to receive the next character, it asserts its ACKNLG signal low approximately for 5 ms. The rising edge of the ACKNLG signal indicates to the computer that it is ready to receive the next character. The rising edge of the ACKNLG signal also resets the BUSY signal from the printer. A low on the BUSY pin further indicates that the printer is ready to 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.1.3

image

image

Leave a comment

Your email address will not be published. Required fields are marked *