8x8 keypad matrix...


Results 1 to 6 of 6

Threaded View

  1. #1
    Join Date
    Oct 2008
    Posts
    65

    Default 8x8 keypad matrix...

    Hi, I got my 4x4 keypad working using keypad.bas file from Setve. Now I'm trying to modify it to create 8x8 PortB for rows and PortD for Columns. Kindly check my codes and schematic, I use 1k for the resistors.
    Code:
    TRISB = %00000000 	
    PortB = 0 
    TRISD = %11111111 	
    PortD = 1  		
    ADCON1 = 7 		;Make PORTA and PORTE digital 				
    OPTION_REG.7 = 0 	
    			
    	
    INCLUDE "KeyPad.bas" 
       '                      
        '    Hardware connection
        '    ===================
        DEFINE KEYPAD_ROW        8       ' 8 row 
        define KEYPAD_ROW_PORT   PORTB   '   on PORTB
        DEFINE KEYPAD_ROW_BIT    0       '      
        DEFINE KEYPAD_COL        8       ' 8 col 
        DEFINE KEYPAD_COL_PORT   PORTD   '   on PORTD
        DEFINE KEYPAD_COL_BIT    0       '      
       
      
        '
        '    Serial Communication definition
        '    ===============================
        DEFINE HSER_TXSTA 24h            ' enable transmit, BRGH=1
        DEFINE HSER_SPBRG 129            ' 9600 Bauds
    
        '   
        '    Variables definition 
        '    ===================
        myvar                    var byte
    
        '    ---------------------------------[Program Start]----------------------------------------------
    start:
        @ READKEYPAD _myvar
        hserout ["Key=",dec myvar,13,10]
        goto start
    thanks in advance,
    mbox
    Attached Images Attached Images  

Similar Threads

  1. Matrix Keypad routine
    By mister_e in forum Code Examples
    Replies: 134
    Last Post: - 18th September 2022, 20:30
  2. calculator-like code entry with matrix keypad and display
    By Dennis in forum mel PIC BASIC Pro
    Replies: 35
    Last Post: - 16th December 2009, 22:58
  3. Need help in matrix keypad coding
    By rano_zen06 in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 24th May 2008, 13:16
  4. Inconsistent output on a 4x4 matrix keypad
    By markcadcam in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 24th November 2006, 03:54
  5. very basic matrix keypad question
    By kitcat in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 8th July 2006, 21:33

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