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
Bookmarks