MC9S12XHZ512 EEPROM read write operation

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

MC9S12XHZ512 EEPROM read write operation

Jump to solution
924 Views
kdn
Contributor III

I want to write and read data in/from internal EEPROM of MC9S12XHZ512 micro-controller. Can anyone provide me sample code for it.

I have use processor expert of it but it's showing some error , i have posted below.

Labels (1)
Tags (2)
1 Solution
614 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi KDN,

I don't think you use GetWord()  in a right way.

you need use GetWord() as below:

  byte If_ok;

  word mydata;

  If_ok = IEE1_SetWord((IEE1_TAddress)0x100000,0x1234);

  If_ok = IEE1_GetWord((IEE1_TAddress)0x100000,&mydata);

I attached my demo code and video, it's for 9S12XHY256 but the method is the same for all HCS12X device


Have a great day,
Zhang Jun

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

View solution in original post

1 Reply
615 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi KDN,

I don't think you use GetWord()  in a right way.

you need use GetWord() as below:

  byte If_ok;

  word mydata;

  If_ok = IEE1_SetWord((IEE1_TAddress)0x100000,0x1234);

  If_ok = IEE1_GetWord((IEE1_TAddress)0x100000,&mydata);

I attached my demo code and video, it's for 9S12XHY256 but the method is the same for all HCS12X device


Have a great day,
Zhang Jun

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