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

Not enough ram for all variables????

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



Joined: 09 Sep 2005
Posts: 16

View user's profile Send private message

Not enough ram for all variables????
PostPosted: Tue Sep 20, 2005 3:44 am     Reply with quote

Hi all, could anyone explain me why the code :

Code:
 write_word_adc(mode_reg, int_full_scale | hiref | scala80mv |word_len|/*|unipolar*/ , true);


is perfectly functioning with 78% of ram occupation, while the code

Code:
 write_word_adc(mode_reg, int_full_scale | hiref | scala80mv  |word_len|unipolar , true);


gives me the error in the subject?

All the parametres are defined with the directive #define:
Code:

#define comm_reg 0
#define status_reg 0
#define data_reg 1
#define mode_reg 2
#define filter_reg 3
#define offset_reg 5
#define gain_reg 6
#define test_reg 7
#define single_write 0
#define single_read 0x10
#define cont_read 0x20
#define cont_stop 0x30
#define sync_mode 0
#define cont_mode 0x2000
#define single_mode 0x4000
#define stdby_mode 0x6000
#define int_zero_scale 0x8000
#define int_full_scale 0xa000
#define sys_zero_scale 0xc000
#define sys_full_scale 0xe000
#define unipolar 0x1000
#define word_len 0x100             
#define hiref 0x0080           
#define channel_12 0x4         
#define channel_34 0x5       
#define scala20mv 0x0
#define scala40mv 0x0020
#define scala80mv 0x0030
#define scala320mv 0x0050
#define scala1280mv 0x0070



Thankyou very much!!
Freddie



Joined: 06 Sep 2003
Posts: 49

View user's profile Send private message

PostPosted: Tue Sep 20, 2005 6:33 pm     Reply with quote

Which PIC Chip are you compiling for?
pirev



Joined: 19 Mar 2005
Posts: 13
Location: Bulgaria

View user's profile Send private message Visit poster's website ICQ Number

PostPosted: Wed Oct 05, 2005 4:52 am     Reply with quote

Hi all,
I have a problem with "Not enough RAM for all variables",
processor is PIC18F252 with 1536 byte RAM, but the complier counting only 256 bytes. Here is my header of listing:

Filename: C:myfile\prog\pic\c\ccsc\lcdraw\2005\pic18\3\lcd3.LST
ROM used: 5252 bytes (16%)
Largest free fragment is 24294
RAM used: 215 (84%) at main() level
246 (96%) worst case
Stack: 8 worst case (5 in main + 3 for interrupts)

CCS C compiler is version 3.221
Ttelmah
Guest







PostPosted: Wed Oct 05, 2005 10:19 am     Reply with quote

The obvious reason, if you have PCW, is that somebody has gone into the device editor, and 'unticked' all but one of the memory banks. The first six should all be ticked.
if you have not got device editor, then you have a corrupted .dat file. Re-installing it should fix the problem.

Best Wishes
pirev



Joined: 19 Mar 2005
Posts: 13
Location: Bulgaria

View user's profile Send private message Visit poster's website ICQ Number

PostPosted: Thu Oct 06, 2005 8:49 am     Reply with quote

Hi, problem was in directive #DEVICE *=8, because my source is ported from PIC16F873 to PIC18F252 and I was forget to remove this directive.
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