11.07.2015 Views

Imagecraft c compiler and development environment for the atmel avr

Imagecraft c compiler and development environment for the atmel avr

Imagecraft c compiler and development environment for the atmel avr

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ICCV8 <strong>for</strong> AVR – C Compiler <strong>for</strong> Atmel AVRint junk;#pragma data:dataEEPROM Memory eeprom - this area contains <strong>the</strong> EEPROM data. EEPROM data is written to.eep as an Intel HEX file regardless of <strong>the</strong> output file <strong>for</strong>mat.The job of <strong>the</strong> linker is to collect areas of <strong>the</strong> same types from all <strong>the</strong> input object files<strong>and</strong> concatenate <strong>the</strong>m toge<strong>the</strong>r in <strong>the</strong> output file. See Linker Operations.User Defined Memory RegionsIn most cases, you do not need to specify <strong>the</strong> exact location of a particular data item.For example, if you have a global variable, it will be allocated somewhere in <strong>the</strong> dataarea, <strong>and</strong> you do not need to specify its location.However, <strong>the</strong>re are occasions where you want to specify <strong>the</strong> exact location <strong>for</strong> a dataitem or a group of data: battery-backed SRAM, dual-port SRAM, etc. - sometimes it is necessary toallocate some items in special RAM regions.There are two ways to h<strong>and</strong>le this.1. relocatable area - in an assembly module, you can create a new program area<strong>and</strong> <strong>the</strong>n you can specify its starting address under <strong>the</strong> “O<strong>the</strong>r Options” edit box inBuild Options - Target. For example, in an assembly file:.area battery_sram_var1:: .blkw 1 ; note _ in <strong>the</strong> front_var2:: .blkb 1 ; <strong>and</strong> two colonsIn C, <strong>the</strong>se variables can be declared as:extern int var1;extern char var2;Let’s say <strong>the</strong> battery-backed SRAM starts at 0x4000. In <strong>the</strong> Advanced=>O<strong>the</strong>rOptions edit box, you write:-bbattery_sram:0x4000Please refer to <strong>the</strong> page Build Options - Target <strong>for</strong> full description of addressspecifier.2. absolute area - you can also define program areas that have absolute startingaddresses, eliminating <strong>the</strong> need to specify <strong>the</strong> address to <strong>the</strong> linker. For example,150

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!