picc keyboard
i use an application called quickbuilder for ccs and pic mcus
it has many drivers for 4x4 keyboards etc you just challange the build engine
and it returns the
fully built driver code block you then just include and init
youll find an example setup of code in here
**broken link removed**
the designs for comvdd ebox the code there is half made for testing and as example of a big driver in usemade by quickbuilder
i see by there site that it is not being distributed anymore at the moment
so here is a driver i compiled within quickbuilder for you
i used bport 0-3 and 4-7 pins for rows and columbs
but its quite easy to change to the pins you want
even adding a set of defines so the driver is easly setup then included
you need to init the driver as mentioned in the driver text
i see on the quickbuilder site the app is now
the full version with just limited libs and sources
however it loaded the design i made ok
so you can use it to change the design to what you need
as a kind of demo test of quickbuilders ability {a very handy tool }
to read the data from any keyboard
you pull the clock pin high
then let the keyboard controller pull it back low
then each bit is clocked out of the data line
9600baud 1 start 1 stop bit
so you need only to add a serial clock output to the serial port command string on any pic with a hardware uart software uarts wont work so well
its easy to read AT keyboard
ps2 is almost identical and the differenace is transparent to the data they produce
5 pin din is just a different plug and slight protocol changes
there are many keyboards all are 9600 baud
a good thing to do is look for links to texts
as ps2 keyboards can be init to use advanced drivers but ALL default to a standard local area layout