View previous topic :: View next topic |
Author |
Message |
Pota78
Joined: 09 Sep 2005 Posts: 16
|
Not enough ram for all variables???? |
Posted: Tue Sep 20, 2005 3:44 am |
|
|
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
|
|
Posted: Tue Sep 20, 2005 6:33 pm |
|
|
Which PIC Chip are you compiling for? |
|
|
pirev
Joined: 19 Mar 2005 Posts: 13 Location: Bulgaria
|
|
Posted: Wed Oct 05, 2005 4:52 am |
|
|
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
|
|
Posted: Wed Oct 05, 2005 10:19 am |
|
|
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
|
|
Posted: Thu Oct 06, 2005 8:49 am |
|
|
Hi, problem was in directive #DEVICE *=8, because my source is ported from PIC16F873 to PIC18F252 and I was forget to remove this directive. |
|
|
|