SV: [Icc-avr] Re: Doubts using external memory variables
Steven Lose
sl at ecpower.dk
Tue Oct 30 07:20:47 PST 2007
Hi.
Well then your global data and your module global data will already end up in your external memory.
Problem is they get initialized at start up. But the solution is as I mentioned earlier, is to have your variables at a fixed location, and then tell the compiler that the area is used. Then it will not get initialized.
At start up, you will then have to check all your variables, to see if they are within your boundaries, and restore to default if data is not ok, a bit similar to what I do whit eeprom, but here I know that 0xFF is the default value when the eeprom is cleared, you don't know that with your bat memory.
I still can't remember the correct syntax on how to tell the compiler that a memory area is not available to the compiler, but soon someone on the list will remind me. ;o)
Med venlig hilsen / Best regards / mit freundlichen Grüßen
EC POWER A/S
Steven Lose
Software Ingeniør
Tlf.: +45 87434100
Direkte tlf. +45 58286608
Email: sl at ecpower.dk <blocked::mailto:bsl at ecpower.dk>
www.ecpower.dk
_____________________________________________
Fra: icc-avr-bounces at imagecraft.com [mailto:icc-avr-bounces at imagecraft.com] På vegne af Guillermo Megía Palma
Sendt: 30. oktober 2007 13:58
Til: icc-avr at imagecraft.com
Emne: [Icc-avr] Re: Doubts using external memory variables
Hi,
Thanks Steven for your answer.
I have told the compiler about the external memory, so I don´t have to control the bus (I have set the bit that enables the External SRAM in the MCUCR register of the ATMega 128).
I want to allocate some variables in external memory and others in internal one, not all of them in one specific memory (my external memory has a back-up battery, so I want to save there some variables to not lose them if I turn off my system). Moreover, it isn´t important for me the address assigned by the compiler to a variable in external memory. I only want the compiler to avoid variables overlaps.
Regards,
Guillermo Megía
<<Fil: ATT43289.txt >>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20071030/42c7f612/attachment.html
More information about the Icc-avr
mailing list