how to use external eeprom in pic 16f877a
>how do i interface an external eeprom to my pic
Descide how much storage you need
Descide how fast you need to read and write to the eeprom, eg some eeprom memorys take 10mS to perform a write operation which is too slow for some applications.
Read eeprom device datasheets
Decide if you are going to directly control the logic levels on all the PIC pins that connect to the eeprom or if you are going to use the SPI/I2C hardware in the PIC.
Choose an eeprom device
Allocate PIC pins, allowing for all the other things you need to connect to your PIC for your project.
Purchase parts
Connect parts together.
> how do i write the source code?
Choose a language, usually C or device specific assembly language
Get a compiler.
Read the manufacturer's datasheet that gives information about the microcontroller you are going to use.
Start learning how to write microcontroller software by flashing some LED's.
Read the datasheet for the eeprom device you have chose.
Study the information about how to control the eeprom
Write software that makes the pins on the PIC change in a way that controls the eeprom device.
Write seperate routines for reading and writing.
Write test code that checks that the data is being stored properly
Debug software and hardware.
>how to write source code for my keyboard part
Read information about the details of how the PS/2 keyboard
interface works.
It's easy because it is controlled by the host, the keyboard will not send data
while your uC is doing somthing else.
Write software that toggles the clock connections and stores bit's from the keyboard.
Write software that examines a complete byte from the keyboard and stores in the information about which key has been pressed in a usfull form in PIC memory for use by other parts of your software.