connecting a 4X4 keypad


Closed Thread
Results 1 to 7 of 7
  1. #1
    fadibasic's Avatar
    fadibasic Guest

    Default connecting a 4X4 keypad

    Hi Guys,
    I am looking in understanding how to connect a keypad to a pic16f877.
    I have read a lot and I am starting to get confused. Some requires resistor and some require resistor and diode. can someone explain to me when do we need resistor and when do we use diodes?

  2. #2
    Join Date
    Mar 2006
    Location
    INDIA
    Posts
    89


    Did you find this post helpful? Yes | No

    Default

    Best way to connect keyboard.

    http://www.picbasic.co.uk/forum/showthread.php?t=3250

    Hardware Connection
    ===================
    1. Column bits must have Pull-up resistor attach to VCC
    2. ROW bits must be connected in series with resistor.
    .
    Last edited by precision; - 25th April 2008 at 07:29.

  3. #3
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Actually there's no such thing as 'best way' to do anything... hmmmm... I suppose I can think of a few things, but I digress...

    Technically, if you have a 4 x 4 keypad, you can link the columns to four PIC Pins and the Rows to four PIC pins, no Resistors, Diodes or anything else needed. The rest is creative software. However you DO need to use pins which have integral Pull-Up's. Typically, assigning PORTB on a 16F628, 16F876, 18F2420 (etc etc to name a few out of many) all do the job admirably.

  4. #4
    fadibasic's Avatar
    fadibasic Guest


    Did you find this post helpful? Yes | No

    Default

    Melanie,
    What about pic16f877? and what do you guys mean by Pull Ups?

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Whatever the PIC you're using, you can use almost every I/O on it. The software must be done to work with your own assignment. Not much.

    PIC16F877A have internal pull-up which can be enable by software... but they're on PORTB ONLY. No problem if you don't need any feature available on PORTB. Just hook your keypad on PORTB, use
    Code:
    OPTION_REG.7=0 ' Enable internal pull-up on PORTB
    and away you go.

    Explanation of pull-up.
    http://www.seattlerobotics.org/encod...97/basics.html
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  6. #6
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    By the kind of question you've asked, it looks like you're not too experienced with PICs. Yes, 16F877 is fine, if you checked you'd discover it has a PORTB and if you look at the Datasheet (which you can freely download from the Microchip website - and is a MUST!!!) you will discover that PORTB on that PIC also has pull-up's. All a pull-up is, is a Resistor internal to the PIC, which you can program the PIC to switch-in if you need it. That Resistor connects between the relevant PIC pin and Vdd (+ve supply rail) pulling that pin up to +ve (hence the name). Just saves you having to provide one externally.

  7. #7
    proper's Avatar
    proper Guest


    Did you find this post helpful? Yes | No

    Default

    hi dude...

    thanks for posted the link...

    that helps me to clear the idea of knowing hoe to connect the keyboard effectively

Similar Threads

  1. 4x4 keypad Help
    By aaliyah1 in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 5th October 2010, 16:34
  2. Need help in matrix keypad coding
    By rano_zen06 in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 24th May 2008, 13:16
  3. 4x4 Keypad and LCD sharing port B
    By msnm4 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 9th May 2008, 08:13
  4. I2C PCF8574 4X4 Keypad routine
    By RFsolution in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 28th January 2007, 21:25
  5. Inconsistent output on a 4x4 matrix keypad
    By markcadcam in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 24th November 2006, 03:54

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts