Docsity

Interfacing of 8086 microprocessor using 8255 PPI, Slides of Microprocessor and Interfacing

Partial preview of the text

Download Interfacing of 8086 microprocessor using 8255 PPI and more Slides Microprocessor and Interfacing in PDF only on Docsity!

  • CHAPTER

Hex Keyboard Interfacing

To understand the mechanism of how a keypress is detected and how the pressed key is identified, we use a hexadecimal keyboard, which has 16 keys with the characters 0 to F.  (^) This keyboard is interfaced to the 8086 through the port lines of the 8255. The program identifies the key that has been pressed and displays it.

Key Debounce

The key that we are using has mechanical contacts and is susceptible to what is called ‘key jitter or bounce’. That is, when a key is pressed, the key moves back and forth between the contacts for a certain time before it settles. To ensure that the key settles before we read the key, we allow a certain time for it – and this is called the key debounce time.

Steps in keyboard interfacing

i) Keep the rows grounded and read in the columns. If any column gives a ‘0’, we know that a key might be pressed. Wait for a time corresponding to the key debounce time. After this, if the column reading is still 0, it means that there is a valid keypress. ii) Ground one row at a time and read in the columns. When a grounded row produces a column reading, which is not ‘1111’, the row is identified.

Keyboard interfacing –contd’

iv) The number corresponding to

each key is in a look up table, stored

in the order of the keys of the

keyboard. Once identification is

done, this is brought and saved in a

memory location, after which it can

be displayed if necessary.

Interfacing LED Displays

LEDs are very popular display devices. They are easy to use and give very bright and pleasing display which can be viewed equally well from any viewing angle, unlike LCDs. The only drawback with LED displays is the high amount of current they need, unlike LCDs which need very low power.

Figure 9.39 | A single LED

Figure 9.41 | A seven segment

LED display unit

Static Seven Segment Displays

In a display set up of more than one seven segment LED, if all of them remain ON all the time, it is called a static display. Static displays cause a lot of current to be used up and are not preferred.

Steps for dynamic display

i) The common anode/cathode of a digit is to be activated for a digit to be active. ii) At a time, only the segments of one digit are ‘ON’. iii) After a specified delay, this digit is switched off and the segments of the next digit are ON. The information displayed here is different from that of the previous case. iv) Thus, for display multiplexing, consecutive digits should be switched on in a cyclic fashion, and for each digit, the segment information should be supplied.

Example 9.

 Assuming a common cathode type of display, fi nd the seven segment codes to be sent to Port B for displaying i) 8, ii) A, iii) b.

Example 9-20 -solution

Since it is a common cathode type, the common cathode of the LEDs of a digit are to be grounded. Then, supply the segment information to the anodes For displaying 8, the segments to be lighted up are a, b, c, d, e, f, g. Since, we are using a common cathode type of display, the data to light up a segment is ‘1’. Hence, the bits from D0 to D6 is ‘1’. Thus, the seven segment code for the display of 8 is 0111 1111, i.e., 7 FH. i) Similarly for ‘A’ it is 0111 0111 i.e., 77 H. ii) For ‘b’ it is 0111 1100 i.e., 7 CH.