Hi!
Yes and no... To drive the LCD you need to use a pin for enable. You
can't use that pin for scanning the keypad. So... Here's what I've
done:
LCD --> PIC --> Keypad
DB7 RB3 Row4
DB6 RB2 Row3
DB5 RB1 Row2
DB4 RB0 Row1
R/W RB4 Col1
RS RB5 Col2
RB6 Col3
RB7 Col4
E RAx
As you can see I used one port and one additional pin for E... The
software initializes PortB all high and all outputs. When driving the
LCD display make sure to keep RB6 and RB7 high! For scanning the
keyboard I make RB0 to RB3 inputs and pull RB4 to RB7 low one after
the other to scan the keyboard. Oh ja, you need pull-ups on RB0 to
RB3 (either external or enable internal if 16F84) and you need diodes
in the lines connecting the keys to RB0 to RB3 to prevent
interference between the LCD and keys...
Hope this helps...
Regards,
Adi
{Quote hidden}> Hello All !
>
> Is it possible to connect an LCD (in 4bit mode) and an Keypad (4x4) at the
> same Port of an PIC. If yes, how has the Hardware to be ??
>
> Thanks a lot for answers :-)
>
>
schaedle
KILLspamswol.de
> \ olle /
.....schaedleKILLspam
.....usa.net
> \/\/olfgang DB6TE @ DB0CZ
>