Académique Documents
Professionnel Documents
Culture Documents
Bonus 2:
Here are the download links.(One for the schematic files and one for
the schematic tool).
Schematic project files click to download.
ProSchematic tool click to download.
Mikroelectronika
C compiler
V5.0.0.3 Free!
Target
16F877A
(retargetable to
other PICs that
have an 8 bit
port!).
Software level
Easy.
Software notes
Switching
between keypad
and LCD.
Hardware level
Easy.
Hardware notes
Use internal
pullups on portB
(you must add
pullups to row
inputs when
using a different
port).
Initial Release
Mod to operate
fully at 20Mhz
(0,# lost). Allow
settling time
Download here
You can program the PIC in circuit through the ICSP connector.
Column shorts
Pressing two keys in different columns and rows shorts together two
columns that are at different voltages (one at 0V and one at
5V). The column drivers are isolated by the three 10k resistors to
prevent damage. They also allow the LCD to operate correctly even
when keys are pressed.
Kepad wiring
The following diagram shows the keypad wiring which is a little
awkward - probably to allow a simple pcb routing path.
Software operation
The software consists of three files:
16F887A_lcd_keypad.c
lcd_keypad.c
lcd_keypad.h
The most important routines are
KEYPAD_access() and LCD_access() which set the port up to let it control the
keypad and lcd respectively. The
interesting point about the code is that
the standard LCD routines (provided by
compiler manufacturer) are used after
lcd_access() is executed.
Pressing a key displays the result on the
lower right of the 2 row LCD.
Note that key debouncing has not been
done as it does not affect the demonstration but you must use it for a
'real' application.