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

How to place 4k array in program memory

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



Joined: 09 Jun 2006
Posts: 3

View user's profile Send private message

How to place 4k array in program memory
PostPosted: Tue Sep 08, 2009 12:41 am     Reply with quote

I am using PIC16F877A. I want to place constant data in ROM program
memory which is 8K in PIC16F877A. My array size is 4k. I am using
CONST and BYTE CONST directive to place data in array, but get error:
too big data. How to resolve this problem ?
Ttelmah
Guest







PostPosted: Tue Sep 08, 2009 2:29 am     Reply with quote

You can place a ROM table this size, using #ROM, _but not access it as a variable_. CCS, on the 16 chips, only allows const tables up to 256 bytes to be used. What you will need to do, is to place a #ROM directive wth the table at 0x1000, and then access this using the read_program_memory function.
This is a 'historical' limitation, few of the 16 chips, allow direct access to the program ROM, so the tables had to be constructed using RETLW instructions, and a table jump, which only supports 256 addresses max.
Generally much easier to do, in PIC18 chips.

Best Wishes
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