avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] About the EEPROM application problem in AVR


From: Bob Paddock
Subject: Re: [avr-gcc-list] About the EEPROM application problem in AVR
Date: Fri, 3 Jun 2005 19:43:53 -0400
User-agent: KMail/1.7.2

On Thursday 02 June 2005 09:32 pm, laser lei wrote:

>      I used the ATmega48 EEPROM stored my parameter.
> But I can't read back right data before in my program

For the Mega48 the logic at the end of
<avr/io.h> is flawed because iomx8.h sets E2END to 0xFF.

#if E2END < 0x100 && !defined(__COMPILING_AVR_LIBC__)
# undef EEAR
# if E2END > 0
#   define EEAR _SFR_IO8(0x1E)
# endif
# undef EEARH
#endif

In your code you need to #undef  EEAR and define it per the Mega48 Data Sheet, 
after including <avr/io.h> but before you use it.



-- 
                          http://www.softwaresafety.net/
 http://www.unusualresearch.com/ http://www.bpaddock.com/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]