Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Working with aaPIC16F877 and a keypad for signal generator...

Status
Not open for further replies.

si2030

Member
Hi there,

I am still quite new to this.

I have a 4 X 4 keypad... has 8 pins. I am attaching 4 pins to RB1 - RB4 and the other 4 pins to RD4 - RD7.

I intend to force an interupt on the portB via the first 4 pins.

What I need to know is... if I enable weak pullups on say RD4 - RD7 and a user presses a button will the PIC register a true ON signal on the D port?

Of course there will be a port value of 1 on port B but given that portD pin has a weak pullup already will it register that current is moving.. and change that port value from 0 to 1.

I need to test both portB and portD to determine which button has been pressed...

In another way can I use weak pullups to allow current to flow if a key has been pressed and while the key is not pressed does that port pin with the weak pullup have a value of "0"?

Hope I have explained this OK...

Kind Regards
Simon
 
Yes, weak pullups are more than enough to pull an input high, that's what they are there for.

However, you seem confused about how keypads work?, you don't check PortB and PortD, only B will be inputs, D will be outputs - so there's no need for pullups anyway, just set PortD high. Once a key press has been detected, you then have to scan the keypad to see which key it was (my tutorials explain this).
 
hi.
This pdf also deals with interrupts on PORTB when using a 4*4 keypad.

Did you read the pdf I posted on the other thread of yours.:)
 

Attachments

  • KeyIntr1..pdf
    89.9 KB · Views: 233
Status
Not open for further replies.

Latest threads

Back
Top