| Electronic Components Datasheet Search |
|
AN2244 Datasheet(PDF) 8 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN2244 Datasheet(HTML) 8 Page - STMicroelectronics |
|
8 / 17 page ![]() 3 Application example: EEPROM emulation using ST10F27x Flash library AN2244 8/17 3.4 EEPROM software description This section describes the software implemented for EEPROM emulation using the ST10F27x Flash library provided by STMicroelectronics. This example uses the 3 variables A, B and C already defined. The project contains 3 source files in addition to the three library source files: ● eeprom.c: containing C code for the following project routines EepromFormat( ) WriteVariable( ) ReadVariable( ) FindValidSector( ) WriteVerifyVariableFull( ) EepromSectorTransfer( ) FlashRead( ) ● eeprom.h: containing the routines’ prototypes and some declarations. ● main.c: This application program is an example that uses the routines described in eeprom.c in order to write and read from the eeprom. 3.4.1 Header field The header field occupies each sector base address and gives the sector’s status information. Each sector has four possible states: ● ERASED: This sector is empty. ● RECEIVE_DATA: This sector is receiving data from the full one. ● VALID_SECTOR: This sector contains valid data and this state will not change until valid data are completely transferred to the erased sector. ● TRANSFER_COMPLETE: Transfer of data to the other sector is finished and this sector is no longer in use. The system can then erase this sector to prepare it for future data. The Figure 3 shows how to switch from one state to another for both sectors. 3.4.2 Variables array Every variable is defined by its start address in its allocated memory space. An array of variables is declared and located in the user application as described in Section 3.4.4 Its size must be defined in the eeprom.h file. |
|
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |