Jiang Ying Tze

9S12B64 read EEPROM variables issue

Discussion created by Jiang Ying Tze on Mar 29, 2007
Latest reply on Apr 3, 2007 by Jiang Ying Tze
Hi all,

We have product that use 9S12B64 chip. We test EEPROM to read variables over and over again. Our procedure is
a) open power
b) read EEPROM variable (that is already existed)
c) check variable value (equal or unequal)
d) use I/O to output the result
e) power down
f) go to a)

It gets different result, when testing 4 ~ 15 times. Then we use 9S12D64 to replace B64. That issue never happened again. We try more EEPROM variables and copy them to FLASH. We get 0xFF value all of them when check fault. But we read EEPROM via P&E BDM tool that same as we programming it early with S19 file. Anyone has idea or anybody use B64 chip before?

Operation Environment:

Crystal : 4 Mhz
Oscillator circuit : Pierce circuit
Compiler : Cosmic

EEPROM address:
B64 : 400h ~ 7FFh
D64 : C00h ~ FFFh

Simple test code:

@eeprom U8 EETEST = 0x78; // At EEPROM start address 0x400 for B64, 0xC00 for D64

void Boot(void)
{
U8 *p1;
U8 test;

PLLCTL |= mskSCME;

SYNR = 5; /* PLLCLK = 48M Hz */

while (!(CRGFLG & mskLOCK));

CLKSEL |= mskPLLSEL;
COPCTL = mskCR0 + mskCR1 + mskRSBCK; /* CR[2:0] = 011 */

INITRG = 0x00;
INITRM = 0x39;
nop();

INITEE = 0x09;
nop();

FCLKDIV = mskFDIV2 + mskFDIV4;
ECLKDIV = mskEDIV2 + mskEDIV4;

DDRA = 0xFF;
nop();
nop();

PORTA = 0x00;

p1= (U8*)0x400; //0x400 for B64,0xC00 for D64

test = *p1;

if ( test == 0x78)
PORTA= 0x02; // OK
else
PORTA= 0x01; // wrong value

if( EETEST == 0x78)
PORTA |= 0x08; // OK
else
PORTA |= 0x04; // wrong value

while(1)
{
ARMCOP = 0x55;
ARMCOP = 0xAA;
}

} /*** END of Boot ***/

If checking fault, it will show PARTA = 0x01 + 0x04.

Outcomes