| Electronic Components Datasheet Search |
|
AN2244 Datasheet(PDF) 10 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN2244 Datasheet(HTML) 10 Page - STMicroelectronics |
|
10 / 17 page ![]() 3 Application example: EEPROM emulation using ST10F27x Flash library AN2244 10/17 ReadVariable( ) routine This function reads variable data. Only last update is read. The function enters in a loop in which it reads the variable entries until the last one is found. Finally, the data is returned. See below for the procedure of reading the last variable entry in the eeprom. Figure 5. ReadVariable flowchart WriteVerifyVariableFull( ) routine If a write should occur, the write process must either update a variable, or create the first instance of a variable. The routine has as parameters: ● variable index (0 for A, 1 for B or 2 for C) ● all variables Array ● 32-bit data to be written If the data to be written is equal to 0xFFFFFFFF, we look for the last data equal to 0xFFFFFFFF and we write 0x00000000 in next location to indicate that 0xFFFFFFFF is a data and not a blank location. Find Valid sector Read_Data=0xFFFFFFFF ? address = base address of the variable in the valid sector ReadVariable No Yes No Read_data = FlashRead(address) FlashRead(address+4) =0x00000000? FlashRead(address+4) =0xFFFFFFFF? Yes address = address + 8 Yes address = variable start address ? return VARIABLE_EMPTY Yes No FlashRead(address-8)=0xFFFFFFFF? && FlashRead(address-4)=0x00000000? No output = FlashRead(address - 4) return output Yes output = 0xFFFFFFFF return output address = address +4 |
|
|
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 |