View previous topic :: View next topic |
Author |
Message |
julien lochen
Joined: 16 May 2008 Posts: 14
|
how to declare a 1-dim-array that sizes 1536 elements ? |
Posted: Tue Jun 24, 2008 10:03 am |
|
|
Hello,
I am using CCS with MPLAB IDE.
I declared my own ASCII table which is a 1-dim-table which contents 1536 elements.
It says
"
*** Error 87 "D:\LCP_PIC16F886_CCS\LCP_font_8x16.h" Line 2(32,33): Data item too big"
Is there a declaration to do (#define xxxx ? PRAGMA ?) to allow the use of a table that sizes more than 256 elements ?
thanks, julien |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Jun 24, 2008 11:15 am |
|
|
1. When you have a question about a line of code that causes an error,
always post the line of code.
2. Post your compiler version.
3. Also, read the PIC data sheet to see how much RAM is available. |
|
|
julien lochen
Joined: 16 May 2008 Posts: 14
|
|
Posted: Wed Jun 25, 2008 2:04 am |
|
|
I use MPLAB IDEV8.0 with a PIC16F886
368 bytes of RAM are available.
The data-sheet of the compileter says you can use the directive:
" #device ANSI" to set the pointer size to 16 bits if the part has RAM over 0FF.
That's the case with the PIC16F886. So at the top of my standard header file I put :
"#device PIC16F886 *=16
#device ANSI"
but MPLAB says: "Error 74 "PIC_16F886.c" Line 372(0,1): Not enough RAM for all variables" |
|
|
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Wed Jun 25, 2008 8:36 am |
|
|
So are you trying to store 1536 elements on a chip that only has 368 bytes of RAM? How big is each element? If they are bigger than booleans it ain't going to work. _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
|
julien lochen
Joined: 16 May 2008 Posts: 14
|
|
Posted: Wed Jun 25, 2008 9:12 am |
|
|
so, I am trying to store the table in ROM using the synthax:
rom const char tab_font_8x16[1536] = {0x0 ...}
it says:
Executing: "C:\Program files\Picc\CCSC.exe" +FM "PIC_16F886.c" +DF +LN +T +A +M -Z +ICD +Y=9 +EA
*** Error 87 "D:\LCP_PIC16F886_CCS\LCP_font_8x16.h" Line 2(36,37): Data item too big |
|
|
SET
Joined: 15 Nov 2005 Posts: 161 Location: Glasgow, UK
|
|
Posted: Wed Jun 25, 2008 1:24 pm |
|
|
Remove this line -
I think this was pointed out before in another post in a previous thread, if you have ANSI compatibility mode set then the compiler will attempt to put the array in RAM. |
|
|
|