MC9S12XEP100 on chip nonvolatile memory

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MC9S12XEP100 on chip nonvolatile memory

678 Views
anup_manakeshwa
Contributor I

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.

Labels (1)
0 Kudos
3 Replies

449 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

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:

DFlash on HCS12x 


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

449 Views
anup_manakeshwa
Contributor I

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.

0 Kudos

449 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

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!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos