avr-chat
[Top][All Lists]
Advanced

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

Re: [avr-chat] EEprom functions on Tiny13


From: Joerg Wunsch
Subject: Re: [avr-chat] EEprom functions on Tiny13
Date: Fri, 5 Oct 2007 21:24:25 +0200 (MET DST)

Robert von Knobloch <address@hidden> wrote:

> Code like    "x = eeprom_read_byte(&eevalue)" appears to work,
> but    "uint8_t * ptr; x=eeprom_read_byte(ptr)" does not.

Can you get us some more of the code, preferrably something that
can be compiled to demonstrate the problem?

> It appears to be a problem in that these functions pass a 16-bit
> address to the asm call for the function, whreas the hardware only
> supports an 8-bit address (I conclude).

It's correct that the library always handles all addresses as 16-bit
values (as does the compiler itself).  However, this is harmless,
because all AVRs so far have an empty register where the larger ones
have their EEARH, so even writing the 0 to that non-existent register
doesn't do any harm.  This is effectively caused by the simplified
library approach where there's one library for an entire class of
AVRs, rather than a single one for each individual AVR.

-- 
cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)




reply via email to

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