very basic matrix keypad question


Closed Thread
Results 1 to 2 of 2
  1. #1
    kitcat's Avatar
    kitcat Guest

    Default very basic matrix keypad question

    I am trying to work out how to scan a 3 x 4 matrix keypad using porta 0-2 and portB 0-3. The reason is that I am using portb 6 & 7 for ICSP so I consider that they are not really available. I am a bit new to this so please bear with me.
    Am I right in thinking that I need to pull porta pins high with pullup resistors, set portb 0-3 high and then take each portb pin low one at time and read the port a result? Is that how it works? Do I need pull up resistors on portb 0 - 3? I am using a 16f627

    Thanks

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


    Did you find this post helpful? Yes | No

    Default

    there's many different way to do a keyboard scan.. it's up to you to decide how to. There's few example here and there who show you how the author think. You can even use only one single pin using a a/d input. I/O expander, dedicated IC... list is long enough.

    Now, there's no real problem using the ICSP pin as long as you respect the ICSP convention stated in the Microchip ICSP guide.

    few months ago i posted a copy/paste solution bellow.
    http://www.picbasic.co.uk/forum/showthread.php?t=3250

    just make sure you disable the analog comparator on PORTA and you should be in business.

    Need more info?
    http://www.melabs.com/resources/samples/x1/pbp/keyx.bas
    http://www.rentron.com/serkey16.htm
    http://www.rentron.com/PicBasic/crosspoint.htm
    Steve

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

Similar Threads

  1. Matrix Keypad routine
    By mister_e in forum Code Examples
    Replies: 134
    Last Post: - 18th September 2022, 20:30
  2. 4 pin 4 x 4 keypad interface using pic basic pro
    By dunlao_john in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 15th January 2009, 05:21
  3. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 8th December 2008, 23:40
  4. Need help in matrix keypad coding
    By rano_zen06 in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 24th May 2008, 13:16
  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