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.
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.
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
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
https://community.nxp.com/docs/DOC-329209
Best regrads,
Ladislav
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.