|
setupSimulatedEEPROM
set up simulated EEPROM
Since R2019b
Library: embeddedCreatorLib ( Dafulai Electronics) / Simulate EEPROM by Flash / setupSimulatedEEPROM

Description
This block sets up "Simulated EEPROM" parameters. For every embedded target which has "Flash" memory, we can use this block to simulate EEPROM by "Flash memory" and "SRAM" memory. In this way, we don't need add "EEPROM" hardware, it will save cost and save PCB space.
In general, we use "SRAM" to represent "Simulated EEPROM". It is fast and byte accessible. However, the initial values of "SRAM" which represents "Simulated EEPROM" are from "Flash" memory, And we have to write all related "SRAM" data into "Flash" memory before "power off". Maximum "Simulated EEPROM" size cannot be over one page (or one sector) of flash size.
Notes: 1 You must add "Flash memory access" for microchip MCC software.
2 This block does not support Microchip PIC18F because most of PIC18F usually have built-in real EEPROM and PIC18F has less SRAM.
Parameters
Please double click this block to open parameters dialog below:

Let us explain parameters.
| • | Flash Only supports double words writing — logical data type of scalar. There are some micro-controllers such some dspic33 MCUs which only supports dual words writing, in this situation, you must make this parameter checked on. |
| • | Simulated EEPROM Maximum Size in byte unit — unsigned integer data type of scalar. It is Maximum size of "Simulated EEPROM" in byte unit. You must make this value to be smaller than or be equal to "Flash Page/Sector" size. |
| • | Empty EEPROM initial byte Data — Number type of scalar or vector. Number type is decided by next parameter "Empty EEPROM initial Data Type". It is initial value of " Simulated EEPROM". If length of vector is less than parameter "Simulated EEPROM Maximum Size in byte unit", it will only initialize the EEPROM's front data parts, the other rear data will be 0. |
| • | Empty EEPROM initial Data Type — String of scalar or vector. Don't use quotation marks for string. It is data type for initial value of " Simulated EEPROM". If length of vector is less than parameter "Empty EEPROM initial byte Data", it will use "uint8" for surplus initial data. If this parameter is scalar, all initial data will use the same data type. Default data type is "uint8". Valid data type is uint8/int8/uint16/int16/uint32/int32/single/float. float is the same as single (4 bytes). |
Ports
Input
None
Outport
None
Examples
|