CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

how to declare a 1-dim-array that sizes 1536 elements ?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
julien lochen



Joined: 16 May 2008
Posts: 14

View user's profile Send private message

how to declare a 1-dim-array that sizes 1536 elements ?
PostPosted: Tue Jun 24, 2008 10:03 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Jun 24, 2008 11:15 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Jun 25, 2008 2:04 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Jun 25, 2008 8:36 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Jun 25, 2008 9:12 am     Reply with quote

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

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Wed Jun 25, 2008 1:24 pm     Reply with quote

Remove this line -

Quote:
#device ANSI"


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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group