• Part: AN1096
  • Description: Using the C30 Compiler to Interface SPI Serial EEPROMs
  • Category: EEPROM
  • Manufacturer: Microchip Technology
  • Size: 328.70 KB
AN1096 Datasheet (PDF) Download
Microchip Technology
AN1096

Description

The 25XXX series serial EEPROMs from Microchip Technology are SPI compatible and have maximum clock frequencies ranging from 3 MHz to 20 MHz. Many times when designing an application which utilizes a serial EEPROM device, it may be beneficial to use a microcontroller which does not feature a dedicated protocol-specific serial port.

Key Features

  • Low-Density Byte Write Low-Density Byte Read Low-Density Page Write Low-Density Sequential Read Write Enable WIP Polling In addition, the following operations are available but not explicitly illustrated: * * * * * *
  • High-Density Byte Write High-Density Byte Read High-Density Page Write High-Density Sequential Read Write Disable Read Status Register Write Status Register The low-density routines are intended for use with the 4K and smaller density devices that use only one byte for addressing. The high-density routines are intended for use with 8K and higher density devices that use two bytes for addressing. This program also exhibits the WIP polling feature for detecting the completion of write cycles after the byte write and page write operations. Read operations are located directly after each write operation, thus allowing for verification that the data was properly written. No method of displaying the input data is provided, but a SEEVAL® 32 evaluation system, an oscilloscope, or a Microchip MPLAB® ICD 2 could be used. The low-density code was tested using the 25LC040A serial EEPROM. This device features 512 x 8 (4 Kbit) of memory and 16-byte pages. The highdensity code was tested using the 25LC256 serial EEPROM. This device features 32K x 8 (256 Kbit) of memory and 64-byte pages. Only the low-density operations are illustrated in this application note. Oscilloscope screen shots are labeled for ease in reading. The data sheet versions of the waveforms are shown below the oscilloscope screen shots. All timings are designed to meet the data sheet specs, and an 8 MHz crystal oscillator is used to clock the dsPIC33F DSC or PIC24F microcontroller. If a different clock is used, the code may need to be modified to avoid violating timing specs. All values represented in this application note are decimal values unless otherwise noted.