Global Sources
EE Times-Asia
Stay in touch with EE Times Asia
EE Times-Asia > Memory/Storage

Forcing C variables into memory pages

Posted: 09 Feb 2010 ?? ?Print Version ?Bookmark and Share

Keywords:memory pages? C variables? C specific memory?

A PSoC 1 with more than 256bytes of RAM uses the Large Memory Model (LMM) architecture. The LMM contains a variety of registers that are used to page through the entire SRAM. For example, the 512byte PSoCs have two pages of SRAM, each being 256bytes; the 2K byte PSoCs have eight pages of SRAM.

When programming PSoC using C, the compiler manages the allocation of memory for each declared variable. The compiler also accesses the SRAM using the LMM registers without any special directives from the program.

However, it is useful to have the variables allocated to specific areas in memory. If a design has several buffers for a communication channel, it may make debugging easier if an input buffer was in one page while an output buffer was allocated in a different page. Or perhaps you are writing some assembly code to complement your C code. If the variables that are accessed in the assembly code are all in the same SRAM page, the code is more efficient since there is no need to change the page pointer registers. These are some reasons to purposely allocate pages for the C variables.

View the PDF document for more information.

Click here to view related datasheets.

Article Comments - Forcing C variables into memory page...
*? You can enter [0] more charecters.
*Verify code:


Visit Asia Webinars to learn about the latest in technology and get practical design tips.

Back to Top