DFlash EEprom emulation in MC9S12P128

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

DFlash EEprom emulation in MC9S12P128

1,787 次查看
Mishup
Contributor I

Hi once again,

 

I've been trying to set up eeprom emulation using AN4483 and a code which is connected with this AN. There are some configuration defines, but I'm not sure what to write here. 

 

#define BusClock 15000    /* Bus clock in kHz, default is 8 MHz using the internal reference */#define GlobalOffset 0x00004000l  /* Global address 'offset' to DFlash */#define DFStart 0x4400    /* Start address of first DFlash Sector to use for EEE */#define DFEnd   0x47ff    /* End address of last DFlash Sector to use for EEE */#define DFSize  ((DFEnd - DFStart) + 1)  /* size of the DFlash (in bytes) used for EEE */#define DFSectorSize 256   /* DFlash sector size */#define DFNumSectors (DFSize / DFSectorSize) /* Total number of DFlash sectors being used for EEE (must be a minimum of 3) */#define DFMaxSectorNum (DFNumSectors - 1) /* last sector number (index) */#define EEERAMStart 0x5301   /* EEE RAM buffer start address */#define EEERAMEnd   0x5400   /* EEE RAM buffer end address */

Should  DFStart and DFEnd indicate local or global address of DFlash sector? What about EEERAM? At last I also don't know what GlobalOffest means. Could someone explain it to me?

 

Best regards,

Michal

标签 (1)
0 项奖励
回复
3 回复数

1,327 次查看
pgo
Senior Contributor V

You can use the values provided in the unchanged zip file provided as a starting point.  They are also descibed in the app note itself.

 

These imply that the values are interpreted as follows:

 

BusClock S12P bus clock frequency in kHz
EEERAMStart EEE RAM buffer start address
EEERAMEnd EEE RAM buffer end address
DFStart Start address of first DFlash Sector to use for EEE
DFEnd End address of last DFlash Sector to use for EEE

 

Note - EEERAMstart is a RAM buffer address - you appear to be placing this in flash.

These are all local addresses not global.

The other values you are using also appear wrong.

 

The values given in the Zip files would seem correct for a P128 so why not try those first and then modify (carefully)?

 

 

bye

0 项奖励
回复

1,327 次查看
satyendramarina
Contributor I

There are 2 types of memories one is the normal p flash and another is d flash

 

Dfstart and df end should be given as local address while writing to dflash address use only the local address like 4400 etc..,

 

Offset address is the global address which is passed on your driver automatically and it is same for whole .., program

 

EERAM is another area of dflash that s all no significance

0 项奖励
回复

1,327 次查看
Mishup
Contributor I

So, is this code I've presented before proper? Maybe I've doing wrong something else, but I don't know what at all. 

 

Best regards,

Michal

0 项奖励
回复