please dont rip this site

PIC Microcontroler based Keyboards


4x4 Keypad Standard Scanning with 8 io pins

Ken Webster says:

I just happened to have an example [of a keyboard to PIC interface]. It is for a 4x4 keypad connected to a 17C756 on PORTB. It doesn't do the fast scan ... just a plain old one-row-at-a-time scan. I had PORTB (output latch) set to 0. Weak pullups were enabled.

Pinout is kinda funky (to make PCB layout easier):


6---(1)-(2)-(3)-(A)
     |   |   |   |
7---(4)-(5)-(6)-(B)
     |   |   |   |
5---(7)-(8)-(9)-(C)
     |   |   |   |
2---(*)-(0)-(#)-(D)
     |   |   |   |
     3   4   0   1



;------------------------------------------------------------
;Called by interrupt handler to scan the keypad
;Returns with W=ASCII if a key is pressed, W=0 otherwise
;Interrupt handler performs debounce
SCAN1   MOVLW   ~0X40         ;Enable ROW0 output
        MOVWF   DDRB
        NOP
        NOP
        BTFSS   PORTB,3
        RETLW   '1'
        BTFSS   PORTB,4
        RETLW   '2'
        BTFSS   PORTB,0
        RETLW   '3'
        BTFSS   PORTB,1
        RETLW   'A'
        MOVLW   ~0X80         ;ROW1
        MOVWF   DDRB
        NOP
        NOP
        BTFSS   PORTB,3
        RETLW   '4'
        BTFSS   PORTB,4
        RETLW   '5'
        BTFSS   PORTB,0
        RETLW   '6'
        BTFSS   PORTB,1
        RETLW   'B'
        MOVLW   ~0X20         ;ROW2
        MOVWF   DDRB
        NOP
        NOP
        BTFSS   PORTB,3
        RETLW   '7'
        BTFSS   PORTB,4
        RETLW   '8'
        BTFSS   PORTB,0
        RETLW   '9'
        BTFSS   PORTB,1
        RETLW   'C'
        MOVLW   ~0X04         ;ROW3
        MOVWF   DDRB
        NOP
        NOP
        BTFSS   PORTB,3
        RETLW   '*'
        BTFSS   PORTB,4
        RETLW   '0'
        BTFSS   PORTB,0
        RETLW   '#'
        BTFSS   PORTB,1
        RETLW   'D'
        RETLW   0


file: /techref/microchip/4x4key8io.htm, 2KB, , updated: 2005/8/11 01:53, local time: 2008/11/22 01:56,
TOP NEW HELP FIND: 
38.103.63.58:LOG IN
©2008 PLEASE DON'T RIP! DO: LINK / DIGG! / MAKE!

 ©2008 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it!
<A HREF="http://www.piclist.com/techref/microchip/4x4key8io.htm"> PIC Microcontroler based Keyboards 4x4 Keypad Standard Scanning with 8 io pins</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be reviewed) Just type in the box and press the Post button. (HTML welcomed!): A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Did you find what you needed?

  PICList 2008 contributors:
o List host: MIT, Site host massmind.org, Top posters @20081122 Apptech, Jinx, Xiaofan Chen, olin piclist, Vitaliy, William \Chops\ Westfield, Tamas Rudnai, JonnyMac, Alan B. Pearce, Gerhard Fiedler,
* Page Editors: James Newton, David Cary, and YOU!
* Roman Black of Black Robotics donates from sales of Linistep stepper controller kits.
* Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters.
* Monthly Subscribers: Shultz Electronics, Timothy Weber, on-going support is MOST appreciated!
* Contributors: Richard Seriani, Sr.
  'What can I do?' - SiCKO

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .