[Top][All Lists]

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

Re: [avr-gcc-list] Mega48 EEPROM problem?

From: Bob Paddock
Subject: Re: [avr-gcc-list] Mega48 EEPROM problem?
Date: Wed, 30 Mar 2005 14:26:57 -0500
User-agent: Opera M2/7.54u1 (Win32, build 3918)

Answering my own question.

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

On Wed, 30 Mar 2005 13:55:44 -0500, Bob Paddock <address@hidden> wrote:

I am trying to use the EEPROM of the Mega48 with latest WinAVR (3.4.3).
A full test case is at the end of this message.

What I do not understand is how this:

     /* Set up address and Data Registers */
     EEAR = 0x0010;

translates into this:

   42 0012 80E1                 ldi r24,lo8(16)
   43 0014 8EBB                 out 62-0x20,r24

According to my math 62-0x20 equals 0x1E, which is wrong for the Mega48.

It seems that these defines are not being used, and I'm not sure
what defines are being used?

reply via email to

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