avr-libc-dev
[Top][All Lists]
Advanced

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

Re: [avr-libc-dev] Why include <ina90.h> from <avr/pgmspace.h>?


From: E. Weddington
Subject: Re: [avr-libc-dev] Why include <ina90.h> from <avr/pgmspace.h>?
Date: Mon, 07 Oct 2002 16:12:37 -0600

On 8 Oct 2002 at 0:00, Joerg Wunsch wrote:

> As E. Weddington wrote:
> 
> > > They should use __lpm_inline() then, or maybe PRG_RDB().
> > > 
> > 
> > Whoops. My bad. I forgot about PRG_RDB(). You're right, people
> > should use PRG_RDB().
> > 
> > But while these changes are being made, shouldn't PRG_RDB() be
> > updated to use the correct algorithm according to the MCU type?:
> 
> Both are not the same, i think.  Does gcc automatically set RAMPZ?
> 

RAMPZ is defined in the specific ioXXXX.h file. Doing a grep, it's 
defined for the mega103 (iom103.h) and the mega128 (iom128.h).

The ELPM is an extended version of the LPM to handle the 128K size 
flash. To address the entire memory, you need a 17-bit address. The 
RAMPZ register supplies bit number 16 for this address, so RAMPZ:Z 
becomes the address for reading / writing the flash memory.

Eric




reply via email to

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