• AVR Freaks

Am I interfacing the keypad to the PIC controller correctly ?

Author
abhi143
Starting Member
  • Total Posts : 85
  • Reward points : 0
  • Joined: 2018/05/20 09:06:52
  • Location: 0
  • Status: offline
2020/01/14 19:20:16 (permalink)
0

Am I interfacing the keypad to the PIC controller correctly ?

I have connected matrix keypad to pic16f877a with pull up. I have attached picture of connection 
 
1) What should be  value of Pull ups resistors ?
2) Am I interfacing the keypad to the controller correctly ?
 

Attached Image(s)

#1

3 Replies Related Threads

    ric
    Super Member
    • Total Posts : 25244
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: Am I interfacing the keypad to the PIC controller correctly ? 2020/01/14 19:24:31 (permalink)
    0
    abhi143
    1) What should be  value of Pull ups resistors ?

    Any value from 1k to 47k should be fine. I'd go for 10k
     

    2) Am I interfacing the keypad to the controller correctly ?

    That's ok, but your code is just as important.
    You don't have any series diodes on your column drive signals, so it's important that when scanning the keypad, you drive one of the columns low  in turn (RD0, RD1, RD2 or RD3), and float the other three (by setting the appropriate TRISD bits).
    If you don't do this (i.e. if you drive one low and the other three high), then if the user presses two buttons at once, you might short together a pin driving high with a pin driving low!
     
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #2
    teenix
    Junior Member
    • Total Posts : 48
    • Reward points : 0
    • Joined: 2017/12/21 13:47:21
    • Location: Australia, Melbourne
    • Status: offline
    Re: Am I interfacing the keypad to the PIC controller correctly ? 2020/01/14 21:35:20 (permalink)
    0
    You can delete the resistors by using internal pullups. They work fine for keyboards like this.
     
    Floating inputs is not a good idea as all sorts of weird things can happen with the processor and leave you scratching your head trying to find the problem. (It worked yesterday, why not today)
     
    Why not try one of the newer PICs, then you can use open collector outputs for the columns so they only pull low which is what you want and no external components at all other than the keyboard. Otherwise, as mentioned you will need to isolate the columns with diodes.
     
    cheers
     
    Tony
    #3
    oliverb
    Super Member
    • Total Posts : 258
    • Reward points : 0
    • Joined: 2009/02/16 13:12:38
    • Location: 0
    • Status: offline
    Re: Am I interfacing the keypad to the PIC controller correctly ? 2020/01/15 03:47:15 (permalink)
    +2 (2)
    Are these physical switches or a "membrane" type? If it is membrane then it may be worth checking the contact resistance, it can be surprisingly high.
    #4
    Jump to:
    © 2020 APG vNext Commercial Version 4.5