S12XE and S12G128 EEPROM

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

S12XE and S12G128 EEPROM

2,312 Views
rayhall
Contributor V

I have been trying to read and write to S12XE EEPROM. I have had no success doing either. Is the S12G128 EEPROM memory the same as the S12XE.  I have working code that I have used for the S12G128.  If they are the same other then the start and end address then I should be able to port the code into the S12XE.

Also I am confused about the start address. The data sheet for the S12XE gives the address as 0x0C00 and all the code examples have the address as 0x100000. When I search the memory in the debugger at this address all I find is a lot of dash's (- - - - - - - - - - - -)

Ray.

0 Kudos
5 Replies

2,020 Views
rayhall
Contributor V

Why does my S12XE have dashes "-" at memory address 0x120000  

See attached image.  

Please do not move this post. The question realates to the problem I am having with EEPROM.  Also the screen shot is from the examples you gave me to try.

Ray.

0 Kudos

2,020 Views
rayhall
Contributor V

Answering my own question....

The EEPROM address 0x120000 is a global address. You have Logical address selected in the debugger and that is why you see dash's. Right click on the memory window and change the Address Space to Global. I would have thought this was something many people would know.

I wish there was a working example or library for writing and reading emulated EEPROM. I want to write a 912 byte structure to EEPROM. I have written my own library, but what I write eeprom is deleted every time I  run the debugger.

I feel I am talking to myself. Is there anyone who can help.

Ray.

0 Kudos

2,020 Views
lama
NXP TechSupport
NXP TechSupport

Hi,

I am sorry....there are vacations and we have bottleneck.

I am a little bit confused what you are doing and example what you want to get and not working. Can you share your project in the form as simple as possible with all necessary and visible comments (BUSCLK, OSCCLK,...). (To only solve the issue, no interrupts, no additional peripherals)

I think it is necessary also to check environment. Which version of the CodeWarrior you use - 4.7, 5.1, 5.2?

If you think it is confidential please send it to support and add... in the subject ""Assign to Ladislav" (https://community.nxp.com/docs/DOC-329745 )

Best regards,

Ladislav

0 Kudos

2,020 Views
lama
NXP TechSupport
NXP TechSupport

Hi,

The S12XE does not contain true EEPROM it contains only EMULATED EEPROM or DFLASH.

Both devices can use also PFLASH for data storage. If you want to work with PFLASH than global adress must be used to address the memory for programming. For reading local address must be used. It looks to be complicated but it does not. Please look into attached memory map to correctly understand memory space and then look into set of examples. i believe all these material will lead you to understand it correctly. There is really no space to write here entire theory. The examples are more than thousand words.

(Note, it is also good to use EEEcalculator if you want to use emulated eeprom at XEP100 device

S12XE MCUs|16-Bit Microcontroller|NXP 

Then go to calculators section and download.

)

A lot of examples you can also find

S12G Examples Pack 

https://community.nxp.com/docs/DOC-329209 

Best regrads,

Ladislav

0 Kudos

2,020 Views
rayhall
Contributor V

Hello Ladislav,

I understood it was not real EEPROM memory. Dispite this the datasheet talks about EEPROM memory and gives a start and end address.

I have tried examples  from LAMA and they also do not work (read or writing to EEPROM). Here is a screen shot of the debugger when I test LAMA's  XEP100 - Initial data in Emulated EEPROM - CW47.mcp

Ray.

0 Kudos