Reply by embeeded dept●November 24, 20052005-11-24
Hello,
U r allocating ur EPROM space.I'd better suggest u go thru the manuals of
the cosmic, and ur linker file. this is b'cos u will hav 2 see where u r
placing ur uninitialised data. By dfault, it gets stored in the .bss section, ie
ur RAM. so u won't be able to read the correct(desired )value of ur
variable from EEPROM.
If u want to modify some variable, the variable which u r modifying shld be in
RAM. U hav 2 modify ur linker file accordingly.
bernd71093 <bernd71093@bern...> wrote:
Hi experts,
I want to access data in the EEPROM space 0xC00. The target is the
S12XDP512. The compiler I use is called Cosmic v4.6.
The EEPROM space definition in the linkfile looks like:
=========================================================
+seg .eeprom -b 0xC00 -o 0x13FC00 -m 1024
var_eeprom.o //my file with the eeprom data //(-b: logic adr.; -o:
memory adr.; -m 1k size)
The var_eeprom.c file:
======================
@eeprom char warm_start; // EEPROM variable definition
The main.c file:
===================
extern char warm_start;
...
main{
...
warm_start++; // doing something with the eeprom data
...
}
PROBLEM:
There is no access to variable "warm_start" (no read and write is
possible. The value is always the same!?!
---------------------------------
YAHOO! GROUPS LINKS
---------------------------------
---------------------------------
Yahoo! Music Unlimited - Access over 1 million songs. Try it free.
Reply by Jean-Pierre Lavandier●November 22, 20052005-11-22
Hi,
The -b and -o values are inverted. -b is the physical address and matches
the global S12X address, and -o is the logical address.
You also need the @eeprom modifier on the extern declaration in your main.c
file.
Regards,
Jean-Pierre Lavandier
-----Message d'origine-----
De : bernd71093 [mailto:bernd71093@bern...]
Envoy: mardi 22 novembre 2005 16:52
: 68HC12@68HC...
Objet : [68HC12] Placing Data Objects in EEPROM
Hi experts,
I want to access data in the EEPROM space 0xC00. The target is the
S12XDP512. The compiler I use is called Cosmic v4.6.
The EEPROM space definition in the linkfile looks like:
=========================================================
+seg .eeprom -b 0xC00 -o 0x13FC00 -m 1024
var_eeprom.o //my file with the eeprom data //(-b: logic adr.; -o:
memory adr.; -m 1k size)
The var_eeprom.c file:
======================
@eeprom char warm_start; // EEPROM variable definition
The main.c file:
===================
extern char warm_start;
...
main{
...
warm_start++; // doing something with the eeprom data
...
}
PROBLEM:
There is no access to variable "warm_start" (no read and write is
possible. The value is always the same!?!
You need to make sure your code (or the compiler initialization) is
initializing the ECLKDIV - EEPROM Clock Divider Register to the appropriate
divide value, so the EEPROM erasing and programming algorithms work well.
The appropriate ECLKDIV register setting depends on clock frequency, so the
Compiler probably needs you to specify it explicitly.
Hope this helps,
Doron
Nohau
HC12 In-Circuit Emulators
www.nohau.com/emul12pc.html
At 15:51 22/11/2005 +0000, you wrote: >Hi experts,
>
>I want to access data in the EEPROM space 0xC00. The target is the
>S12XDP512. The compiler I use is called Cosmic v4.6.
>
>The EEPROM space definition in the linkfile looks like:
>=========================================================
>+seg .eeprom -b 0xC00 -o 0x13FC00 -m 1024
>var_eeprom.o //my file with the eeprom data //(-b: logic adr.; -o:
>memory adr.; -m 1k size)
>The var_eeprom.c file:
>======================
>@eeprom char warm_start; // EEPROM variable definition
>
>The main.c file:
>===================
>extern char warm_start;
>...
>main{
>...
>warm_start++; // doing something with the eeprom data
>...
>}
>PROBLEM:
>There is no access to variable "warm_start" (no read and write
is
>possible. The value is always the same!?!
>
>Thanks for your support!!
>
>Bernd
Reply by bernd71093●November 22, 20052005-11-22
Hi experts,
I want to access data in the EEPROM space 0xC00. The target is the
S12XDP512. The compiler I use is called Cosmic v4.6.
The EEPROM space definition in the linkfile looks like:
=========================================================
+seg .eeprom -b 0xC00 -o 0x13FC00 -m 1024
var_eeprom.o //my file with the eeprom data //(-b: logic adr.; -o:
memory adr.; -m 1k size)
The var_eeprom.c file:
======================
@eeprom char warm_start; // EEPROM variable definition
The main.c file:
===================
extern char warm_start;
...
main{
...
warm_start++; // doing something with the eeprom data
...
}
PROBLEM:
There is no access to variable "warm_start" (no read and write is
possible. The value is always the same!?!