[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Problem reading from EEPROM
From: |
Arthur Goldhammer |
Subject: |
Re: [avr-gcc-list] Problem reading from EEPROM |
Date: |
Mon, 14 Jul 2003 14:47:48 -0400 |
----- Original Message -----
From: "Dave Petrizze" <address@hidden>
To: "Arthur Goldhammer" <address@hidden>
Sent: Monday, July 14, 2003 2:35 PM
Subject: RE: [avr-gcc-list] Problem reading from EEPROM
> The only other thing that I can think of is that the value of 'val1' is
not
> correct but is pointing to some other location in the EEPROM, hence the
0xFF
> return value. From your code example, it looks like the address for these
> two vars would be 0x00 and 0x01. Have you tried explicitly specifying the
> address to see if that make a difference? Also, have you checked to be
sure
> eeprom_is_ready() returns true?
>
Yes, I tried specifying the address explicitly as 0x00 and 0x01. I also
examined the assembly listing; these are the values being generated by the
compiler. I didn't check "eeprom_is_ready," but that is included in the code
for eeprom_read_byte:
000005bc <eeprom_read_byte>:
5bc: e1 99 sbic 0x1c, 1 ; 28
5be: fe cf rjmp .-4 ; 0x5bc
5c0: 9f bb out 0x1f, r25 ; 31
5c2: 8e bb out 0x1e, r24 ; 30
5c4: e0 9a sbi 0x1c, 0 ; 28
5c6: 99 27 eor r25, r25
5c8: 8d b3 in r24, 0x1d ; 29
5ca: 08 95 ret
The first two lines of this subroutine wait until the eeprom is ready. Do I
have to specify any options to the compiler or linker to use the EEPROM?
I've done a fair amount of AVR programming but never used the EEPROM before.
Art