How does a 4x4 Keypad work with PIC 16f877A?

  • Thread starter Thread starter kloong
  • Start date Start date
  • Tags Tags
    Work
AI Thread Summary
A 4x4 keypad works with the PIC 16F877A by scanning its rows and columns to determine which key is pressed. The inputs B0 through B3 are configured with internal pull-ups, allowing them to read a logic high (5V) when no button is pressed. To scan a column, one output pin (e.g., B4) is set to 0V, and the inputs are read; if a button in that column is pressed, the corresponding input pin will read 0. By sequentially setting each column output to 0 and reading the inputs, the specific pressed buttons can be identified. This method effectively allows for the detection of multiple key presses across the keypad.
Engineering news on Phys.org
Normally, your inputs B0 through B3 are configured so that the internal pull-ups are on (that way, when you read these inputs, you see 5V, or a logic 1). You normally have the outputs B4-B7 set to 5V.

Now, when you want to scan a column, say, the first one, you set one of the outputs (in this case, B4) to 0V, logic 0.

You then read the inputs. If any of yhebuttons are pressed in this column, you'll read 0 on those pins. If buttons SW1 or SW9 were pressed, they would connect 0V across the button and you would read 0 on pins B0 and B2, and 1 on pins B1 and B3.

By successively setting each individual column to 0, and then reading the inputs to see which buttons are pressed in that row, you can figure out which buttons are pressed in the entire keypad.
 
Posted June 2024 - 15 years after starting this class. I have learned a whole lot. To get to the short course on making your stock car, late model, hobby stock E-mod handle, look at the index below. Read all posts on Roll Center, Jacking effect and Why does car drive straight to the wall when I gas it? Also read You really have two race cars. This will cover 90% of problems you have. Simply put, the car pushes going in and is loose coming out. You do not have enuff downforce on the right...
I'm trying to decide what size and type of galvanized steel I need for 2 cantilever extensions. The cantilever is 5 ft. The space between the two cantilever arms is a 17 ft Gap the center 7 ft of the 17 ft Gap we'll need to Bear approximately 17,000 lb spread evenly from the front of the cantilever to the back of the cantilever over 5 ft. I will put support beams across these cantilever arms to support the load evenly
Thread 'What's the most likely cause for this carbon seal crack?'
We have a molded carbon graphite seal that is used in an inline axial piston, variable displacement hydraulic pump. One of our customers reported that, when using the “A” parts in the past, they only needed to replace them due to normal wear. However, after switching to our parts, the replacement cycle seems to be much shorter due to “broken” or “cracked” failures. This issue was identified after hydraulic fluid leakage was observed. According to their records, the same problem has occurred...
Back
Top