Moving eeprom

Started by Graham Tricker March 15, 2004
I am using the MC9S12DP256B MPV with a Cosmic compiler. I am trying to move
the eeprom to the second 4k block of memory 0x1000 so I can use all off the
4k eeprom.

I have placed the following code in my eeprom initialisation routine.

INITEE = 0x21;
_asm("NOP");

I believe this moves the eeprom to memory location 0x1000, NOP required to
ensure no writes to eeprom are made during the next cycle.

I have also modified the linker file from

+seg .data -b 0x1000 -f 0xff -m 0x3000 # data start address, fill
with 0xff for s-records...
+seg .eeprom -b 0x400 -m 0xc00 -c # eeprom start address if
needed. Note the -c; the eeprom segment will NOT be overwritten or
initialised

to

+seg .data -b 0x2000 -f 0xff -m 0x2000 # data start address, fill
with 0xff for s-records...
+seg .eeprom -b 0x1000 -m 0x1000 -c # eeprom start address if
needed. Note the -c; the eeprom segment will NOT be overwritten or
initialised

The problem I am seeing is that when modifying eeprom the changes are made,
but are lost after POR. As if I am storing in the new eeprom location but
the eeprom has not moved.

I know the INITEE register is write once for the EE bits and have therefore
checked that no other writes are performed in the crtsi.s module prior to
calling main, but none occur.

Can anyone see anything I may have missed, thanks in advance

Graham

**********************************************************************
This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system.
Although BERU F1 SYSTEMS believe this e-mail and any attachments are free of any virus or other defect which may affect a computer, it is the responsibility of the recipient to ensure that it is virus free and BERU F1 SYSTEMS do not accept any responsibility for any loss or damage arising in any way from its use.
This footnote confirms that this email message has been swept by MAIL Sweeper.
**********************************************************************



Please ignore this request, was obviously having a dumb moment, location
0x1000 to 0x4000 is the default location for RAM and hence I would expect
this result as RAM has a higher priority than eeprom. I have therefore
changed my plan and moved the eeprom to 0x4000 and appears fine so far.

Graham Tricker - Software Engineer
BERU F1 Systems
Technical Centre
Oven Road
Diss
Norfolk
IP22 4ER
Tel: 01379 646227
Fax: 01379 646900

-----Original Message-----
From: Graham Tricker [mailto:]
Sent: 15 March 2004 17:39
To:
Subject: [68HC12] Moving eeprom

I am using the MC9S12DP256B MPV with a Cosmic compiler. I am trying to move
the eeprom to the second 4k block of memory 0x1000 so I can use all off the
4k eeprom.

I have placed the following code in my eeprom initialisation routine.

INITEE = 0x21;
_asm("NOP");

I believe this moves the eeprom to memory location 0x1000, NOP required to
ensure no writes to eeprom are made during the next cycle.

I have also modified the linker file from

+seg .data -b 0x1000 -f 0xff -m 0x3000 # data start address,
fill
with 0xff for s-records...
+seg .eeprom -b 0x400 -m 0xc00 -c # eeprom start address if
needed. Note the -c; the eeprom segment will NOT be overwritten or
initialised

to

+seg .data -b 0x2000 -f 0xff -m 0x2000 # data start address,
fill
with 0xff for s-records...
+seg .eeprom -b 0x1000 -m 0x1000 -c # eeprom start address if
needed. Note the -c; the eeprom segment will NOT be overwritten or
initialised

The problem I am seeing is that when modifying eeprom the changes are made,
but are lost after POR. As if I am storing in the new eeprom location but
the eeprom has not moved.

I know the INITEE register is write once for the EE bits and have therefore
checked that no other writes are performed in the crtsi.s module prior to
calling main, but none occur.

Can anyone see anything I may have missed, thanks in advance

Graham

**********************************************************************
This message contains confidential information and is intended only for the
individual named. If you are not the named addressee you should not
disseminate, distribute or copy this e-mail. Please notify the sender
immediately by e-mail if you have received this e-mail by mistake and delete
this e-mail from your system.
Although BERU F1 SYSTEMS believe this e-mail and any attachments are free of
any virus or other defect which may affect a computer, it is the
responsibility of the recipient to ensure that it is virus free and BERU F1
SYSTEMS do not accept any responsibility for any loss or damage arising in
any way from its use.
This footnote confirms that this email message has been swept by MAIL
Sweeper.
**********************************************************************
--------------------To learn more about
Motorola Microcontrollers, please visit
http://www.motorola.com/mcu <http://www.motorola.com/mcu>
o learn more about Motorola Microcontrollers, please visit
http://www.motorola.com/mcu <http://www.motorola.com/mcu <http://rd.yahoo.com/SIGcd6r9vl/M&6841.4700596.5858952.1261774/D=egroup
web/S06554205:HM/EXP79458842/A 26351/R=0/SIG47ca750/*http://www.l
ifescapeinc.com/picasa/landing.php?capid14&caId#44> click here <http://us.adserver.yahoo.com/l?M&6841.4700596.5858952.1261774/D=egroupweb
/S=:HM/A 26351/rand7811874>

_____

> Service.