English
Language : 

R01US0068EJ0100 Datasheet, PDF (15/56 Pages) Renesas Technology Corp – EEPROM Emulation Library
RL78 Family
EEPROM Emulation Library Pack02
Chapter 2 EEPROM Emulation
2. 3. 5 Structure of Stored Data
The structure of stored data when user data is written to an EEL block is shown in the figure below. A data is
composed of three parts: the start-of-record (SoR) field and the end-of-record (EoR) field and the data field. The
EEL descriptor table can be used to set data for use in the EEL. Each data is referred to by an identification number
(ID) and can have a size between 1 and 255 byte. (The exact specification of the format of the EEL descriptor can
be found in Section 4.3)
Each time data is written, stored data increase in the EEL block and multiple units of stored data exist in the EEL
block, but only the most recent stored data is referenced.
SoR and EoR build up the so-called reference data which is required for the management of the data. The
reference data and user data values are stored in different sections of the active block, namely the reference area
and the data area, respectively. Figure 2-6 shows the overview of the entire structure of stored data.
Figure 2-6 Structure of Stored Data
SoR
ID
EoR
0xFF - ID
reference data in EEL
block reference area
0x0000
Data Size - 1
Data
data field in EEL
block data area
Name
SoR field
(Start of Record)
EoR field
(End of Record)
data field
Table 2-4 Description of Each Field of Data Area
Description
The one-byte SoR field contains the ID of data. This field indicates the start of write
processing. Data IDs 0x00 and 0xFF are not used to avoid patterns of erased cells.
The one-byte EoR field contains a 0xFF – data ID value.
This field indicates successful end of write processing. If writing does not end normally due
to a device reset or other reasons, the corresponding stored data is ignored by the EEL.
The data field contains the user data. The size of user data is 1 to 255 bytes. When data of
two bytes or more is stored, the smallest address of the data is allocated to the smallest
address of the data field (as shown in figure 2-7)
Data is written to the EEL block in the order of SoR -> data field -> EoR. If write processing does not end
successfully, the immediately previous data becomes valid.
Note1: The total size of the reference consumed by each stored data is 2 bytes. This should be considered when
evaluating the free space in a block before writing the data through the EEL_GetSpace function.
Note2: No checksum is added to user data. If a checksum is needed, add it to user data and check through the
user program.
R01US0068EJ0100 Rev.1.00
Mar. 28, 2014
Page 15 of 53