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 AVROn top of <strong>the</strong> variables is <strong>the</strong> area where you can allocate dynamic memory. SeeSt<strong>and</strong>ard Library And Memory Allocation Functions. At <strong>the</strong> high address, <strong>the</strong> hardwarestack starts at <strong>the</strong> end of <strong>the</strong> SRAM. Below that is <strong>the</strong> software stack which growsdownward. It is up to you, <strong>the</strong> programmer, to ensure that <strong>the</strong> hardware stack does notgrow past <strong>the</strong> software stack, <strong>and</strong> <strong>the</strong> software stack does not grow into <strong>the</strong> heap.O<strong>the</strong>rwise, unexpected behaviors will result (oops...). See Program Data <strong>and</strong>Constant Memory.External SRAM Data MemoryIf you select a device target with 32K or 64K of external SRAM, <strong>the</strong>n <strong>the</strong> stacks areplaced at <strong>the</strong> top of <strong>the</strong> internal SRAM <strong>and</strong> grow downward toward <strong>the</strong> low memoryaddresses. The data memory starts on top of <strong>the</strong> hardware stack <strong>and</strong> grows upward.The allocations are done differently because <strong>the</strong> internal SRAM has faster accesstime than external SRAM <strong>and</strong> in most cases, it is more beneficial to allocate stackitems to <strong>the</strong> faster memory.Upper 32K External SRAM Data MemoryIn <strong>the</strong> rare occasions that you have 32K external SRAM but it is at <strong>the</strong> upper 32Kaddress space, you can use it by selecting “Internal SRAM Only” in <strong>the</strong> Build Options -Target page, <strong>and</strong> <strong>the</strong>n add -bdata:0x8000.0xFFFF in <strong>the</strong> “O<strong>the</strong>r Options” edit box.Stacks will be allocated to <strong>the</strong> internal SRAM <strong>for</strong> speed <strong>and</strong> global data will beallocated to <strong>the</strong> external SRAM.148

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

Saved successfully!

Ooh no, something went wrong!