interfacing eeprom using pic16f877a
I2C is a more versatile system level serial data transfer method. It only needs two bus connected signals; clock (SCL) and data (SDA) lines .
These allow a master controller to be connected to up to 1023 other devices. These can include other MCUs, memory devices, analogue converters and so on. The example used here is access to an external EEPROM memory, which would be used to expand the non-volatile data storage in an MCU system, and is used in a general purpose PIC base module. The memory used here is a Microchip 24AA128, which stores 16 kb of data (128k bits);
The test program, attached below, reads and writes every location (16384 addresses) by this method. The maximum write cycle time specified is 5 ms (16384 0.005
82 s). It therefore takes a considerable time to complete this test. If the memory
is being accessed sequentially, as is frequently the case, the overall access time
can be reduced by using the page read and address auto-increment features of
the chip, which are explained in the EEPROM data sheet.