Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
From an article said:Software Interface
In this section, we will show how the scan code is generated using a Software Interface. As stated before, the keyboard switches are arranged in a matrix of rows and columns. To show how a scan code can be generated using a software interface we shall take, as an example, the hexadecimal keypad.
Circuit Description
* The keypad Switches are connected in a matrix of rows and columns :
-The rows of the matrix are connected to four output port lines.
-The columns of the matrix are connected to four input port lines.
-For simplicity, the rows of the matrix are connected to four input lines.
* When no key is pressed, the column lines are high.
* When a key is pressed, it connects a row to a column.
* If a row is at low and a key in that row is pressed, this low will appear on the column that contains the pressed key and it can be detected on the input port.
* If we can determine the row and column of a key, then we can determine which key it is and so we can assign to it an ASCII code.
Algorithm Description
The following Algorithm shows how to determine the row and column of a key and generate its Scan code:
1-Step One : Output Zero’s to all rows.
2-Step Two : This step consists of a Loop in which we read columns over and over until the columns are all high. We do this to make sure that the previous key has been released before we look for the next one. This is called Two-key lockout.
3-Step Three : Upon exit from Step Two, control goes to this step which is also a Loop. This loop reads columns over and over until one column is low which indicates that a key has been pressed.
4-Step Four : Upon exit from the previous loop, a check is done to avoid the effect of noise. During this stage, columns are read so that if they are high again, this means that the low detected in the step Three was caused by a noise rather than a key press. In this case, control goes back to step Two otherwise step Five is executed.
5-Step Five: Once we reach this step, we need to determine the row and column of the pressed key. This is done in this step which is also a LOOP. In this loop, a low is output on one row and then columns are checked. The loop continues until a low on a column is detected. The row of the pressed key is the row which is low at this moment and its column is the low column.
At this stage we can determine the Scan code which is the 8-bit read from the input port. It consists of D0..D3 which represents the column of the pressed key and D4..D7 which is the row of the pressed key.
...more details, pls read **broken link removed**
asic1984 said:hi
thanks for your help
i want to make keypad scanning (software)...............but can u givemore details about how can i do it
thanks for help
For parallel port interfacing to keypad, I think you need pullup resistors as shown in Figure 1. You may also wish to read this INTERFACING WITH THE KEYPAD A MORE COMPLEX PARALLEL PORT EXAMPLE **broken link removed**asic1984 said:for nicleo: is this algorithm mean that i will connect the keypad directlly to parallel port without any interfacing to pullup resistors and positive supply voltage as what i already do (but characters are not reading correctly)
also how can i overcome debounce problem
if someone can send schematic for the connection
and thanks all for help
hi
how to use the 4x3 keypad?
You have asked the same question in 11 different threads in this forum in the last 2 hours,
don't you think that 1 or 2 posts are enough?
Alex