AN3961: EEPROM-in-D-Flash Emulation for the S12P

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

AN3961: EEPROM-in-D-Flash Emulation for the S12P

1,319 Views
vgusiatnikov
Contributor I

A heads-up to anyone who may be inclined to use the code package supplied with Application Note 3961 and provided at

 

http://cache.freescale.com/files/microcontrollers/doc/app_note/AN3961SW.zip

 

that the package won't work for the S12P. The package ignores the difference between global and local (or logical) addressing on the S12P family; the S12P does not understand or use global addressing other than in its Flash Technology Module. In order to program D-Flash on the S12P, one needs to use a global address, and to read it, a different local (or logical) address (see also confuse in memory map of mc9s12p128.), but the code for AN3961 uses the same (global) address to read and program.

 

It appears that the AN3961 code package is a side fork of the main Freescale EEPROM emulation driver for 0.18 µm SGF Flash. I do not know whether the main driver works on the S12P.

 

There is also a much more compact EEPROM-in-D-Flash driver written by Gordon Doughman and described in Application Note 4483. It is based on the same concept as AN3961, but does away with the ability of having multiple emulated-EEPROM blocks within one D-Flash sector, and the writes are interrupt-driven. This driver takes into account the offset between the global and the local addresses, and works on the S12P.

Labels (1)
0 Kudos
Reply
3 Replies

770 Views
iggi
NXP Employee
NXP Employee

A small change is necessary in one of the header files - the SSD_SGF18.h header file in the EEE_Driver folder of the SW package.

In the header file it is clearly written:

/*For selecting S12XS 64k as D-Flash size, define SGF18_SELECT as S12XS_64   */

/*For selecting S12XS 128k or 256k as D-Flash size, define SGF18_SELECT as S12XS_128_256   */

/*For selecting S12P family define SGF18_SELECT as S12P_SGF18   */

#define SGF18_SELECT                      S12XS_128_256

As you can see by default S12XS_128_256 is selected.

Did you notice this and change it?

Thank you RadekS for assistance.

Regards,
Ivan

0 Kudos
Reply

770 Views
asishmondal
Contributor I

I am using mc9s12xs64 with crystal frequency 7.37MHz . 

I have changed  define SGF18_SELECT as S12XS_64. and  #define SSD_BUS_CLOCK       700

I am using P&E multilink for debugging . but it is not writing data nor reading data.

could you please help me.

0 Kudos
Reply

770 Views
vgusiatnikov
Contributor I

Yes, of course I changed the header file to select S12P. Please refer to my original message, there are multiple lines of code in AN3961SW that make it non-functional on the S12P. The underlying reason is that the S12, unlike the S12X, does not understand or use global addressing. AN3961SW is written to use global addressing to both program and read Flash. This will not work on any S12-non-X family member.

0 Kudos
Reply