Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

keypad interface and scan

Status
Not open for further replies.
Joined
Apr 8, 2012
Messages
201
Helped
3
Reputation
6
Reaction score
2
Trophy points
1,298
Activity points
0
Hi!
I need a 4x1 keypad scan code for pic16f877a. I have attached the schematic.

4x1 keypad is connected to portb

Initial settings
OPTION_REG.B7 = 0; // all pull-ups enabled
TRISB = 0b00001111;

I don't want to use the keypad library.

I just need to scan the portb for 0b00001110, 0b00001101, etc...

I want to know with all pull ups enabled and B0 - B3 configured as Input and B4 - B7 configured as output. how to scan portb?
 

Attachments

  • 4x1_keypad_portb1.JPG
    4x1_keypad_portb1.JPG
    27.7 KB · Views: 52

Don't know how to explain in English Language, I show in C Language below.
Code:
RB4=0;
keypad=PORTB&0b00001111;
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top