Column1 = Bit0
Column2 = Bit1
Column3 = Bit2
RowA = Bit3
RowB = Bit4
RowC = Bit6
RowD = Bit7
At the beginning of the program I inserted:
Code: Select all
asm __CONFIG _CONFIG1, _INTRC_IO & _DEBUG_OFF & _LVP_OFF & _BODEN_OFF & _MCLR_ON & _PWRTE_ON & _WDT_OFF
Code: Select all
asm __CONFIG _CONFIG2, _IESO_ON & _FCMEN_OFF
Code: Select all
asm osccon = 0x70;/sets internal osc to 8MHz
Then it goes on to:
Declare a variable "NUMBER" =255
Macros- Start and Clear LCD
Macro- PrintASCII("S") to LCD
Begin Loop
Macro- GetKeypadNumber with Return Value "Number"
IF NUMBER<>255 THEN Clear LCD and PrintNumber(NUMBER) to LCD
End Loop
When I run the program on the PIC, The "S" displays for about 1 second then screen clears for a second. After that an 11 displays, flashing in 1 second intervals. Sometimes a 10 displays, but mostly 11. If I press a key on the keypad, that number will eventually flash on the display after a few flashes and in between a 10 or 0.
It seems like this is an OSC and a pin configuration issue. Any ideas?