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

Large array question

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



Joined: 21 Mar 2014
Posts: 12

View user's profile Send private message

Large array question
PostPosted: Fri May 15, 2015 2:07 pm     Reply with quote

All,

I have a simple project using the 16F1705. I have a large array (7330 bytes) and using HDx I am able to create that in hex C format. Basically this is a setup file for a small FPGA. The PIC is going to set this up and then an I2C device then sleep. I want this in DIP so I can send updates if needed.

I get a segment error because of the length. I remember doing a project before with this error and I had do specify some 16 bit pointer or something and I can't seem to find it.

Anybody remember what this is?

Thanks,
Gordon
_________________
J. Gordon Rankin
Wavelength Audio, ltd.
wavelength



Joined: 21 Mar 2014
Posts: 12

View user's profile Send private message

PostPosted: Fri May 15, 2015 2:42 pm     Reply with quote

All,

Ok I see this has to do with the missinterpretation of 14K bytes verses 8K program space.

Anyone know of a simple zip routine? This structure is has tons of zero's in it.

Thanks,
Gordon
_________________
J. Gordon Rankin
Wavelength Audio, ltd.
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Fri May 15, 2015 2:59 pm     Reply with quote

i would us a cheap pic with I2C as a HOST-
16f1825 ( $1.10/100) comes to mind -
and then
add a DIP socket-8 that is crafted to hold a 24LC64-N package
EEPROM CHIP ( $.33/100) with 8 k bytes of storage and just jack the DIP 8 in and out of your pic handler circuit.

leave the PIC loader board wherever - and just mail a 3/$1 throw away DIP program loader part.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri May 15, 2015 3:54 pm     Reply with quote

Quote:
Ok I see this has to do with the missinterpretation of 14K bytes verses 8K program space.

Flash memory pages in the 16F1705 are 2048 words long, and there are
four pages. Each word is 14 bits. You can store one byte per word
with a RETLW xx instruction. The compiler does this for you when you
declare an array. So, allowing for some code to access the data, you
could store nearly 8K bytes in the PIC.

However, the compiler will not let an array be larger than a 2K program
memory page. You will have to break the large array into at least four
smaller arrays. Also, there is a small amount (less than 16 words)
of "access code" that the compiler places at the start of each array.
So you can't store exactly 2048 bytes per rom page.
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