















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!
















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.
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.
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.
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.
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.
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.
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.
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.