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 CCS Technical Support

Problem with pointer to a constant

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







Problem with pointer to a constant
PostPosted: Mon Oct 27, 2008 7:29 am     Reply with quote

I have this array to hold an image. I'm using pic16f887 and I can't hold more than 256 array.

Code:

File img.h
const char IMGA[256]={121,212,545...} // this holds a part of an image


Code:

File main.c

#include <16f887.h>
#DEVICE PASS_STRINGS = IN_RAM // I saw this in forum to create a pointer to a constant

void draw_bitmap(char *IMG)
{
//Process...

}



the problem is I can't access to values.

IMG[index]
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Oct 27, 2008 12:29 pm     Reply with quote

The 'const' array size limit for 16F PICs is 256 bytes:
http://www.ccsinfo.com/forum/viewtopic.php?t=36068

See the code at the end of this thread. It uses a switch-case statement
to select which 'const' text to display:
http://www.ccsinfo.com/forum/viewtopic.php?t=36068
Also see this one:
http://www.ccsinfo.com/forum/viewtopic.php?t=880&start=1

There might be other ways to do it.
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