Re: Warning on migrating to ATMega8515 - eeprom problem

From: Ulf Samuelsson (ulf_at_atmel.nospam.com)
Date: 11/01/04


Date: Mon, 1 Nov 2004 23:12:28 +0100


"Mike Harrison" <mike@whitewing.co.uk> skrev i meddelandet
news:6jado0lhhn5f1r0n5tmkm7u8f2cs6j06a6@4ax.com...
> On Mon, 1 Nov 2004 20:29:08 +0100, "Ulf Samuelsson" <ulf@atmel.nospam.com>
wrote:
>
> >
> >"Tim Mitchell" <timng@sabretechnology.co.uk> skrev i meddelandet
> >news:H8LIWLibzjhBFAV2@tega.co.uk...
> >> In article <k04co054e0g5rcbn50h2tptfh3i3sg46r8@4ax.com>, Mike Harrison
> >> <mike@whitewing.co.uk> writes
> >> >Here's a warning that may hopefully save someone else all the hassle
> >> >we've just had after migrating
> >> >a product to the Mega8515 - there may be a similar issue with other
> >> >back-compatible mega parts..
> >> >
> >> >We had some code that was originally written for a 90S4414. This moved
> >> >to a 90S8515 a while ago when
> >> >the 4414 went obsolete. We recently changed to the AtMega8515, again
> >> >due to the old part going
> >> >obsolete.
> >> >We then started seeing apparently random eeprom corruption on some
> >> >units. We could write and verify
> >> >the eeprom, but after powering off for an hour the data would
sometimes
> >> >be all FFs, and sometimes
> >> >correct.....
> >> >
> >> >After many false leads and much headscratching, I chanced on a subtle
> >> >difference between the
> >> >ATMega8515 and the old 90S4414/8515 parts, which is not highlighted in
> >> >the data*** ' differences'
> >> >section (I have emailed Atmel to suggest they add it..).
> >> >
> >> >On the Mega version, The EEADR registers are not initialised to a
> >> >guaranteed state on reset. They
> >> >are initialised to 0 on the old 90S parts. As the code was originally
> >> >for the 4414, (which has 256
> >> >bytes eeprom, hence no EEADRH), and then moved with no problems to the
> >> >90S8515 (which initilises
> >> >EEADRH to 0), there was no code to explicitly clear EEADRH, so on the
> >> >Mega8515, we had what amounted
> >> >to a 'random page swap' on power-up, and some rather unhappy
customers...
> >>
> >> I believe this is the (undocumented) case with all registers on all AVR
> >> Mega parts - the registers all power up in an undefined state, but as
> >> you say on the older AVRs they power up consistently at 0. Has caused
> >> some fun when porting code over.
> >> --
> >> Tim Mitchell
> >
> >Thanks, I spread it around internally !
> >However, I think you need to read the data*** more carefully.
>
> I don't dispute that the information is in there, but I don't think anyone
would think it reasonable
> to read through a 255 page data*** line-by-line to compare minor details
to spot changes from a
> part that is promoted as a direct replacement. The data*** should have a
section that itemises
> EVERY difference, however subtle, so any potential problem areas can
easily be looked at.
>
> The problem actually 'occurred' a few years ago when we were forced to
migrate from the 4414 to the
> 90S8515 when the 4414 was obsolete, then only manifested itself when we
again were forced to change
> to a new part due to the 8515 going obsolete.
>
> Most of us are too busy developing new products to spend a lot of time
re-examining code written
> years ago that breaks when put on a new, supposedly 'compatible'
part.....
>

I think this email went a bit premature. I meant to say:
You need to read more carefully to see that most registers ARE in fact
initialized
even on the ATmegaAVR.

I dont think it is reasonable to expect to see that the EEAR is not
initialized
and I think it *should* be in the migration document.

-- 
Best Regards,
Ulf Samuelsson   ulf@a-t-m-e-l.com
This is a personal view which may or may not be
share by my Employer Atmel Nordic AB