Quantcast
Channel: PSV window, multiple page access for large arrays in flash?
Viewing all articles
Browse latest Browse all 34

Re: PSV window, multiple page access for large arrays in flash? (balmerjd)

$
0
0
Ok, after re-reading the section on PSV memory in the XC16 compiler (Ver. 1.23) this is my take.
__psv__ const char __attribute__ ((space (auto_psv))) array[x] = {...}
You are limited to ONE 32k page of program memory that you have access to.
 
__psv__ const char __attribute__ ((space (psv))) array[x] = {...}

In this case you have access to all of the program memory so long as no object crosses a page boundary (i.e. no single object over 32k).
 
__prog__ const char __attribute__ ((space (prog))) array[x] = {...}

If you must have an object over 32k (one that will cross page boundaries) it needs to be declared like the above shows.
 
The big thing is whether or not you need access to the data inside a interrupt or not. That part I was still somewhat unsure of exactly the ramifications of the auto_psv verse no_auto_psv attributes for interrupts.  Again, this is just my take, but it seems to me it was saying that if you're using auto_psv use that attribute in the instantiation/declaration of an interrupt that needs access to a psv variable.  If you are using straight psv or prog use the no_auto_psv attribute so that the interrupt handler will know to save and restore the PSV registers at entry and exit....  Or at least that's the gist I got...

Viewing all articles
Browse latest Browse all 34

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>