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:

New Circuits

.

 


Popular Circuits

3 Watt FM transmitter
Window Comparator Circuit
Magnetic Proximity Switch Circuit
Solar Charge Controller connection with solar panel
digital scoreboard circuit
By single-phase active power factor correction (APFC) Make up three-phase APF
audio bandpass filter
dac en
UPS Circuit For Cordless Phones PCB
555 timer circuit temperature monitoring system
Nine Tube Stereo Amplifier 1



Top