The C30 compiler (based on gcc) from Microchip for dsPIC33 and PIC24H knows to keep const data in flash. It can even avoid the "Harvard blues" by mapping a big chunk (32 Kbytes) of data address space to flash using a PSVPAG (Program Space Visibility) register. The compiler will manage the PSVPAG register for you, or let you have control.
On Feb 9, 2009, at 12:02 PM, Bogdan Marinescu wrote:
on GCC, and GCC doesn't know about multiple memory spaces, you'll have
a problem with C "const" data on such systems, because it will be
simply copied to RAM (which is already tight) and accessed from there.
But there are some other compilers seem to know how to handle this
issue (don't know if one exists for the dsPIC though)/