Sign in

username:

password:



Not a member?

Search 68hc12



Search tips

Subscribe to 68hc12



68hc12 by Keywords

68HC1 | 812A4 | 9S12DP256 | Bootloader | CodeWarrior | D60A | Debugger | DP256 | ECT | EEPROM | EVB | Flash | HC1 | HCS12 | I2C | IAR | ICC1 | Interrupts | LCD | M68KIT912DP256 | MC9S12DP256 | MC9S12DP256B | Metrowerks | Motor | MSCAN | Multilink | PLL | Quadrature | SDI | SPI | Transceiver | XFC


Ads

Discussion Groups

See Also

DSPFPGAElectronics

Discussion Groups | 68HC12 | Cosmic: @eeprom doesn't work

Join our technical discussions about Freescale Microcontrollers: M68HC12. (Freescale Semiconductor is a Subsidiary of Motorola).

Cosmic: @eeprom doesn't work - Klaus Kaiser - Jul 30 6:56:00 2003

Hello,
I use the IdeaCPU12 V2.10f from Cosmic. To store a character in the EEPROM
of a MC9S12DG256B, I defined a variable like this:

@eeprom char foo;

Accordinc to Cosmic docs, this should be enough to make the compiler insert
a call to a EEPROM writing function in place of each write access to that
variable. But actually, I can't write to foo. The value of foo just isn't
changed to the new value. When I initialize the variable, e.g.:

@eeprom char foo = 'A';

foo has actually the value 'A', but I can't assign a new value to it.

The ECLKDIV register is set correctly according to the "PRDIV8 and EDIV bits
Determination Procedure" in EETS4K Block User Guide V02.06, and the memory
map is unchanged from the default.

Has anyone of you used the EEPROM writing features of Cosmic successfully?

Regards,
Klaus





(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )


Re: Cosmic: @eeprom doesn't work - Oliver Betz - Jul 30 10:06:00 2003

Klaus Kaiser wrote:

[@eeprom char foo;]

> Accordinc to Cosmic docs, this should be enough to make the compiler insert
> a call to a EEPROM writing function in place of each write access to that

did you check whether the compiler called c_eewrc by looking at the
assembler output?

Did you read the _whole_ doc about EEPROM support, especially the red
bordered "note" about the possible need for modification of eeprom.s?

Did you relocate the register block?

> Has anyone of you used the EEPROM writing features of Cosmic successfully?

certainly. Although one can doubt whether implicit EEPROM support is
a good thing or whether EEPROM write access should be done explicitly
by calling a write routine. But that's the decision of the user (I
like it!), not the compiler vendor.

Oliver

Ceterum censeo addresses shouldn't be hard coded in library
functions.
--
Oliver Betz, Muenchen




(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )

RE: Cosmic: @eeprom doesn't work - Mike Burns - Jul 30 10:39:00 2003

Hi,

For the HCS12 processors you need to link libe.h12 as the first library in
your link file as the EEPROM erase/programming algorithms of the HC12 and
HCS12 are different.

You also need to enable and configure the EEPROM in your program for your
system. For example

INITEE = 0x01; // Enable EEPROM and leave at reset
address
EPROT = 0x88; // Disable erase/write protection for
entire EEPROM
ESTAT |= 0x10; // Clear illegal EE access flag
(ACCERR) write a 0ne to clear ECLKDIV = 0x15; // 4 Mhz Ocillator
no PLL bus change
// ECLKDIV = 0x29; // 8 Mhz
Ocillator no PLL bus change
// ECLKDIV = 0x4A; // 16 Mhz
Ocillator no PLL bus change

We have a working HCS12 256K example with EEPROM that I can send to you off
list if you like.

Best Regards,
Mike at Cosmic Software -----Original Message-----
From: Klaus Kaiser [mailto:]
Sent: Wednesday, July 30, 2003 7:57 AM
To: '
Subject: [68HC12] Cosmic: @eeprom doesn't work Hello,
I use the IdeaCPU12 V2.10f from Cosmic. To store a character in the EEPROM
of a MC9S12DG256B, I defined a variable like this:

@eeprom char foo;

Accordinc to Cosmic docs, this should be enough to make the compiler insert
a call to a EEPROM writing function in place of each write access to that
variable. But actually, I can't write to foo. The value of foo just isn't
changed to the new value. When I initialize the variable, e.g.:

@eeprom char foo = 'A';

foo has actually the value 'A', but I can't assign a new value to it.

The ECLKDIV register is set correctly according to the "PRDIV8 and EDIV bits
Determination Procedure" in EETS4K Block User Guide V02.06, and the memory
map is unchanged from the default.

Has anyone of you used the EEPROM writing features of Cosmic successfully?

Regards,
Klaus

--------------------------------------------------------
To unsubscribe from this group, send an email to: To learn more about Motorola Microcontrollers, please visit
http://www.motorola.com/mcu




(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )