数据搜索系统,热门电子元器件搜索
  Chinese  ▼
ALLDATASHEETCN.COM

X  

AN2540 数据表(PDF) 13 Page - STMicroelectronics

部件名 AN2540
功能描述  EEPROM emulation in STR91xFxx devices
PDF  25 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
制造商  STMICROELECTRONICS [STMicroelectronics]
网页  http://www.st.com
标志 STMICROELECTRONICS - STMicroelectronics

AN2540 数据表(HTML) 13 Page - STMicroelectronics

Back Button AN2540 Datasheet HTML 9Page - STMicroelectronics AN2540 Datasheet HTML 10Page - STMicroelectronics AN2540 Datasheet HTML 11Page - STMicroelectronics AN2540 Datasheet HTML 12Page - STMicroelectronics AN2540 Datasheet HTML 13Page - STMicroelectronics AN2540 Datasheet HTML 14Page - STMicroelectronics AN2540 Datasheet HTML 15Page - STMicroelectronics AN2540 Datasheet HTML 16Page - STMicroelectronics AN2540 Datasheet HTML 17Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 13 / 25 page
background image
AN2540 - Application note
Implementing the EEPROM emulation
13/25
The procedure of updating a variable entry in the EEPROM is shown in Figure 4.
Figure 4.
1st method: WriteVariable flowchart
If the data to be written is equal to 0xFFFF, it is necessary to find the last data equal to
0xFFFF and to write 0x0000 into the next location to indicate that 0xFFFF represents data
and not a blank location. If the data to be written is different from 0xFFFF, it is then written to
the last location that contains 0xFFFFh (the following location should not contain 0x0000).
This function returns 0 on success, VARIABLE_FULL if there is not enough memory space
for a variable update, or a Flash error code indicating an operation failure (erase or
program).
Table 6.
WriteVerifyVariableFull
Function Name
WriteVerifyVariableFull
Function Prototype u16 WriteVerifyVariableFull(u8 index, u32 *T, u16Data);
Behavior
Description
If a write operation takes place, the write process must either update a variable,
or create the first instance of a variable.
Input Parameter
– variable index, in the demonstration example provided: (0 for A, 1 for B or 2
for C).
– T: variable Array
– 16-bit data to be written
Return Parameter
Returns 1 on success or 0x80 if variable is full or Flash error code
Called functions
FindValidSector,FMI_ReadWord,FMI_WriteHalfWord
Add element request
full
current record
Add new element at
the 1st empty element
place in the current
record of active sector
Erase previous active sector
End
End
Change the active sector
Find Valid sector
Yes
No
FindValidSector()
WriteVerifyVariableFull()
Copy each latest element of
each available record by
reading from bottom taking
into account the new
updated element.
EepromSectorTransfer()
ReadVariable()
Function call
ai14088



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25


数据表 下载

Go To PDF Page


链接网址



ALLDATASHEET是否为您带来帮助?  [ DONATE ] 

关于 Alldatasheet   |   广告服务   |   联系我们   |   隐私政策   |   数据表链接    |   链接交换   |   制造商名单
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
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