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

Help: buffer size limited in PIC16 parts

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



Joined: 22 Mar 2007
Posts: 23
Location: Buenos Aires, Argentina

View user's profile Send private message

Help: buffer size limited in PIC16 parts
PostPosted: Tue Jul 31, 2007 12:36 pm     Reply with quote

Hello, this is the second time i have this problem:

I need to make a buffer as long as possible for keep received data to re-send this to another port with another baudrate and more.

The problem is that the buffer size is limited to 87 bytes (at least for PIC16F628 and PIC16F818).

I made a function MAIN with almost nothing in it (a for(;;);) to test if the compiller is not using ram for another thing, but it isn't

Now, if I increment the value of the "unsigned char BUFFER[87]" to 88 or more, the compillers gives an error: *** Error 74 ..... MC-140.c" Line 58(0,1): Not enough RAM for all variables

But if I keep this variable of 87 elements and i declare another variable of 20 elements more (unsigned char buffer2[20]), the compiller don't give errors anymore and the program is using more ram than if I have declared only buffer with 88 elements!!

How can I use all the ram I need? this pic has 128 bytes of ram.

thanks!!!!!
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Jul 31, 2007 12:44 pm     Reply with quote

Quote:

I need to make a buffer as long as possible for keep received data
to re-send this to another port with another baudrate and more.

The problem is that the buffer size is limited to 87 bytes (at least for
PIC16F628 and PIC16F818).

See this post:
http://www.ccsinfo.com/forum/viewtopic.php?t=30456&start=4
metalm



Joined: 22 Mar 2007
Posts: 23
Location: Buenos Aires, Argentina

View user's profile Send private message

PostPosted: Tue Jul 31, 2007 12:47 pm     Reply with quote

Thank you very much! sorry for opening another post...
metalm



Joined: 22 Mar 2007
Posts: 23
Location: Buenos Aires, Argentina

View user's profile Send private message

PostPosted: Tue Jul 31, 2007 1:06 pm     Reply with quote

In this pic, there is a block of 96 bytes, starting from 0x20 to 0x7F

When I want to #locate this buffer in 0x20, the compiller says to:

Line 18(1,5): Constant out of the valid range 077 is reserved by the compiler

Shocked Confused Confused Confused Question Question Question
metalm



Joined: 22 Mar 2007
Posts: 23
Location: Buenos Aires, Argentina

View user's profile Send private message

PostPosted: Wed Aug 01, 2007 12:59 pm     Reply with quote

Hello again, I saw that the compiller uses the direction 0x77 and 0x78 for the delay routines and for saving the "STATUS" register Confused

Could I change that ???

thanks!
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Aug 01, 2007 1:52 pm     Reply with quote

In the 2nd to last post in this thread, it says that you can do it by
using the #locate directive. I tried it with PCM vs. 4.047 and I couldn't
make it work.
http://www.ccsinfo.com/forum/viewtopic.php?t=27996

Then in the CCS manual, it says you can change the default region
for variables by using the 'addressmod' and #type directives.
Again, I couldn't make it work. It may be something in the syntax
or the explanation in the manual that I don't understand. Or, it may be
that it's not implemented yet.

I suggest you contact CCS support and ask them how to relocate
scratch variables.
metalm



Joined: 22 Mar 2007
Posts: 23
Location: Buenos Aires, Argentina

View user's profile Send private message

PostPosted: Wed Aug 01, 2007 2:29 pm     Reply with quote

Thank you!!
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