Hi
I am working on NXP 16 bit MC9S12XEP100 micro controller.
I am writing an application which will receive data over CAN network and log the data if particular condition is met. The CAN data that i wish to store has size 10Kbytes. I want to log the data in non volatile memory so that it will persist even if the board is powered down.
Can you please let me know which on chip storage device of MC9S12XEP100 should be used for this purpose.
Is there any ready made source free source code available which i can use ?
Can P flash be used to store use data ? Or we will have to use D flash or Emulated EEPROM?
Thanks and regards,
Anup Manakeshwar.
Hi Aunp.
Usually PFLASH is to store code, DFLASH is to store data.
User can use PFLASH store data, but it is not efficient.
I think you can refer the demo code attached in this thread:
Have a great day,
Jennie Zhang
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Jennie
Your reply was helpful. Thank you :smileyhappy:
I checked the source code. The source has routines partition, erase and program D flash.
Routine to read from flash is not present in the source code.
Wondering how D flash can be read.
Are we suppose to just use pointer pointing to D flash memory location and read the data?
Or
Is there any command to read data from D flash?
Please reply.
Thanks and regards,
Anup Manakeshwar.
Hi Anup,
For example, we want to read data from 0x10800. We can write code like this
EPAGE = 0x01;
get_val = *(unsigned int *)0x800;
Hope this helps.
Have a great day,
Jennie Zhang
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------