EEprom writes unreliably - 9S08PT32

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

EEprom writes unreliably - 9S08PT32

636件の閲覧回数
larrymitschke
Contributor II

Hi,

 

I am getting some bytes that do not write correctly in eeprom (some left blank at FF and some 00) when setting default values on first powerup.  I suspected the eeprom clock running too fast, but the FCLKDIV register is set per the data sheet:

 

Crystal  4Mhz

Bus Clk 2Mhz

NVM_FCLKDIV = 0X01   // for fclk of 1Mhz

 

Because it acts as if the clk is too fast, I set the FCLKDIV to 0X02 to slow it down.  Now it programs the eeprom all correctly, but I don't see this as a solution because I am worried about overstressing the eeprom over time.  Am I missing something that I have overlooked? 

 

I am using the Cosmic compiler and their library routines, and they have verified that the routines work correctly on their test setup.

ラベル(1)
タグ(2)
0 件の賞賛
3 返答(返信)

528件の閲覧回数
larrymitschke
Contributor II

Problem turned out to be the WDT timing out in the middle of saving default values in the first-time-power-up routine.  Upon restart, the software thought all the default settings were filled and bypassed the EEprom routine, leaving blank addresses.

0 件の賞賛

528件の閲覧回数
pgo
Senior Contributor V

Hi Larry,

An obvious question is how are you setting up the Processor Clock.  Are you sure it's operating with a bus frequency of 2MHz (FBE/FBELP with a BDIV of 1)?

bye

0 件の賞賛

528件の閲覧回数
larrymitschke
Contributor II

Absolutely.  I even ran the bus clk out to a pin to double check, and it is at 2Mhz.

Thanks.

0 件の賞賛