Home
RL78 Family EEPROM Emulation Library Pack02 User`s Manual
Contents
1. A active block 1 invalid block X excluded block The overall life cycle of a block in the EEL pool is shown in Figure 2 3 During normal operation the block switches between active and invalid state When an error occurs during an access to the EEL block the error EEL block is marked as excluded This block will not enter the lifecycle again However the user can try to reanimate the block by a format of the complete pool which also erases all existing data content Figure 2 3 Life cycle of an EEL block invalid excluded block ae O D NEE format 1 1 i 1 H R01US0068bEJ0100 Rev 1 00 Page 12 of 53 Mar 28 2014 2Q NESAS RL78 Family Chapter 2 EEPROM Emulation EEPROM Emulation Library Pack02 The EEL pool has the four states shown below Table 2 1 States of the EEL Pool Pool operational This is the usual case during EEL operation All commands are available and can be executed Pool full Free space for data write is insufficient in the active block in use This state indicates that a refresh needs to be executed Pool exhausted No continuously usable EEL block is left At least two blocks that are not excluded are necessary for EEL operations Pool inconsistent There is a mismatch in the pool state and the data structure in the EEL block does not match the user set data structure The EEL block is in the undefined s
2. Excluded Excluded block R01US0068bEJ0100 Rev 1 00 Page 14 of 53 Mar 28 2014 2Q NESAS RL78 Family Chapter 2 EEPROM Emulation EEPROM Emulation Library Pack02 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 ID reference data in EEL OxFF ID block reference area 0x0000 data field in EEL block data area Data Size 1 Table 2 4 Description of Each Field of Data Area SoR field The one byte SoR fi
3. R01US0068bEJ0100 Rev 1 00 Page 51 of 53 Mar 28 2014 2Q NESAS RL78 Family Chapter 6 Software Resources and Processing Time EEPROM Emulation Library Pack02 Figure 6 3 Arrangement Example of Addresses FFE20H to FFEFFH RL78 G13 product with 2 Kbyte RAM and 32 Kbyte ROM Special function register SFR Ke Area where RAM stack data buffer etc used FFEFFR Generar pose egere SCH Geer EE SADDR Area pos the EEPROM Emulation Library and Data E it Flash Library cannot be allocated FFE1FH No allocation restriction FF700H FFSFFH 6 2 1 Sections Functions constants and variables to be used are allocated to specified sections in the EEL and FDL The following table lists sections defined by the EEL and FDL Table 6 5 Sections Used in the EEL FDL FDL_CODE FDL s code section that contains FDL programs FDL SDAT FDL s variable data section that contains variable data used in the FDL Place this section in the short addressing RAM area FDL CNST FDL s constant data section that contains constant data used in the FDL EEL CODE EEL s code section that contains EEL programs EEL SDAT EEL s variable data section that contains variable data used in the EEL Place this section in the short addressing RAM area EEL CNST EEL s constant data section that contains constant data used in the EEL R01US0068bEJ0100 Rev 1 00 Page 52 of 53 Mar 28 2014 2Q NESAS RL78 Family Appendix A Revision Hist
4. Register status after calling this function Return values C Arguments None Return values Symbol Definition Description eel status t EEL OK Normal end EEL ERR CONFIGURATION Initialization error The EEL cannot be executed with the values set by the FDL Init and EEL Init functions Check the current setting referring to section 4 3 Initial Values to be set by User Remark Assembly language return values are stored in register C R01US0068bEJ0100 Rev 1 00 Page 38 of 53 Mar 28 2014 2Q NESAS RL78 Family Chapter 5 User Interface EEPROM Emulation Library Pack02 EEL Open Function EEPROM emulation preparation processing This function makes the EEPROM emulation executable Format C language void _ far EEL Open void Assembler CALL EEL Open or CALL IEEL Open Remark Call this function by using if placing the EEL at 00000H to OFFFFH or by using if not Pre conditions 1 The FDL Init FDL_Open and EEL Init functions must have finished normally 2 If EEPROM emulation was executed the processing up to EEL Close and FDL Close function must be executed to stop the EEPROM Emulation processing Post conditions None Cautions After the EEL Open function is executed and the EEPROM emulation has been transitioned to the opened state the FSL cannot be executed In addition STOP mode and HALT mode cannot be executed To execute the FSL STOP
5. data flash blocks allocated in the EEL pool No data is stored in invalid blocks EEL blocks are marked as invalid by the EEL or become invalid in the case of erasure blocks If functional operation failed and possibility of a data flash failure is clarified the EEL excludes the relevant block and the block is no longer used for EEPROM emulation R01US0068bEJ0100 Rev 1 00 Page 11 of 53 Mar 28 2014 2Q NESAS RL78 Family Chapter 2 EEPROM Emulation EEPROM Emulation Library Pack02 Figure 2 2 shows an exemplary pool configuration for a device with 8 KB data flash When no writable area is remaining in the active block block 1 in the example and data can no longer be stored failure in write command a new active block is selected in a cyclic manner and the current valid data set is copied to this new active block This process is referred to as refresh After the EEL CMD REFRESH command is executed the previous active block becomes invalid and only a single active block exists Excluded blocks like block 7 in the example are ignored during this process and not considered as candidates for the selection of the next active block Figure 2 2 EEL pool structure Data Flash Memory A e physical physical physical physical physical physical physical physical block block block block block block block block 0 1 2 5 6 7
6. the half size of the maximum usable size of one block Maximum size the basic total user data size maximum data size 2 lt 1014 Assumed that the largest data can be updated once after all data have been written Recommended size 1014 2 Assumed that all data can be updated once after all data have been written Calculating the size for writing each user data item Tee Size of each written user data item data size reference data size 2 bytes Note For details see 2 3 5 Structure of Stored Data Calculating the basic total user data size Basic total size user data 1 2 user data 2 2 user data n 2 R01US0068bEJ0100 Rev 1 00 Page 27 of 53 Mar 28 2014 ENESAS RL78 Family Chapter 4 Using EEPROM Emulation EEPROM Emulation Library Pack02 4 3 Initial Values to be set by User As the initial values for the EEL be sure to set the items indicated below In addition before executing the EEL be sure to execute the high speed on chip oscillator The high speed on chip oscillator must also be activated when using the external clock Number of stored data items and specific data IDs and data size Data flash library user include file fdl_descriptor h gt ete 12 define FDL SYSTEM FREQUENCY 32000000 define FDL WIDE VOLTAGE MODE define FDL POOL BLOCKS define EEL POOL BLOCKS 1 Operation frequency 1 2 Voltage mode 3 FDL pool size 4 4
7. 0x01 with size 0x04 Data ID 0x02 with size 0x01 Data ID 0x03 is defined but not written here Data ID 0x04 with size 0x02 The data have been written in the sequence ID 0x01 gt ID 0x04 gt ID 0x02 In this example the data with ID 0x03 has not been written yet Figure 2 7 Example of an Active EEL Block relative byte index within block 0x0000 A 0x02 0x0001 B OxFD 0x0002 OxFF 0x0003 X OxFF 0x0004 reserved 0x0005 reserved 0x0006 reserved 0x0007 reserved 0x0008 SoR 2 ID 0x01 0x0009 EoR gt ID OxFE 0x000A SoR gt ID 0x04 Es reference 0x000B EoR gt ID OxFB area 0x000C SoR gt ID 0x02 0x000D EoR gt ID OxFD Ox000E 0x000F gt block header separator erased 2 bytes erased area all bytes OxFF 0x03F8 0x03F9 DATA ID 0x02 0 0x03FA DATA ID 0x04 0 0x03FB DATA ID 0x04 1 0x03FC DATA ID 0x01 0 gt data area 0x03FD DATA ID 0x01 1 0x03FE DATA ID 0x01 2 0x03FF DATA ID 0x01 3 R01US0068bEJ0100 Rev 1 00 Page 16 of 53 Mar 28 2014 ENESAS RL78 Family Chapter 3 EEL Functional Specifications EEPROM Emulation Library Pack02 Chapter 3 EEL Functional Specifications This chapter describes the functional specifications of the EEL required for the user to execute EEPROM emulation 3 14 EEL Functions Commands of the EEL Execute Function The table below su
8. Format processing This initializes erases everything including the data recorded in the EEL blocks Be sure to use this command before using EEPROM emulation for the first time 3 1 5 EEL CMD WRITE command Write processing Write the specified data to an EEL block 3 1 6 EEL CMD READ command Read processing Read the specified data from an EEL block 3 1 7 EEL CMD VERIFY command Verify processing This command performs internal verification to check signal levels of the active block R01US0068bEJ0100 Rev 1 00 Page 18 of 53 Mar 28 2014 ENESAS RL78 Family Chapter 3 EEL Functional Specifications EEPROM Emulation Library Pack02 3 2 State Transitions To use EEPROM emulation from a user created program it is necessary to initialize the EEL and execute functions that perform operations such as reading and writing on EEL blocks Figure 3 1 shows the overall state transitions and Figure 3 2 shows an operation flow for using basic features When using EEPROM emulation incorporate EEPROM emulation into user created programs by following this flow Figure 3 1 State transitions diagram Reset or Power S P uninitialized FDL Init 3 l FDL_Open FDL_Close l EEL Init EEL CMD SHUTDOWN Startup executing ENS Format executing S EEL CMD SHUTDOWN busy A busy nm status 2 RS ee c ERROR POOL EXHAUSTED status OK EEL CMD STARTUP ERROR Verify Fi EEL_CMD_FORMAT p AM 2 FMT uu p started e S exhauste
9. eel_request_t When status_enu is EEL_BUSY continue the data flash operation If status_enu is other than EEL_BUSY terminate the data flash operation with an error 3 EEL_Handler function Control the EEL while it is running By repeating the execution of the EEL Handler function continue the data flash operation 4 Final state check If the final state is EEL OK the operation ends normally Otherwise it will be terminated with an error R01US0068bEJ0100 Rev 1 00 Page 23 of 53 Mar 28 2014 2Q NESAS RL78 Family Chapter 3 EEL Functional Specifications EEPROM Emulation Library Pack02 3 5 BGO Back Ground Operation function The EEL Execute function starts command processing and then immediately returns the control to the user program This allows the user program to run during the data flash operation and so is called back ground operation BGO The data flash read or write command processing is started by executing the EEL Execute function and the processing is continued and completed by executing the EEL Handler function For this reason the EEL Handler function must be executed continuously until the processing is completed To see if the processing requested from the EEL Execute function has been successfully completed call the EEL Handler function from the user program and check the status of ongoing processing The EEL CMD SHUTDOWN command does not require calling of the EEL Handler function However
10. high speed on chip oscillator has been started up Remark Assembly language return values are stored in register C R01US0068bEJ0100 Rev 1 00 Page 35 of 53 Mar 28 2014 2Q NESAS RL78 Family Chapter 5 User Interface EEPROM Emulation Library Pack02 FDL Open Function FDL preparation processing Set the Data Flash Control Register DFLCTL to the state where accessing the data flash memory is permitted DFLEN 1 Format C language void far FDL Open void Assembler CALL FDL Open or CALL IFDL Open Remark Call this function by using if placing the FDL at 00000H to OFFFFH or by using if not Pre conditions The FDL Init function must have finisehed normally Post conditions Execute the EEL Init function Cautions None Register status after calling this function No registers are corrupted Arguments None Return values None R01US0068bEJ0100 Rev 1 00 Page 36 of 53 Mar 28 2014 2Q NESAS RL78 Family Chapter 5 User Interface EEPROM Emulation Library Pack02 FDL Close Function FDL end processing Set the Data Flash Control Register DFLCTL to the state where access to the data flash memory is inhibited DFLEN 0 All ongoing EEL processing stop Format C language void far FDL Close void Assembler CALL FDL Close or CALL IFDL Close Remark Call this function by using if placing the FDL
11. mode or HALT mode execute the EEL Close and FDL Close functions to transition the EEPROM emulation to the uninitialized state Register status after calling this function No registers are corrupted Arguments None Return values None R01US0068bEJ0100 Rev 1 00 Page 39 of 53 Mar 28 2014 2Q NESAS RL78 Family Chapter 5 User Interface EEPROM Emulation Library Pack02 EEL Close Function EEPROM emulation end processing This function makes the EEPROM emulation unexecutable Format C language void _ far EEL_Close void lt Assembler gt CALL EEL_Close or CALL IEEL Close Remark Call this function by using if placing the EEL at 00000H to OFFFFH or by using if not Pre conditions If EEPROM emulation was executed the EEL_CMD_SHUTDOWN command must be used to set EEPROM emulation to the stopped state the opened state Post conditions Execute the FDL_Close function to exit the EEPROM emulation Cautions None Register status after calling this function No registers are corrupted Arguments None Return values None R01US0068bEJ0100 Rev 1 00 Page 40 of 53 Mar 28 2014 ENESAS RL78 Family Chapter 5 User Interface EEPROM Emulation Library Pack02 EEL Execute Function EEPROM emulation execution function Each type of processing for performing EEPROM emulation operations is specified for this function as an arg
12. requested command and ongoing command stop and cannot be resumed Before calling the FDL Close and EEL Close functions finish all ongoing commands 13 Before using the EEPROM emulation library always close the FSL Also do not run the FSL while the EEPROM emulation library is being used When using the FSL be sure to execute all of the processing up to and including the EEL Close function and EDL Close function to finish EEPROM emulation When using EEPROM emulation after executing FSL processing it is necessary to start processing from the initializing function the FDL Init function 14 Before starting the EEPROM emulation be sure to start up the high speed on chip oscillator first The high speed on chip oscillator must also be activated when using the external clock 15 In address above OxFFE20 OxFE20 do not place data buffer argument or stack which is used by EEL functions and FDL functions 16 When using data transfer controller DTC during EEPROM emulation do not place RAM area used by DTC in self RAM and in address above OxFFE20 OxFE20 17 Until EEPROM emulation is finished do not corrupt RAM area including self RAM used by EEPROM emulation 18 No checksum is added to user data If a checksum is needed add it to user data and check through the user program 19 When the FDL descriptor or EEL descriptor is changed the EEPROM emulation can no longer be exe
13. such information is error free Renesas Electronics assumes no liability whatsoever for any damages incurred by you resulting from errors in or omissions from the information included herein Renesas Electronics does not assume any liability for infringement of patents copyrights or other intellectual property rights of third parties by or arising from the use of Renesas Electronics products or technical information described in this document No license express implied or otherwise is granted hereby under any patents copyrights or other intellectual property rights of Renesas Electronics or others You should not alter modify copy or otherwise misappropriate any Renesas Electronics product whether in whole or in part Renesas Electronics assumes no responsibility for any losses incurred by you or third parties arising from such alteration modification copy or otherwise misappropriation of Renesas Electronics product Renesas Electronics products are classified according to the following two quality grades Standard and High Quality The recommended applications for each Renesas Electronics product depends on the product s quality grade as indicated below Standard Computers office equipment communications equipment test and measurement equipment audio and visual equipment home electronic appliances machine tools personal electronic equipment and industrial robots etc High Quality Transportation equipment automo
14. we recommend that you follow the command operation flowchart shown in figure 3 3 R01US0068bEJ0100 Rev 1 00 Page 24 of 53 Mar 28 2014 2Q NESAS RL78 Family Chapter 4 Using EEPROM Emulation EEPROM Emulation Library Pack02 Chapter 4 Using EEPROM Emulation EEPROM emulation can store a maximum of 64 data items each consisting of 1 to 255 bytes in the flash memory by using three or more blocks recommended of flash memory EEPROM emulation can be executed by incorporating the EEL into a user created program and executing that program Note For details about the number of user data items that can be stored see 4 2 Number of stored user data items and total user data size 4 1 Caution Points EEPROM emulation is achieved by using a feature for manipulating the on board microcontroller data flash memory Therefore it is necessary to note the following Table 4 1 Points for Caution 1 2 Caution Points All EEL codes and constants must be placed in the same 64 Kbyte flash block Initialization by the FDL Init function must be performed before the FDL Open FDL Close or any EEL function is executed The EEL must be initialized by the EEL Init function before any EEL function is executed The data flash memory cannot be read during data flash memory operation by the EEL Do not execute STOP mode or HALT mode processing while the EEPROM emulation is being used If it is necessary to execute STOP mo
15. 24 NE SAS C d D m 0 lt C o RL78 Family EEPROM Emulation Library Pack02 O Japanese Release ZIP file name JP R EEL RL78 P02 Vx xx x E 16 Bit Single Chip Microcontroller Supported Devices RL78 D1A RL78 G1A RL78 F12 RL78 MA RL78 F13 RL78 L13 RL78 F14 X RL78 L1C RL78 G13 RL78 G14 All information contained in these materials including products and product specifications represents information on the product at the time of publication and is subject to change by Renesas Electronics Corporation without notice Please review the latest information published by Renesas Electronics Corporation through various means including the Renesas Electronics Corporation website http www renesas com Renesas Electronics WWW renesas com Rev 1 00 Mar 2014 10 11 12 Notice Descriptions of circuits software and other related information in this document are provided only to illustrate the operation of semiconductor products and application examples You are fully responsible for the incorporation of these circuits software and information in the design of your equipment Renesas Electronics assumes no responsibility for any losses incurred by you or third parties arising from the use of these circuits software or information Renesas Electronics has used reasonable care in preparing the information included in this document but Renesas Electronics does not warrant that
16. 8 Unsigned 8 bit integers unsigned char eel_u16 Unsigned 16 bit integers unsigned short Unsigned 32 bit integers unsigned long R01US0068bEJ0100 Rev 1 00 Page 33 of 53 Mar 28 2014 tENESAS RL78 Family EEPROM Emulation Library Pack02 Chapter 5 User Interface 5 4 EEL Function The subsequent sections describe the EEL functions offered by the EEL These functions appear in the following format Function Describes the function overview of this function Format C language Describes the format to call this function from a user program described in the C language Assembler Describes the format to call this function from a user program described in the Assembly language Pre conditions Describes the precondition of this function Post conditions Describes the post condition of this function Cautions Describes the cautions of this function Register status after calling this function Describes the register status after this function is called Arguments Describes the argument of this function Return values Describes the return values from this function R01US0068bEJ0100 Rev 1 00 Mar 28 2014 ENESAS Page 34 of 53 RL78 Family Chapter 5 User Interface EEPROM Emulation Library Pack02 FDL Init Function FDL initialization processing Format C language IO status t far FDL_Init const far fdl descriptor t descriptor p
17. C CIERRE I E I UI 47 Chapter 6 Software Resources and Processing Time 48 6 1 Processing Time c crio ica 48 6 2 Software Eege 50 6 2 EI ur mere 52 Appendix A Revision PISIOFV inicia 53 Major Changes in This Document eeeeeeeeesssesseieneeeete enne cc 53 R01US0068bEJ0100 Rev 1 00 Page 6 of 53 Mar 28 2014 2Q NESAS RL78 Family Chapter 1 Overview EEPROM Emulation Library Pack02 Chapter 1 Overview 1 1 Outline EEPROM emulation is a feature used to store data in the on board flash memory in the same way as EEPROM During EEPROM emulation the Data Flash library and EEPROM emulation library are used and the data flash memory is written to and read from The Data Flash library is a software library used to perform operations on the data flash memory The EEPROM emulation library is a software library used to execute EEPROM emulation from a user created program The Data Flash library and EEPROM emulation library are placed in the code flash memory for use The EEPROM emulation library is free software to rewrite the data flash through the user program In this user s manual processing of the EEPROM emulation library includes processing of the Data Flash library Be sure to use this user s manual together with the release note supplied with the package of this EEPROM emulation library and the user s manual for the target device 1 2 Target
18. Devices For the latest device information please contact our distributors or sales representatives 1 3 Definition of Terms The terms used in this manual are defined below e Pack Pack is an identification name representing an EEPROM emulation library type Use the pack corresponding to your device e EEL An abbreviation of the EEPROM Emulation library In this user s manual the RL78 EEPROM emulation library Pack02 is hereafter referred to as EEL e FDL An abbreviation of the Data Flash library e FSL An abbreviation of the Flash Self Programming library e EEL function A generic term for the functions offered by the EEL R01US0068bEJ0100 Rev 1 00 Page 7 of 53 Mar 28 2014 ENESAS RL78 Family Chapter 1 Overview EEPROM Emulation Library Pack02 e FDL function A generic term for the functions offered by the FDL e FSL function A generic term for the functions offered by the FSL e Block number A number which identifies a block of Flash memory eEEL Blocks An abbreviation of blocks that the EEPROM emulation library accesses In this user s manual EEPROM emulation blocks are hereafter referred to as EEL blocks eCF Code Flash eDF Data Flash R01US0068bEJ0100 Rev 1 00 Page 8 of 53 Mar 28 2014 ENESAS RL78 Family Chapter 2 EEPROM Emulation Type 01 EEPROM Emulation Library Pack02 Chapter 2 EEPROM Emulation 2 1 Specifications of EEPROM Emulation By calling the EEL func
19. E Note 1 When using the EEPROM emulation for the first time be sure to execute the EEL CMD FORMAT command Note 2 Error processing is omitted in the above flowchart R01US0068bEJ0100 Rev 1 00 Mar 28 2014 ENESAS Page 21 of 53 RL78 Family Chapter 3 EEL Functional Specifications EEPROM Emulation Library Pack02 Overview of basic operation flow 1 FDL initialization processing FDL Init Because it is necessary to initialize the FDL parameters RAM if using the EEL to access the data flash memory the FDL Init function must be executed in advance If FSL processing was executed after this initialization finished the initialization processing must be re executed 2 FDL preparation processing FDL Open Set the Data Flash Control Register DFLCTL to the state where accessing the data flash memory is permitted DFLEN 1 3 EEL initialization processing EEL Init Initialize the parameters RAM used by the EEL 4 EEPROM emulation preparation processing EEL_Open Set the data flash memory to a state opened for which control is enabled to execute EEPROM emulation 5 EEPROM emulation execution start processing EEL_Execute EEL_CMD_STARTUP command Set the system to a state started in which EEPROM emulation can be executed 6 EEPROM emulation data write processing EEL Execute EEL_CMD_WRITE command Write the specified data to an EEL block 7 EEPROM emulation data read processing E
20. EEL pool size EEPROM emulation library user include file eel_descriptor h gt 1 2 define EEL_VAR_NO 8 5 Number of stored data items EEPROM emulation library user program file eel_descriptor c gt 2 far const eel u08 eel descriptor EEL _VAR_NO 2 6 Data size of the identifier data ID eel u08 EEL VAR NO variable count Y eel u08 sizeof type A id 1 eel u08 sizeof type B id 2 eel u08 sizeof type C id 3 eel u08 sizeof type D id 4 eel u08 sizeof type E id 5 eel u08 sizeof type F id 6 eel_u08 sizeof type_X id 7 Y Y Y Y Y Y Y Y eel u08 sizeof type Z id 8 eel u08 0x00 zero terminator Y y Note 1 The macros and macro names that are being used have common parameters with the EEL so changes should be made to numerical values only Note 2 After initializing the EEPROM emulation blocks after executing the EEL_CMD_FORMAT command do not change the values If the values are changed reinitialize the EEL blocks by executing the EEL CMD FORMAT command R01US0068bEJ0100 Rev 1 00 Page 28 of 53 Mar 28 2014 2Q NESAS RL78 Family Chapter 4 Using EEPROM Emulation EEPROM Emulation Library Pack02 1 Operation frequency This sets an operation frequency which is used in RL78 microcontrollers The setting value is set to the FDL Init frequency parameter by the following exp
21. EL_Execute EEL_CMD_READ command Read the specified data from an EEL block 8 EEPROM emulation refresh processing EEL_Execute EEL_CMD_REFRESH command The latest stored data is copied from the active block copy source block to the next block copy destination block in the EEL pool after the erase processing This makes the copy destination block active 9 EEPROM emulation execution stop processing EEL_Execute EEL_CMD_SHUTDOWN command Set the EEPROM emulation operation to the stopped state opened 10 EEPROM emulation end processing EEL_Close Set the data flash memory to a state closed for which control is disabled to stop EEPROM emulation 11 FDL end processing FDL_Close Set the Data Flash Control Register DFLCTL to the state where accessing the data flash memory is inhibited DFLEN 0 R01US0068bEJ0100 Rev 1 00 Page 22 of 53 Mar 28 2014 ENESAS RL78 Family Chapter 3 EEL Functional Specifications EEPROM Emulation Library Pack02 3 4 Command Operation Flowchart The figure below shows the basic procedure to perform read and write operations for data flash by using the EEL Figure 3 3 Command Operation Flowchart E 1 EEL Execute function E Busy ee ere E 8 EEL Handler function E Not busy Abnormal end 4 Final state check bno Normal end Normal end 1 EEL_Execute function Perform operations for data Flash 2 Busy state check Check status_enu of the request structure
22. KB FEFOOH to FF2FFH RL78 L13 RAM 8KB ROM 128KB FDFOOH to FE2FFH RAM 16KB ROM 192KB FBFOOH to FC2FFH RAM 16KB ROM 256KB FBFOOH to FC2FFH ALL Note 12 Products other than the above Contact us RL78 D1A FEFOOH to FF2FFH FDFOOH to FE2FFH RL78 L1C Stack 80 Data buffer Notes 4 to 255 Re to a RAM area other than the self RAM and the area from FFE20H Request Structure 5 SADDR 3 m SUAM MOIS fdl 2 Can be allocated to a short addressing RAM area eel 1 3400 Library size fdl 600 eel 2800 Data table 3 to 68 Can be allocated to any program area other than the self RAM and the area from FFE20H to FFEFFH ROM is recommended Fixed parameter area 14 fdl 10 default eel 2 3 072 or more EEL Blocks at least 3 Only data flash memory can be used blocks Note 1 Please contact about products added after this document is issued R01US0068bEJ0100 Rev 1 00 Page 50 of 53 Mar 28 2014 2Q NESAS RL78 Family Chapter 6 Software Resources and Processing Time EEPROM Emulation Library Pack02 2 The RL78 G12 L12 and G1C product does not support the EEL 3 An area used as the working area by the EEL is called self RAM in this manual and the release note The self RAM requires no user setting because it is an area that is not mapped and automatically used at execution of the EEL previous data is discarded When the EEL is not used the self RAM
23. Lu Haidian District Beijing 100191 P R China Tel 86 10 8235 1155 Fax 86 10 8235 7679 Renesas Electronics Shanghai Co Ltd Unit 301 Tower A Central Towers 555 Langao Road Putuo District Shanghai P R China 200333 Tel 86 21 2226 0888 Fax 86 21 2226 0999 Renesas Electronics Hong Kong Limited Unit 1601 1613 16 F Tower 2 Grand Century Place 193 Prince Edward Road West Mongkok Kowloon Hong Kong Tel 852 2265 6688 Fax 852 2886 9022 9044 Renesas Electronics Taiwan Co Ltd 13F No 363 Fu Shing North Road Taipei 10543 Taiwan Tel 886 2 8175 9600 Fax 886 2 8175 9670 Renesas Electronics Singapore Pte Ltd 80 Bendemeer Road Unit 06 02 Hyflux Innovation Centre Singapore 339949 Tel 65 6213 0200 Fax 65 6213 0300 Renesas Electronics Malaysia Sdn Bhd Unit 906 Block B Menara Amcorp Amcorp Trade Centre No 18 JIn Persiaran Barat 46050 Petaling Jaya Selangor Darul Ehsan Malaysia Tel 60 3 7955 9390 Fax 60 3 7955 9510 Renesas Electronics Korea Co Ltd 12F 234 Teheran ro Gangnam Ku Seoul 135 920 Korea Tel 82 2 558 3737 Fax 82 2 558 5141 2014 Renesas Electronics Corporation and Renesas Solutions Corp All rights reserved Colophon 3 0 RL78 Family 24 NE SAS Renesas Electronics Corporation R01US0068EJ0100
24. Operation Flowchart eeeeeseeseeseieeeeeeneeeenn eee ner 23 3 5 BGO Back Ground Operation function eese ener nennen ennt tnnt 24 Chapter 4 Using EEPROM Emwulation eeeeeeeeeeeeeeeneeeeeen nennen 25 41 erii cte 25 4 2 Number of stored user data items and total user data size sss 27 4 3 Initial Values to be set by User eeeeeseeeeeeeeeeeneeenen nnne nnne nnn nnne nnn nnne neni 28 Chapter 5 User Interface siii ri EXE IR IIa tEVE CMQY FRE E In GERREE ELM RGEIU GE 31 5 1 Request Structure eel request t SettidQS coononncccnnnonccconmncccnnnnnccrnnnanrrcnnnn errar recamara 31 SNNT TA DICE uL HR R m 32 5 1 2 User Read ACCESS ii ege 32 5 2 EEL Function Ee S 33 5 3 Data Typ If 33 Bi EEE PU CUNO E 34 jg ERE edad 35 dg mE 36 FDL e 37 EEL Mit E 38 ROIUSOGBEJUI Rev400 RENESAS Puee5ds Mar 28 2014 RL78 Family EEPROM Emulation Library Pack02 EEL o RC idad 39 EEL enr 40 EE TE OCU soso DIE 41 EEL Handler ete 45 EEL GetS pace miccional in 46 zz ME
25. RIFY An error occurred during the internal verification processing for the active block Cause Some signal levels of flash memory cells were not appropriate Action to Execute the EEL CMD REFRESH command be taken EEL ERR PARAMETER Meaning Parameter error Cause An incorrect command parameter has been specified All commands Action to Revise the specified parameter be taken EEL ERR REJECTED Meaning Reject error Cause A different command is being executed All commands Action to Call the EEL Handler function to terminate be taken the ongoing command R01US0068bEJ0100 Rev 1 00 Mar 28 2014 ENESAS Page 43 of 53 RL78 Family Chapter 5 User Interface EEPROM Emulation Library Pack02 Command Execution statuses of EEL Execute EEL Handler eel status t 2 2 Command Execution Status Category Description Corresponding Commands EEL ERR NO INSTANCE Meaning No write data error Cause The specified identifier data has not been written EEL CMD READ Action to Write data to the identifier specified using the be taken EEL CMD WRITE command EEL ERR POOL INCONSISTENT Meaning EEL block inconsistency error Cause An EEL block has the undefined state such as because there are no active blocks EEL CMD STARTUP Action to Execute the EEL CMD FORMAT command to be taken initialize the EEL blocks EEL ERR POOL EXHAUSTED Meaning EEL block exhaustion error Cause There are no more EEL blocks th
26. at 00000H to OFFFFH or by using if not Pre conditions The FDL Init FDL Open EEL Init EEL Open and EEL Close functions must have finished normally Post conditions None Cautions None Register status after calling this function No registers are corrupted Arguments None Return values None R01US0068bEJ0100 Rev 1 00 Page 37 of 53 Mar 28 2014 2Q NESAS RL78 Family Chapter 5 User Interface EEPROM Emulation Library Pack02 EEL Init Function Processing to initialize the RAM used for EEPROM emulation Format C language eel status t far EEL Init void Assembler CALL EEL Init or CALL EEL Init Remark Call this function by using if placing the EEL at 00000H to OFFFFH or by using if not Pre conditions 1 The FSL and the EEL processing must be either not executing or finished 2 The FDL Init and FDL_Open function must have finished normally Post conditions Execute the EEL_Open function Cautions 1 When starting EEPROM emulation always execute this function to initialize the RAM to be used 2 This function is mutually exclusive with FSL Before executing this function be sure to close FSL Also never use any FSL functions during EEPROM emulation 3 To use FSL after this function is executed the RAM must be reinitialized so always execute this function when restarting EEL 4 To execute this function again always close EEL
27. at can be used EEL CMD STARTUP EEL CMD FORMAT EEL CMD REFRESH EEL CMD WRITE to continue Action to Stop EEPROM emulation be taken You can try restoration by executing the EEL CMD FORMAT command erasing all existing data or read existing data EEL ERR INTERNAL Meaning Internal error Commands other than EEL CMD SHUTDOWN Cause An unexpected error has occurred Action to Check the device state be taken Return values None R01US0068bEJ0100 Rev 1 00 Page 44 of 53 Mar 28 2014 2Q NESAS RL78 Family Chapter 5 User Interface EEPROM Emulation Library Pack02 EEL Handler Function Continuous EEPROM emulation execution processing This function continues executing the EEPROM emulation processing specified for the EEL Execute function Format C language void far EEL Handler void Assembler CALL EEL Handler or CALL EEL Handler Remark Call this function by using if placing the EEL at 00000H to OFFFFH or by using if not Pre conditions 1 The FDL_Init FDL_Open and EEL Init EEL Open functions must have finished normally 2 The EEL_Execute function should execute nole should be EEL_BUSY Note Execution of the EEL_CMD_SHUTDOWN command does not need execution of the EEL_Handler function and status_enu of the request structure eel_request_t However we recommend that you follow the command operation flowchart shown in figure 3 3 Post
28. ata items and total user data size Note 2 EEL blocks cannot be set more than maximum number of blocks of on board data flash memory R01US0068bEJ0100 Rev 1 00 Page 10 of 53 Mar 28 2014 2Q NESAS RL78 Family Chapter 2 EEPROM Emulation EEPROM Emulation Library Pack02 2 3 EELarchitecture This chapter describes the EEL architecture required for the user to rewrite data flash the EEL pool by using the EEL 2 3 1 System Structure The EEL offers interface for accessing the data flash area defined by the user The arrows shown in the figure 2 1 below indicate the flow of processing Figure 2 1 System Structure Code Flash User Program 4 Before using the EEL the FDL must be initialized FDL_Init and FDL_Open function j Data Flash EEL Pool 2 3 2 EEL Pool The EEL pool is a user defined data flash area that is accessible by the EEL The user program can access the data flash only by using this EEL pool in the data flash via the EEL The EEL pool size must be specified with the number of blocks in the data flash of the target device For the procedure to specify the number of blocks see section 4 3 Initial Values to be set by User The EEL pool is divided into 1024 byte blocks Each block has a state which indicates the current usage of the block Only a single EEL block is active at a time to store defined data The active block circulates in
29. biles trains ships etc traffic control systems anti disaster systems anti crime systems and safety equipment etc Renesas Electronics products are neither intended nor authorized for use in products or systems that may pose a direct threat to human life or bodily injury artificial life support devices or systems surgical implantations etc or may cause serious property damages nuclear reactor control systems military equipment etc You must check the quality grade of each Renesas Electronics product before using it in a particular application You may not use any Renesas Electronics product for any application for which it is not intended Renesas Electronics shall not be in any way liable for any damages or losses incurred by you or third parties arising from the use of any Renesas Electronics product for which the product is not intended by Renesas Electronics You should use the Renesas Electronics products described in this document within the range specified by Renesas Electronics especially with respect to the maximum rating operating supply voltage range movement power voltage range heat radiation characteristics installation and other product characteristics Renesas Electronics shall have no liability for malfunctions or damages arising out of the use of Renesas Electronics products beyond such specified ranges Although Renesas Electronics endeavors to improve the quality and reliability of its products semiconductor produc
30. can be used as a normal RAM space For the RL78 microcontroller with self RAM the chapter of memory space in the user s manual of the RL78 microcontroller has a note on an area self RAM whose usage is prohibited during self programming If the above table does not include the target RL78 microcontroller refer to the user s manual of the target RL78 microcontroller 4 The data buffer is used as the working area for EEL internal processing or the area where the data to be set is allocated in the EEL Execute function The required size depends on the function to be used Table 6 4 Data Buffer Size Used by EEL Functions FDL hi 0 EEL Close ec FDL_Open MA EEL Execute He 0 to 255 FDL Close ME EEL Handler 0 to 255 EEL Init o EEL GetSpace EEL Open ur EEL GetVersionString a Note An additional 5 byte area is used by the request structure Figure 6 2 Arrangement Example of Self RAM and Addresses FFE20H to FFEFFH RL78 G13 product with 4 Kbyte RAM and 64 Kbyte ROM Special function register SFR i i i 7 Area where RAM stack data buffer etc used FFEFF Generar purpose egterszoye on Li GNIS rri 920d E SADDR Area pos the EEPROM Emulation Library and Data FEE20H Flash Library cannot be allocated FFE1FH No allocation restriction RAM 4KByte IDEA FF2FFH Area whose usage is prohibited Self RAM Area that damaged when the EEPROM Emulation Library and Data Flash Library is used Leah A FEEFFH
31. conditions While status_enu of the request structure eel_request_t is EEL_BUSY execute this function repeatedly If the EEL_Handler function is executed while no command is executed status_enu of of the request structure eel_request_t is not updated Cautions The command execution status of the EEL Handler function is set for the eel request t request used as an argument of the EEL Execute function Therefore when using the EEL Handler function do not free the eel request t request variable For the execution state of the command specified by the EEL Handler function see the list of the EEL Execute EEL Handler command execution state eel status t Register status after calling this function No registers are corrupted Arguments None Return values None R01US0068bEJ0100 Rev 1 00 Page 45 of 53 Mar 28 2014 2Q NESAS RL78 Family Chapter 5 User Interface EEPROM Emulation Library Pack02 EEL GetSpace Function This obtains the free EEL block space Format C language ES eel_status_t far EEL_GetSpace __near eel_u16 space_pu16 lt Assembler gt CALL EEL_GetSpace or CALL EEL_GetSpace Remark Call this function by using if placing the EEL at 00000H to OFFFFH or by using if not Pre conditions The FDL_Init FDL_Open EEL_Init and EEL Open functions and theEEL Execute function EEL CMD STARTUP command must have finished normally Post conditions No
32. cuted In that case the EEL pool must be formatted by the EEL CMD FORMAT command in addition to initialization of FDL and EEL When adding data however the EEPROM emulation can be continuously executed Do not operate the Data Flash Control Register DFLCTL during the execution of the EEL To use the data flash memory for EEPROM emulation it is necessary to execute the EEL CMD FORMAT command upon first starting up to initialize the data flash memory and make it usable as EEPROM emulation blocks It is recommended that at least three blocks be provided in the data flash memory to use the EEL Do not destroy EEL blocks by the user program that uses other EELs or FDLs The EEL does not support multitask execution When executing an EEL function on the OS do not execute in from two or more tasks About an operation frequency of RL78 microcontrollers and an operation frequency value set by the initializing function FDL Init be aware of the following points When using a frequency lower than 4 MHz as an operation frequency of RL78 microcontrollers only 1 MHz 2 MHz and 3 MHz can be used frequencies other than integer values like a 1 5 MHz cannot be used Also set an integer value 1 2 or 3 to the operation frequency value set by the initializingfunction Note1 When using a frequency of 4 MHz or higher as an operation frequency of RL78 microcontrollers a certain frequency can be used as an operation freq
33. d gt EEL CMD ke Bi status OK EEL CMD READ EEL CMD READ status OK status T EEL_CMD_VERIFY EEL_CMD_REFRESH status ERROR EEL CMD gt SS status ERROR POOL EXHAUSTED paccm command PAN EEPROM command executing Aene busy ond busy N Note 1 EEL Close and EEL Init can be called from every state Please note however that this interrupts any EEL processing and can lead to unpredictable behavior Note 2 Once the EEL CMD FORMAT command is started be sure to finish it R01US0068bEJ0100 Rev 1 00 Page 19 of 53 Mar 28 2014 ENESAS RL78 Family Chapter 3 EEL Functional Specifications EEPROM Emulation Library Pack02 Overview of state transitions diagram To use EEL to manipulate the data flash memory it is necessary to execute the provided functions in order to advance the processing 1 uninitialized This is the state after turning the power on or resetting 2 closed This is the state in which the data to perform EEPROM emulation is initialized by executing the FDL Init FDL Open and EEL Init functions no ongoing operation to the data flash memory To execute FSL STOP mode or HALT mode processing after executing EEPROM emulation execute EEL Close in the opened state to switch to the closed state 3 opened This state is switched to by executing EEL Open in the closed state and makes it possible to perform operations on the data flash memory It is not possible to execute FSL STOP mode or HALT mode
34. de or HALT mode processing be sure to execute all of the processing up to and including the EEL Close function and FDL Close function to finish EEPROM emulation The watchdog timer does not stop during the execution of the EEL The request structure eel request t must be placed at an even address Do not destroy the request structure eel request t during command execution Initialize the argument RAM that is used by the EEPROM emulation library function When not initialized a RAM parity error is detected and the RL78 microcontroller might be reset For a RAM parity error refer to the user s manual of the target RL78 microcontroller All members of the request structure eel request t must be initialized once before a command is executed If any unused member exists in the request structure eel request t set a desired value for the member If any member is not initialized the RL78 microcontroller may be reset due to a RAM parity error For details see the User s Manual Hardware for the RL78 microcontroller in use The EEL does not support multitask execution Do not execute the EEL functions during interrupt processing R01US0068bEJ0100 Rev 1 00 Page 25 of 53 Mar 28 2014 2Q NESAS RL78 Family Chapter 4 Using EEPROM Emulation EEPROM Emulation Library Pack02 Table 4 2 Points for Caution 1 2 Caution Points 12 After the FDL Close and EEL Close functions have been executed the
35. eld contains the ID of data This field indicates the start of write Start of Record processing Data IDs 0x00 and OxFF are not used to avoid patterns of erased cells EoR field The one byte EoR field contains a OxFF data ID value End of Record 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 data field 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 gt data field gt 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 R01US0068bEJ0100 Rev 1 00 Page 15 of 53 Mar 28 2014 2Q NESAS RL78 Family Chapter 2 EEPROM Emulation EEPROM Emulation Library Pack02 2 3 6 EEL Block Overview Figure 2 7 shows an example of an EEL block that contains multiple units of stored data Data ID
36. er s manual is separated into the following parts e Overview of EEPROM Emulation e Using EEPORM Emulation e EEPROM Emulation Function How to Read This Manual Itis assumed that the readers of this manual have general knowledge of electrical engineering logic circuits and microcontrollers e To gain a general understanding of features Read this manual in order of the table of contents e For details on the functions of the library Refer to section 5 User Interface of this user s manual Conventions Data significance Higher order digits to the left and lower order digits to the right Active low representations xxx overscore over pin and signal name Note Footnote for item marked with Note in the text Caution Information requiring particular attention Remark Supplementary information Numeral representation Binary xxxx or xxxxB Decimal xxxx Hexadecimal xxxxH or OxXXXX All trademarks and registered trademarks are the property of their respective owners EEPROM is a registered trademark of Renesas Electronics Corporation RL78 Family EEPROM Emulation Library Pack02 Contents Chapter 1 OVGIVICW iii 7 Veal Outline visa cai E EES 7 1 2 Target Beleeger EEA 7 13 Definition of Term S iii isa 7 Chapter 2 EEPROM Emulation ainia MEUS DIE M DK PRU aU IER EEUU EI BIN IE MEER UE 9 2 1 Specifications of EEPROM Emwulation eeeeeeeeeeseeeeeee nennen entere nn 9 2 2 Outline of Frict
37. estic or foreign laws or regulations You should not use Renesas Electronics products or technology described in this document for any purpose relating to military applications or use by the military including but not limited to the development of weapons of mass destruction When exporting the Renesas Electronics products or technology described in this document you should comply with the applicable export control laws and regulations and follow the procedures required by such laws and regulations It is the responsibility of the buyer or distributor of Renesas Electronics products who distributes disposes of or otherwise places the product with a third party to notify such third party in advance of the contents and conditions set forth in this document Renesas Electronics assumes no responsibility for any losses incurred by you or third parties as a result of unauthorized use of Renesas Electronics products This document may not be reproduced or duplicated in any form in whole or in part without prior written consent of Renesas Electronics Please contact a Renesas Electronics sales office if you have any questions regarding the information contained in this document or Renesas Electronics products or if you have any other inquiries Note 1 Renesas Electronics as used in this document means Renesas Electronics Corporation and also includes its majority owned subsidiaries Note 2 Renesas Electronics product s means any
38. ing from and writing to the data flash are performed by a single function The function transfers commands and data ID to the EEL via the request structure eel request t Furthermore the EEL state and error information are acquired via the request structure eel request t In subsequent sections write access to the request structure eel request t from the user is called user write access and read access to it from the user is called user read access Figure 5 1 Request Structure eel request t User Program A gt User write access Userread access The request structure eel request t is defined in the eel types h file It should not be changed by the user Definition of the request structure eel request t typedef struct neareel u08 address pu08 eel u08 identifier u08 eel command t command enu eel status t status enu eel request t Page 31 of 53 RO1USOO068EJO100 Rev 1 00 RENESAS Mar 28 2014 RL78 Family EEPROM Emulation Library Pack02 Chapter 5 User Interface Figure 5 2 Alignment of Variables of the Request Structure eel request t neareel u08 address pu08 eel u08 identifier u08 eel command t command enu cel status tsitus em O 5 1 1 User Write Access 1 address_pu08 Specify the start address of the data buffer used for EEL_CMD_WRITE command and EEL CMD READ command execution Associated command macro name EEL CMD WRITE Setting S
39. ion A uiid EE CN qr uin AA 9 2 3 EEL architetture A A EE 11 2 3 1 System Structure eebe SEENEN ad init 11 2 3 2 EEL LIE EE M 11 2 93 3 Structure of EEL Block cree eode Do in 13 2324 EEL Block Header teret aereas 14 2 3 5 Structure of Stored Data eeee eese eeeeeeee nnmnnn nnmnnn nennt nnns nnns 15 2 3 6 EEL Block OverView ui a est cete E Cock danced Rae De Cu ada Eege 16 Chapter 3 EEL Functional Specifications eese 17 3 1 EEL Functions Commands of the EEL Execute Function sessssss 17 3 1 1 EEL CMD STARTUP command Startup processing 17 3 1 2 EEL CMD SHUTDOWN command Shutdown processing 17 3 1 3 EEL CMD REFRESH command Refresh processing 17 3 1 4 EEL CMD FORMAT command Format processing 18 3 1 5 EEL CMD WRITE command Write processing cesses 18 3 1 6 EEL CMD READ command Read processing cesses 18 3 1 7 EEL CMD VERIFY command Verify processing ssssss 18 32 State TFANSITIONS ME 19 33 Basic FloWchal iii 21 3 4 Command
40. l_u08 The address at which the version information of the EEL is input far 24 bit address area Example For EEPROM emulation library Pack02 V1 00 ASCII code ERL78TO2R110 GVxxx Version information V110 V1 10 Corresponding tool Renesas Electronics version Type name Type02 Corresponding device RL78 Target library EEL R01US0068bEJ0100 Rev 1 00 Page 47 of 53 Mar 28 2014 2Q NESAS RL78 Family Chapter 6 Software Resources and Processing Time EEPROM Emulation Library Pack02 Chapter 6 Software Resources and Processing Time 6 1 Processing Time This section describes the EEL processing time Figure 6 1 shows the concept of EEL function response time and total processing time The total processing time in the figure is the case of successful completion and does not include the processing time in the case of abnormal end such as incorrect input data or error Delay time due to execution of the EE Handler function is not included either If the EEL Handler function calling interval time is extended the maximum total processing time may be exceeded Figure 6 1 Overview of Processing Time EEL Execute EEL Response Time Status BUSY EEL Handler Status BUSY Total Processing Time EEL Handler Status BUSY EEL Handler Status OK R01US0068bEJ0100 Rev 1 00 Page 48 of 53 Mar 28 2014 2Q NESAS RL78 Family Chapter 6 Software Resource
41. ly dissipate it when it has occurred Environmental control must be adequate When it is dry a humidifier should be used It is recommended to avoid using insulators that easily build up static electricity Semiconductor devices must be stored and transported in an anti static container static shielding bag or conductive material All test and measurement tools including work benches and floors should be grounded The operator should be grounded using a wrist strap Semiconductor devices must not be touched with bare hands Similar precautions need to be taken for PW boards with mounted semiconductor devices 4 STATUS BEFORE INITIALIZATION Power on does not necessarily define the initial status of a MOS device Immediately after the power source is turned ON devices with reset functions have not yet been initialized Hence power on does not guarantee output pin levels I O settings or contents of registers A device is not initialized until the reset signal is received A reset operation must be executed immediately after power on for devices with reset functions POWER ON OFF SEQUENCE In the case of a device that uses different power supplies for the internal operation and external interface as a rule switch on the external power supply after switching on the internal power supply When switching the power supply off as a rule switch off the external power supply and then the internal power supply Use of the reverse power on off sequences may re
42. ment data 10 bytes per EEL block and 2 bytes per EEL block write data e Reset resistance EEL CMD WRITE EEL CMD REFRESH e Block rotation averaging data flash use frequency Renesas Electronics also provides RL78 EEPROM Emulation Library Pack 01 EEL Pack01 as another EEL EEL consumes smaller amount of resource than EEL Pack01 Other functional differences are listed in the table below For details of functions see the RL78 Microcontroller EEPROM Emulation Library Pack 01 user s manual R01US0054EJ0102 RO1USO068EJO100 Rev 1 00 TED Mar 28 2014 RENESAS RL78 Family Chapter 2 EEPROM Emulation EEPROM Emulation Library Pack02 980 x total number of blocks 1014 2 bytes x 1 4 980 2 bytes Enforce mode and TimeOut mode Supported Not supported Recommended user data size ge Back ground maintenance processing Supported Not supported Data ID number Can be set arbitrarily Cannot be set arbitrarily Auto checksum for data Supported Not supported Note1 The total size of user data must be within 1 2 of each block when all user data are written to an EEL block Therefore the range used for the number of stored user data items differs depending on the size of the stored user data It is also necessary to consider the size of the reference data provided for each data item for management use when determining the total size For details about the number of stored user data items and total size see 4 2 Number of stored user d
43. mmarizes the EEL functions offered by the EEL Table 3 1 EEL Functions EEL function name Functional overview FDL Init Initializes the FDL FDL Open Preparation processing of FDL FDL Close End processing of FDL EEL Init Initializes the EEL EEL Open Preparation processing of EEL EEL Close End processing of EEL EEL Execute Manipulates data flash with commands Command EEL CMD STARTUP EEL CMD WRITE EEL CMD READ EEL CMD REFRESH EEL CMD VERIFY EEL CMD FORMAT EEL CMD SHUTDOWN EEL Handler Controls the EEL while it is running EEL GetSpace Checks free space in the EEL block EEL GetVersionString Obtains EEL version information With the EE Execute function the following commands can be executed 3 1 1 EEL CMD STARTUP command Startup processing This checks the block status and sets the system to the EEPROM emulation start started state 3 1 2 EEL CMD SHUTDOWN command Shutdown processing Set the EEPROM emulation operation to the stopped state opened 3 1 3 EEL CMD REFRESH command Refresh processing The latest stored data is copied from the active block copy source block to the next block copy destination block in the EEL pool after the erase processing This makes the copy destination block active R01US0068bEJ0100 Rev 1 00 Page 17 of 53 Mar 28 2014 2Q NESAS RL78 Family Chapter 3 EEL Functional Specifications EEPROM Emulation Library Pack02 3 1 4 EEL CMD FORMAT command
44. ne Cautions 1 When the EEL pool has been exhausted 0 is always returned to indicate that there is no free space 2 When an error value is returned the free space information remains unchanged Register status after calling this function Return value C Corrupted register AX argument Arguments space pu 16 eel u16 near The address at which the free space information of the current active block is input Return values Symbol Definition Description eel status t EEL OK Normal end EEL ERR INITIALIZATION EEL Init has not been executed EEL ERR ACCESS LOCKED The EEL CMD STARTUP command has not finished normally EEL ERR REJECTED A command is being executed Remark Assembly language return values are stored in register C R01US0068bEJ0100 Rev 1 00 Page 46 of 53 Mar 28 2014 2Q NESAS RL78 Family Chapter 5 User Interface EEPROM Emulation Library Pack02 EEL GetVersionString Function This obtains the version information of the EEL Format C language fareel u08 _ far EEL GetVersionString void Assembler CALL EEL GetVersionString or CALL EEL_GetVersionString Remark Call this function by using if placing the EEL at 00000H to OFFFFH or by using if not Pre conditions None Post conditions None Cautions None Register status after calling this function None Arguments None Return values Description ee
45. om the active EEL block copy source block to the next block copy destination block in the EEL pool after the erase processing This makes the copy destination block active EEL CMD FORMAT This initializes erases everything including the data recorded in the EEL blocks Be sure to use this command before using EEPROM emulation for the first time Furthermore use this command to initialize the entire blocks when an error such as no active block has occurred in EEL blocks or when modifying values in the descriptor table unchangeable fixed values Because EEPROM emulation switches to the stopped state opened regardless of the results after the processing finishes execute the EEL CMD STARTUP command to continue using EEPROM emulation EEL CMD SHUTDOWN This sets EEPROM emulation to the stopped state opened Note 1 Do not execute this command until the EEL CMD STARTUP command has finished normally Note 2 This command is not used to perform processing for reading written data and compare it To compare written data use the EEL Execute EEL CMD READ function through the user program Note 3 The erase processing is performed by executing the EEL CMD REFRESH command R01US0068bEJ0100 Rev 1 00 Page 42 of 53 Mar 28 2014 2Q NESAS RL78 Family EEPROM Emulation Library Pack02 Chapter 5 User Interface Command Execution statuses of EEL Execute EEL Handler eel status t 1 2 Command Execution Status Categ
46. ory EEL BUSY Meaning Cause Description Corresponding Commands Normal end None Action to be taken Meaning A command is being executed Cause None Action to be taken Keep calling EEL Handler function until the status changes All commands All commands EEL ERR POOL FULL Meaning Pool full error Cause Action to be taken There is no area that can be used to write the data Execute EEL CMD REFRESH command and restart writing data EEL CMD WRITE EEL ERR INITIALIZATION Meaning Initialization error Cause The FDL Init EDL Open EEL Init and EEL Open functions have not been finished All commands normally Action to Normally finish the FDL Init FDL Open EEL Init be taken and EEL Open functions EEL ERR ACCESS LOCKED Meaning EEPROM emulation lock error Commands other than Cause EEPROM emulation cannot be executed EEL CMD STARTUP and Action to Make sure that the EEL CMD STARTUP EEL CMD FORMAT be taken command has finished normally EEL CMD UNDEFINED Command error A command that does not exist has been specified EEL ERR VERIFY Meaning When the EEL CMD STARTUP command was executed An error occurred during the internal verification processing for the block header or the finally written data EEL CMD VERIFY When the CMD command was EEL CMD STARTUP executed EEL CMD VE
47. ory EEPROM Emulation Library Pack02 Appendix A Revision History Major Changes in This Document All Newly created Ea Remark Type in the above table indicates types of revisions a Correction of erroneous description b Addition change to specifications d a b c Addition change to description or notes d Addition change to the package order name or classification e e Addition change to related documents RO1USO068EJO100 Rev 1 00 ero Mar 28 2014 234 NESAS RL78 Family User s Manual EEPROM Emulation Library Pack 02 Publication Date Mar 28 2014 Rev 1 00 Published by Renesas Electronics Corporation 24 NEC S AS SALES OFFICES Renesas Electronics Corporation http www renesas com Refer to http Awww renesas com for the latest and detailed information Renesas Electronics America Inc 2801 Scott Boulevard Santa Clara CA 95050 2549 U S A Tel 1 408 588 6000 Fax 1 408 588 6130 Renesas Electronics Canada Limited 1101 Nicholson Road Newmarket Ontario L3Y 9C3 Canada Tel 1 905 898 5441 Fax 1 905 898 3220 Renesas Electronics Europe Limited Dukes Meadow Millboard Road Bourne End Buckinghamshire SL8 5FH U K Tel 44 1628 585 100 Fax 44 1628 585 900 Renesas Electronics Europe GmbH Arcadiastrasse 10 40472 D sseldorf Germany Tel 49 211 6503 0 Fax 49 211 6503 1327 Renesas Electronics China Co Ltd Room 1709 Quantum Plaza No 27 ZhiChun
48. processing until EEL Close is executed and the system switches to the closed state 4 started This state is switched to by executing the EEL CMD STARTUP command in the opened state and makes it possible to execute EEPROM emulation Writes and reads that use EEPROM emulation are performed in this state 5 exhausted This state is made from the opened or started state when continuously usable EEL blocks have been exhausted during command execution In this state only EEL_CMD_READ EEL_CMD_VERIFY and EEL_CMD_SHUTDOWN commands are executable 6 busy This is the state used when executing a specified command The state that is switched to differ depending on which command is executed and how it terminates R01US0068bEJ0100 Rev 1 00 Page 20 of 53 Mar 28 2014 2Q NESAS RL78 Family Chapter 3 EEL Functional Specifications EEPROM Emulation Library Pack02 3 3 Basic Flowchart Figure 3 2 below shows the basic procedure to perform read and write operations for the data flash by using the EEL Figure 3 2 Basic Flowchart of EEL a 1 FDL_Init function E E 2 FDL_Open function E EI 3 EEL Init function a Ki 4 EEL Open function KE 5 EEL Execute function EEL CMD STARTUP 6 EEL Execute function EEL CMD WRITE EEL ERR POOL FULL 7 EEL Execute function 8 EEL Execute function EEL CMD READ EEL CMD REFRESH 9 EEL Execute function EEL CMD SHUTDOWN E 10 EEL Close function a 11 FDL_Close function
49. product developed or manufactured by or for Renesas Electronics 2012 4 NOTES FOR CMOS DEVICES 1 VOLTAGE APPLICATION WAVEFORM AT INPUT PIN Waveform distortion due to input noise or a reflected wave may cause malfunction H the input of the CMOS device stays in the area between VIL MAX and VIH MIN due to noise etc the device may malfunction Take care to prevent chattering noise from entering the device when the input level is fixed and also in the transition period when the input level passes through the area between VIL MAX and VIH MIN 2 HANDLING OF UNUSED INPUT PINS Unconnected CMOS device inputs can be cause of malfunction If an input pin is unconnected it is possible that an internal input level may be generated due to noise etc causing malfunction CMOS devices behave differently than Bipolar or NMOS devices Input levels of CMOS devices must be fixed high or low by using pull up or pull down circuitry Each unused pin should be connected to VDD or GND via a resistor if there is a possibility that it will be an output pin All handling related to unused pins must be judged separately for each device and according to related specifications governing the device 3 PRECAUTION AGAINST ESD A strong electric field when exposed to a MOS device can cause destruction of the gate oxide and ultimately degrade the device operation Steps must be taken to stop generation of static electricity as much as possible and quick
50. r a command that requires the parameter Set up the data buffer size according to the byte sizes of the write and read data R01US0068bEJ0100 Rev 1 00 Page 41 of 53 Mar 28 2014 2Q NESAS RL78 Family Chapter 5 User Interface EEPROM Emulation Library Pack02 Execution Commands eel command t EEL CMD STARTUP This checks the block status and sets the system to the EEPROM emulation start i i started state If two active blocks exist the incorrect block is changed to an invalid block Be sure to execute this command before executing commands other than the EEL CMD FORMAT command and make sure that the command finishes normally EEL CMD WRITE ie This writes the specified data to the EEL blocks The following arguments must be specified prior to execution address pu08 Specifies the start address of the RAM area where the write data is stored identifier u08 Specifies the data ID of the write data EEL CMD READ Hie This reads the specified data from the EEL blocks The following arguments must be specified prior to execution address pu08 Specifies the start address of the RAM area where the read data is stored identifier u08 Specifies the data ID of the read data EEL CMD VERIFY Note 1 This performs internal verification to check signal levels of the active block This command verifies whether signal levels of flash memory cells are appropriate or not EEL CMD REFRESH This copies the latest stored data fr
51. r in Figure 2 4 The EEL block header is detailed in 2 3 4 EEL Block Header while the structure of data stored in the reference and data area are described in Section 2 3 5 Structure of Stored Data 2 3 4 EEL Block Header The structure of the block header is depicted in Figure 2 5 It is composed of eight bytes four of which are reserved for the system Figure 2 5 Structure of EEL block header relative byte index within block 0x0000 N 0x0001 OxFF N 0x0002 0x00 0x0003 0x00 0x0004 Reserved 0x0005 5 Reserved 0x0006 a Reserved 0x0007 Reserved The block status flags start at the beginning of the block and include the A flag B flag flag and X flag each of which is one byte for a total of 4 bytes of data The combination of flags indicates the EEL block status Figure 2 5 shows the placement status of flags and Table 2 3 shows the combination status of flags Table 2 3 Overviews of Block Status Flags Block Status Flag Description A Flag B Flag Flag X Flag Currently used block After the EE CMD REFRESH command is executed the A flag of a new active block is set to 0x02 Currently used block After the EEL_CMD_REFRESH command is executed the A flag of a new active block is set to 0x03 Currently used block After the EE CMD REFRESH command is executed the A flag of a new active block is set to 0x01 Data other than the above Invalid Invalid block
52. r value recommended 5 Number of stored data items Specify the number of data items to be used in the EEPROM emulation A value of 1 to 64 can be set RO1USO068EJO100 Rev 1 00 Page 29 of 53 Mar 28 2014 2Q NESAS RL78 Family Chapter 4 Using EEPROM Emulation EEPROM Emulation Library Pack02 6 Data size of each data identifier data ID A table to define the data size of each identifier is provided below This is called an EEL descriptor table The EEL can only add identifiers while the program is running Data to be written must be registered in the EEL descriptor table in advance Figure 4 1 EEL Descriptor Table When there are eight different data far const eel u08 eel descriptor Number of stored data items 2 EEL VAR NO Byte size of data ID1 Byte size of data ID2 Byte size of data ID3 Byte size of data ID4 Byte size of data ID5 Byte size of data ID6 Byte size of data ID7 Byte size of data ID8 0x00 EEL VAR NO User specified number of data items used in the EEL Byte size of Data IDx User specified size of user data in bytes Termination area 0x00 Specify O as the termination information R01US0068bEJ0100 Rev 1 00 Page 30 of 53 Mar 28 2014 2Q NESAS RL78 Family Chapter 5 User Interface EEPROM Emulation Library Pack02 Chapter 5 User Interface 5 1 Request Structure eel request t Settings Basic operations such as read
53. ressions The frequency is calculated by raising its decimals The result calculated omits its decimals Setting value of FDL Init operation frequency FDL SYSTEM FREQUENCY 999999 1000000 Ex 1 When FDL SYSTEM FREQUENCY is 20000000 20 MHz 20000000 999999 10000000 20 999999 20 Ex 2 When FDL SYSTEM FREQUENCY is 4500000 4 5 MHz 4500000 999999 10000000 5 499999 5 Ex 3 When FDL SYSTEM FREQUENCY is 5000001 5 000001 MHz 5000001 999999 10000000 6 000000 6 Note1 This setting is a value required to control data flash memory This setting does not change the operation frequency of RL78 microcontrollers In addition this operation frequency is not the frequency of the high speed on chip oscillator 2 Voltage mode e This sets the voltage mode of data flash memory When FDL WIDE VOLTAGE MODE is not defined Full speed mode When FDL WIDE VOLTAGE MODE is defined Wide voltage mode Note 2 The FDL WIDE VOLTAGE MODE is commented out and not defined in the initial setting To use RL78 microcontrollers in the wide voltage mode cancel the comment out to define the mode Note 3 For details of the voltage mode see the corresponding RL78 microcontrollers user s manual 3 FDL pool size Specify 0 4 EEL pool size Nte The number of blocks in the data flash memory of the target device must be specified as the number of blocks in the EEL pool Note 4 Specify 3 3 blocks or a greate
54. s and Processing Time EEPROM Emulation Library Pack02 Table 6 1 EEL Function Response Time of EEPROM Emulation Library Pack02 Functions MAX time Full Speed Mode MAX time Wide Voltage Mode FDL Init 1199 fcpu 1199 fcpu FDL Open 27 fcpu 14us 27 fcpu 14us FDL Close 836 fcpu 444us 791 fcpu 969us EEL Init 3268 fcpu 3268 fcpu Tee EEL Close 17 fcpu 17 fcpu 47 epu 141 fopu EEL Execute 320 fcpu 320 fcpu EEL Handler 4582 fcpu 4582 fcpu Table 6 2 Total Processing Time of EEPROM Emulation Library Pack 02 MAX time Full Mode MAX time Wide Mode EEL CMD STARTUP 277604 235 Block Num fcpu 4 1612 us fcpu 8798 us EEL CMD FORMAT 67102 288981 Block Num 67102 256218 Block Num fcpu 266627 Block Num us fcpu 303359 Block Num us EEL CMD REFRESH 5163828 fcpu 774424 us 5072479 fcpu 1421917 us 1 Finished normally EEL CMD REFRESH 2 REFRESH processing 1554000 7538406 Block Num 1 1554000 7355752 Block Num 1 fcpu 1548404 Block Num 1 us fcpu 2842866 Block Num 1 us failed until Block Num 1 EEL CMD VERIFY 30869 fcpu 4126 us 19605 fcpu 29754 us EEL CMD WRITE 303387 fcpu 111858 us 289240 fcpu 253342 us EEL CMD READ 5102 fcpu 5102 fcpu EEL CMD SHUTDOWN 219 fcpu 219 fcpu Remarks fcpu CPU peripheral hardware clock frequency for example at 20 MHz fcp
55. str Assembler CALL FDL Init or CALL IFDL Init Remark Call this function by using if placing the FDL at 00000H to OFFFFH or by using if not Pre conditions 1 TheFSL and EEL processing must be either not executing or finished 2 The high speed on chip oscillator has been started up Post conditions Execute the FDL_Open function Cautions 1 Be sure to execute this function when starting EEPROM emulation to make it possible to start accessing the data flash memory 2 This function is mutually exclusive with the FSL Before executing this function be sure to end FSL Also never use any FSL functions during EEPROM emulation 3 To use FSL after this function is executed the RAM must be reinitialized so always execute this function when restarting the EEL 4 To execute this function again always be sure to end EEL 5 The descriptor table used for this function cannot be modified Be sure to use a defined descriptor table Register status after calling this function Return Value C Corrupted registers AX argument BC argument Arguments descriptor pstr fdl descriptor t far Pointer to the descriptor table Return values Symbol Definition Description fdl status t FDL OK Normal end FDL ERR CONFIGURATION Initialization error The setting is incorrect Or high speed on chip oscillator does not run Make sure that the defined data has not been changed and the
56. sult in the application of an overvoltage to the internal elements of the device causing malfunction and degradation of internal elements due to the passage of an abnormal current The correct power on off sequence must be judged separately for each device and according to related specifications governing the device INPUT OF SIGNAL DURING POWER OFF STATE Do not input signals or an UO pull up power supply while the device is not powered The current injection that results from input of such a signal or I O pull up power supply may cause malfunction and the abnormal current that passes in the device at this time may cause degradation of internal elements Input of signals during the power off state must be judged separately for each device and according to related specifications governing the device How to Use This Manual Target Readers This manual is intended for users who wish to understand the features of the RL78 microcontrollers EEPROM Emulation Library Pack 02 and to use the library in designing and developing application systems The target products are as follows RL78 D1A RL78 F12 RL78 F13 RL78 F14 RL78 G13 RL78 G14 RL78 G1A RL78 11A RL78 L13 RL78 L1C Purpose This manual is intended to give users understanding of how to use EEPROM Emulation Library Pack 02 to rewrite the flash data memory in RL78 family microcontrollers i e write constant data by the application Organization The RL78 EEPROM Emulation Library Pack 02 us
57. tart address of the data butter Note 2 EEL CMD READ Note 1 Buffer which contains data written by the user Note 2 Buffer which contains data read from the data flash 2 identifier u08 Start address of the data buffer Specify the data ID used for each command For more information about how to do this see the description of the EEL Execute function in section 5 4 EEL Functions Associated command macro name EEL CMD WRITE ID of write data ID of read data EEL CMD READ 3 command enu Commands to be set in the common executable function Associated command macro name Description EEL CMD STARTUP Startup processing EEL CMD WRITE Write processing EEL CMD READ Read processing EEL CMD REFRESH Refresh processing EEL CMD VERIFY EEL CMD FORMAT Verify processing Format processing EEL CMD SHUTDOWN 5 1 2 User Read Access status enu Shutdown processing EEL status and error information For information about the status and errors which might occur during the execution of the functions see the description of the EEL Execute function in section 5 4 EEL Functions R01US0068bEJ0100 Rev 1 00 Mar 28 2014 ENESAS Page 32 of 53 RL78 Family Chapter 5 User Interface EEPROM Emulation Library Pack02 5 2 EEL Function Calls This section describes how to call the EEL functions from a user program written in C or assembly language C lang
58. tate e g no active block is 2 3 3 Structure of EEL Block The detailed block structure used by the EEL is depicted in Figure 2 4 In general an EEL block is divided into three utilized areas the block header the reference area and the data area Figure 2 4 ELL Block Structure Example of RL78 G13 Data Flash Block 0 DAT TUUM block header growing reference area separator erased 2 bytes erased area all bytes OxFF growing data area OxF13FF Table 2 2 Configuration of Each EEL Block block header The block header contains all block status information needed for the block management within the EEL pool It has a fixed size of 8 bytes reference area The reference area contains reference data which are required for the management of data When data is written this area extends in the address increment direction data area The data area contains user data When data is written this area extends in the address decrement direction R01US0068bEJ0100 Rev 1 00 Page 13 of 53 Mar 28 2014 2Q NESAS RL78 Family Chapter 2 EEPROM Emulation EEPROM Emulation Library Pack02 Between reference area and data area there is an erased area With each EEL data update i e the data is written this area is reduced successively However at least two bytes of space always remain between reference area and data area for management and separation of these areas This is indicated by the separato
59. tion provided by the EEL from a user created program use is possible without the awareness of data flash memory operations For the EEL a one bye identifier data ID 1 to 64 is assigned by the user for each data item and reading and writing using any unit from 1 to 255 bytes are possible on an assigned identifier basis The EEL can handle up to 64 identifiers Note are used to store the Note that three or more continuous block area of data flash memory recommended data These blocks are called EEL blocks Data written by EEPROM emulation is divided into reference data and user specified data and the reference data is written to the target blocks from the lower block address while the user data is written from the higher block address Note At least two blocks are necessary for EEPROM emulation When two blocks are specified if a write error occurs even once only reading of normally written data is possible but writing is no longer possible After that the two target blocks must be formatted when the EEL is used to write data Written data is erased completely Since a contingency such as voltage drop may occur in the system we recommend that you specify at least three blocks 2 2 Outline of Function The EEL provides basic read write functions having the following features e Up to 64 data items settable e A data size of 1 to 255 bytes settable e Supporting the back ground operation BGO e Consumption of memory for manage
60. ts have specific characteristics such as the occurrence of failure at a certain rate and malfunctions under certain use conditions Further Renesas Electronics products are not subject to radiation resistance design Please be sure to implement safety measures to guard them against the possibility of physical injury and injury or damage caused by fire in the event of the failure of a Renesas Electronics product such as safety design for hardware and software including but not limited to redundancy fire control and malfunction prevention appropriate treatment for aging degradation or any other appropriate measures Because the evaluation of microcomputer software alone is very difficult please evaluate the safety of the final products or systems manufactured by you Please contact a Renesas Electronics sales office for details as to environmental matters such as the environmental compatibility of each Renesas Electronics product Please use Renesas Electronics products in compliance with all applicable laws and regulations that regulate the inclusion or use of controlled substances including without limitation the EU RoHS Directive Renesas Electronics assumes no liability for damages or losses occurring as a result of your noncompliance with applicable laws and regulations Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture use or sale is prohibited under any applicable dom
61. u 20 Block Num Number of EEPROM emulation blocks R01US0068bEJ0100 Rev 1 00 Page 49 of 53 Mar 28 2014 2Q NESAS RL78 Family Chapter 6 Software Resources and Processing Time EEPROM Emulation Library Pack02 6 2 Software Resources In the EEL program areas corresponding to parts of the library to be used RAM areas for variables to be used in the library and RAM areas for work area self RAM are used to assign an appropriate program to the user area Also since the FDL will be used the EEL must have a separate area for use by the FDL Tables 6 3 and 6 4 list required software resources 2 Figures 6 2 and 6 3 show the images of allocating software resources to the RAM Table 6 3 Software Resources Used by EEL Size byte Restrictions on Allocation and Usage RAM 4KB ROM 64KB FEFOOH to FF2FFH RAM 16KB ROM 256KB FBFOOH to FC2FFH RL78 F12 RAM4KB ROM 64KB FEFOOH to FF2FFH RAM4KB ROM 64KB RL78 F13 R5F10AmE m 6 A B G L RAM 8KB ROM128KB FDFOOH to FE2FFH RAM 8KB ROM 96KB RL78 Fi4 RBF10PmF m G L M RAM 20KB ROM 256KB FAFOOH to FB2FFH RAM 4KB ROM 64KB FEFOOH to FF2FFH Self RAM 0 to 10248 RL78 G13 gia DER M P FAFOOH to FB2FFH RAM 32KB _ ROM 512KB F7F00H to F82FFH RAM 5 5KB ROM 48KB FE900H to FECFFH RL78 G14 RAM5 5KB ROM 64KB FE900H to FECFFH RAM 24KB ROM 256KB F9F00H to FA2FFH RL78 G1A RAM4KB ROM 64KB FEFOOH to FF2FFH RL78 1A RAM 4KB ROM 64
62. uage When an EEL function is called from a user program in C language in the same way as a normal C function is called the EEL function s parameters are passed to the EEL as arguments and the required processing is performed Assembly language Before calling an EEL function from a user program in assembly language take necessary procedures such as setting parameters or return addresses based on the function calling rules for the C compiler package used by the user as a development environment The EEL function s parameters are passed to the EEL as arguments and the required processing is performed Remarks 1 To call the EEL functions offered by the EEL from a user program you should define the following standard header file and include it in that program C language fdl h FDL header file fdl_types h FDL definition setting header file eel h EEL header file eel types h EEL definition setting header file Assembly language fdl inc FDL header file eel inc EEL header file eel_types inc EEL definition setting header file Remarks 2 If an EEL function other than EEL Init is called before EEL Init is called the correct operation is not guaranteed Remarks 3 If an EEL function other than FDL_Init is called before FDL Init is called the correct operation is not guaranteed 5 3 Data Types Below are the data types of the parameters to be specified for calling the EEL functions offered by the EEL Macro name Description eel_u0
63. uency of RL78 microcontrollers This operation frequency is not the frequency of the high speed on chip oscillator Note 1 For a maximum frequency see the target RL78 microcontroller user s manual RO1USO068EJO100 Rev 1 00 Mar 28 2014 2Q NESAS Page 26 of 53 RL78 Family Chapter 4 Using EEPROM Emulation EEPROM Emulation Library Pack02 4 2 Number of stored user data items and total user data size The total size of user data that can be used in the EEPROM emulation is limited The size required for writing all user data to an EEL block must be within 1 2 of the block Therefore the number of stored data items that can be used differs depending on the size of user data that is actually stored The following shows how to calculate the size that can be used when actually writing user data as well as the total user data size Maximum usable size of one block that can be used to write the user data Size of one block of data flash memory 1024 bytes Size required for EEPROM emulation block management 8 bytes Free space necessary as termination information separator 2 bytes Maximum usable size of one block 1024 bytes 8 bytes 2 bytes 1014 bytes Maximum size and recommended size Data must be held in one block Therefore the maximum size is the maximum usable size of one block but the following relational expression should be met To enable all data to be updated at least once we recommend that the data be within
64. ument in the command format and the processing is executed Format C language void far EEL Execute near eel request t request pstr lt Assembler gt CALL EEL_Execute or CALL EEL_Execute Remark Call this function by using if placing the EEL at 00000H to OFFFFH or by using if not Pre conditions The FDL Init FDL Open and EEL Init EEL Open functions must have finished normally Post conditions 1 While status enu of the request structure eel request t is EEL BUSY execute the EEL Handler function repeatedly 2 The EEL_Execute function starts command processing and then immediately returns the control to the user program The command processing is continued by executing the EEL_Handler function Therefore the EEL_Handler function must be executed continuously until the command processing is completed Cautions None Register status after calling this function Corrupted register AX argument Arguments request_pstr eel_request_t near Pointer to the request structure eel_request_t eel_request_t Details eel_request_t address_pu08 eel_u08 Pointer to the data buffer for storing write and read near data Note eel_request_t identifier_u08 eel_u08 Parameter for setting command to be executed eel_request_t command_enu eel command t Command to be executed eel request t status enu eel status t Command execution status Note Specify this parameter only fo
Download Pdf Manuals
Related Search
Related Contents
Utilizzare il selettore a 4 vie DÉPARTEMENT DES LETTRES ET COMMUNICATIONS Faculté 18 - Diversified Machine Systems AIRPLANE MAINTENANCE MANUAL - Centennial Aviation Academy ETC... spécial statut aide-soignant(e) décembre 2006 セキュリティボタン取扱説明書 Thawing cabinet Tina 1200RM Service manual PL7 Junior/Pro Applikationsspezifische DeLonghi Stirella VVX1880 DualVap Copyright © All rights reserved.
Failed to retrieve file