Serial EEPROM API Supported Serial EEPROM parts Serial

  • Slides: 13
Download presentation
Serial EEPROM API Supported Serial EEPROM parts Serial EEPROM API introduction Detailed Serial EEPROM

Serial EEPROM API Supported Serial EEPROM parts Serial EEPROM API introduction Detailed Serial EEPROM API Function presentation Serial EEPROM example application NET+OS Software Group 1 -1

Supported Serial EEPROM Parts l l l Atmel AT 25080/160/320/640 family of SPI serial

Supported Serial EEPROM Parts l l l Atmel AT 25080/160/320/640 family of SPI serial EEPROMs. EEPROM sizes are 1 KB, 2 KB, 4 KB and 8 KB respectively. Driver uses four NET+50 GPIO lines to interface with the serial EEPROM to free up a chip select (CS) line and the SPI interface. Port. C, Port. D, Port. F, Port. G and Port. H GPIO lines are supported and I/O lines from different Ports can be mixed and matched. Driver supports the burst mode read and page mode write features of the serial EEPROM for optimal performance.

Supported Serial EEPROM Parts (continued) l Driver supports the write protection features of the

Supported Serial EEPROM Parts (continued) l Driver supports the write protection features of the serial EEPROM.

Serial EEPROM API l l l NASEInit() NASECreate. Semaphores() NASEWrite() NASERead() NASEMemset() NASEBlock. Write.

Serial EEPROM API l l l NASEInit() NASECreate. Semaphores() NASEWrite() NASERead() NASEMemset() NASEBlock. Write. Protect()

NASEInit() l l int NASEInit (unsigned long eeprom. Type, unsigned long chip. Select. Line,

NASEInit() l l int NASEInit (unsigned long eeprom. Type, unsigned long chip. Select. Line, unsigned long clock. Line, unsigned long serial. In, unsigned long serial. Out); Specifies the EEPROM part and the GPIO lines used to interface the EEPROM. Also initializes global variables and the GPIO ports used to interface with the EEPROM part. Called ONCE after power up. eeprom. Type can be: – AT 25080, AT 25160, AT 25320 or AT 25640

NASEInit() (continued) l l chip. Select. Line, clock. Line and serial. In can be:

NASEInit() (continued) l l chip. Select. Line, clock. Line and serial. In can be: PORTC_BITx, PORTD_BITx, PORTF_BITx “serial. Out” can be: PORTC_BITx, PORTD_BITx, PORTF_BITx, PORTG_BITx, PORTH_BITx

NASECreate. Semaphores() l l int NASECreate. Semaphores(); Creates the semaphores used to synchronize access

NASECreate. Semaphores() l l int NASECreate. Semaphores(); Creates the semaphores used to synchronize access to the serial EEPROM driver API. Called by the user application ONCE after power up. NASEWrite(), NASERead(), NASEMemset() and NASEBlock. Write. Protect() are semaphore protected.

NASEWrite() l l int NASEWrite(unsigned long offset, char * buffer, unsigned long length); Writes

NASEWrite() l l int NASEWrite(unsigned long offset, char * buffer, unsigned long length); Writes data starting from the specified offset location in the serial EEPROM memory.

NASERead() l l int NASERead(unsigned long offset, char * buffer, unsigned long length); Reads

NASERead() l l int NASERead(unsigned long offset, char * buffer, unsigned long length); Reads data from the serial EEPROM starting at the specified offset location in the serial EEPROM memory.

NASEMemset() l l int NASEMemset (unsigned long offset, char data, unsigned long length); Initializes

NASEMemset() l l int NASEMemset (unsigned long offset, char data, unsigned long length); Initializes sections of the serial EEPROM with the specified character.

NASEBlock. Write. Protect() l l l int NASEBlock. Write. Protect (unsigned char protection. Level);

NASEBlock. Write. Protect() l l l int NASEBlock. Write. Protect (unsigned char protection. Level); Sets the write protect level for the serial EEPROM. protection. Level can be: – WRITE_PROTECT_LEVEL 0 – write protection disabled – WRITE_PROTECT_LEVEL 1 – write protection enabled for last ¼ of the address range – WRITE_PROTECT_LEVEL 2 – write protection enabled for the second ½ of the address range – WRITE_PROTECT_LEVEL 3 – write protection enabled for the entire address range.

NASEBlock. Write. Protect() (continued) l Write protection settings are “non-volatile”. Thus, the write protection

NASEBlock. Write. Protect() (continued) l Write protection settings are “non-volatile”. Thus, the write protection setting will remain until it is changed.

Serial EEPROM Example Application l l netosxsrcexamplesnaseeprom Configured to access a AT 25640 serial

Serial EEPROM Example Application l l netosxsrcexamplesnaseeprom Configured to access a AT 25640 serial EEPROM using I/O lines from various GPIO ports. Verifies the functionality of the serial EEPROM’s write protection feature. Allows reading / writing entire serial EEPROM memory 1 byte per NASERead() / NASEWrite() call to reading / writing 8 KB with one NASERead() / NASEWrite() call.