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

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

Re: [avr-gcc-list] Query regarding hard located variables


From: scott
Subject: Re: [avr-gcc-list] Query regarding hard located variables
Date: Wed, 09 Jan 2002 07:29:11 +1100 (EST)
User-agent: IMP/PHP IMAP webmail program 2.2.7

Hello Rich,

Thanks for your reply.

Quoting Rich Neswold <address@hidden>:

> Wasn't it  8-Jan-2002, at 09:17AM, when Scott Finneran said:
> > Perhaps I did not explain my problem well enough. I have a hardware
> > register which is in data memory space. It overlays a single memory
> > location.
> 
> Stop right there. Your hardware engineer mapped a register right smack
> dab
> in the middle of the system RAM? Since the RAM is external, you need
> some
> ugly addressing hardware to make sure this *one* location didn't reach
> the
> RAM.

Not really, it reaches both. All you need is a comparator with enough address
bits (to avoid the aliasing).

> I'm not familiar with *every* AVR processor and its hardware register
> mappings. Which processor are you using, and which register are you
> trying
> to access?
ATMega128. This register which I am discussing is not internal to the processor.
It is a bank switching register for the second half of the ATMega128 data space
(ie addresses > 0x7fff can be bank switched). Basically, it is located at
0x7fff. We still want to be able to use addresses > 0x7fff for data (and can
guarantee that the correct page will be swithed in when necessary) 

> 
> If your hardware register is to an external peripheral, you need to
> have
> the design fixed.
I may have mislead with my description. The peripheral (ie the bank switch
register) is hard located at 0x7fff). 

 
> > B) Reserve the memory location so that the linker does not use it. I
> can
> > then safely access it with a pointer as you have suggested.
> 
> Even if you could break the data section into two sections, the
> startup
> code considers the data (and bss) section to be contiguous and so your
> hardware address will get written to during the boot process (either
> with
> 0, if it is in the bss section, or random data if it is in the data
> section.)
Not if I can force a variable to be located at this address (which I can
initialise to zero. Actually, if I can just force the thing to be in the bss
(which will have the same effect) , I'll be happy. Can you tell me how to do
this?

 
> Again, I'd fix the hardware.
I do understand what you are saying, however as IO space is not available on the
external bus, can you suggest how we can map in an external peripheral into data
space without using the scheme that I describe above? note: If we put the
register at the start of external data memory, we will still (due to the
contiguous sections that you describe above), lose the availability of the
internal data memory (~4k on the mega128).

Many thanks,

Scott
avr-gcc-list at http://avr1.org



reply via email to

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