STSCBE
Member level 2
- Joined
- Jul 9, 2016
- Messages
- 43
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 6
- Activity points
- 360
You didn't tell what's the exact problem is. The dee_emulation library is ready to use with xc16, other compilers need some adaption. I've used it e.g. with CCS C.
If I remember right, it's well described in the accompanying doc.
Basically, add the *.c and *.h files to your project, configure the occupied memory range appropriately, call DataEEInit() at start and read/write functions in your code.
Be careful about how you use the FLASH as an EEPROM.
The FLASH as a minimum of 10,000 erase/write cycles. I have no idea of what you intend to store in the emulated EEPROM and how often the values update but remember that you erase either a block or a row at a time (although you can write a single work as well as rows and blocks). While the EEPROM emulation can hide a lot of that from you, you can still reach the minimum number of erase cycles for a cell quite easily if you are not careful.
Also remember that the processor will stall during erase/write operation completes. This can impact other aspects of your application.
In general I've found that an external EEPROM overcomes all of these and is often a better design option.
Susan
Not clear what you're exactly asking for. All ram and rom allocations are shown in link map.And also, How to find user EEWrite Functions's data memory allocation in internal program memory?
That's right of course. Eeprom emulation is primarily suited for parameters that are modified by user interaction, not for automatically generated data. The dee_emulation library provides a kind of flash file system which minimizes the number of erase cycles, a single parameter might be updated more than 10000 times. You can reduce the flash wear by assigning more flash sectors to the emulation.Be careful about how you use the FLASH as an EEPROM.
okay, butFrom what you say in Reply #7, if you only want to read a value on power-up and never write to the emulated-EEPROM, then you don't need an EEPROM at all.
Simply declare the value as 'const' and the compiler will place it in the FLASH memory for you and generate all of the required code when you read the variable in your code.
Susan
Use DEEEmulation lib, or for very infrequent update, the simplified method suggested Easyrider83if i need to update that declared value, what i do?
DataEEWrite(01,05); // data, location
DataEEWrite(02,06); // data, location
DataEEWrite(01,05); // data, location
DataEEWrite(02,06); // data, location
Guess you are using DEEEmulation somehow incorrect, e.g. not initializing it properly.
It's just impossible to debug your work from a distance.
I suggest usual debugging methods, e.g. tracing code execution in MPLAB, watching what each write action does to the flash array. If you feel this is all over your head, consider the previously suggested external EEPROM solution.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?