Interfacing to External EEPROM

Posted on Feb 5, 2014

An external EEPROM can be useful for several different reasons. External EEPROMs allow much more data to be stored than is available on the 18F4520. In addition, EEPROM memory saves state when power is removed. In this project, we interfaced to a Microchip EEPROM in random read/write mode. `Random` write mode specifies that the memory locations ac

Interfacing to External EEPROM
Click here to download the full size of the above Circuit.

cessed do not come in any sequential form. Although one can use this mode to access data sequentially in the EEPROM, there is a different protocol structure for sequential reads that increases throughput. In this project, we only developed the random write protocol. PIN1 and PIN2, A0 and A1 are hardware addressing bits, they correspond to 0xA0 (writing data) and 0xA1 (reading data). The first 4 bits are internally set to 1010 (A) and the second four correspond to the block of memory (0 or 1), A0 and A1 (hardware addressing we set to low in this circuit diagram) and read/(NOT write). PIN7, WP is the write protect line which has two states. When connected to logic high, normal read/write operation can be performed. When this pin is set low, only read operations are permitted. /* eeprom_rand_access. c Scott McLeod 03-05-2008 This program shows how to interface to an I2C extrenal Microchip EEPROM. This code is written for random reads and writes to the EEPROM */ #include <18f4520. h> #fuses HS, NOLVP, NOWDT, NOPROTECT #use delay(clock=20000000) #use i2c(MASTER, FAST, SCL=PIN_C3, SDA=PIN_C4, FORCE_HW) // use hardware i2c controller int8 EEPROM_WR = 0xA0; // I2C Address. 1010 0000. last bit = 0 => write command // First Nibble is fixed as 1010 (internal address); // Second Nibble is ABCD, // A = Block Set // B, C = Hardware Addresses (Configured when you Wire the CHIP) // D = (0 = write, 1 = read) int8 EEPROM_RD = 0xA1; // Same...

Leave Comment

characters left:

Related Circuits

  • New Circuits



    Popular Circuits

    AM loop antenna project
    Yongnuo YN-460 Flash Remote Power Control
    Discuss the design of the direct current stream source of numerical control and realize simply
    3 band equalizer
    diode radio circuit
    wire tracer circuit
    No Comment Added
    A simple project with AT90S2313
    555 monostable circuit is used as a table or capacitance resistance meter schematic