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

fat.c Problem Not Enough Ram error *** Locked - old thread

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
fahdovski
Guest







fat.c Problem Not Enough Ram error *** Locked - old thread
PostPosted: Sat Dec 19, 2009 1:24 pm     Reply with quote

Code:
#include "D:\INSAT_electronique\PIC C PROJECT\ddd\enfin.h"
#include <fat.h>

void main()
{
char filename[]="test.txt";
char mode[]="w";
FILE stream;


   setup_adc_ports(NO_ANALOGS);
   setup_adc(ADC_OFF);
   setup_psp(PSP_DISABLED);
   setup_spi(SPI_SS_DISABLED);
   setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
   setup_timer_1(T1_DISABLED);
   setup_timer_2(T2_DISABLED,0,1);

   // TODO: USER CODE!!
 
   
   if(fatopen(filename,mode , &stream) != GOODEC)
   {
      printf("Error opening file");
      return;
   }
   
}


i got not Enough RAM for All variable
What should i do plz Crying or Very sad Crying or Very sad
AAA000
Guest







SAME PROBLEM HERE
PostPosted: Sat Dec 19, 2009 1:50 pm     Reply with quote

Anyone get any idea? I have the same problem.
dyeatman



Joined: 06 Sep 2003
Posts: 1931
Location: Norman, OK

View user's profile Send private message

PostPosted: Sat Dec 19, 2009 3:04 pm     Reply with quote

OK folks, again...what model is the PIC and what is the CCS version?
_________________
Google and Forum Search are some of your best tools!!!!
fahdovski
Guest







Same
PostPosted: Sat Dec 19, 2009 3:10 pm     Reply with quote

PIC16F877
ccs 4.084
Ttelmah
Guest







PostPosted: Sat Dec 19, 2009 3:32 pm     Reply with quote

I seriously doubt if the 16F877, has enough RAM. You will definitely need the option:

#device *=16

in your enfin.h file, as the line immediately after including the processor defines, to have 'any hope'...

Best Wishes
martind1983



Joined: 22 Mar 2013
Posts: 16

View user's profile Send private message

Re: fat.c Problem Not Enough Ram error
PostPosted: Mon Apr 15, 2013 7:38 am     Reply with quote

fahdovski wrote:
Code:
#include "D:\INSAT_electronique\PIC C PROJECT\ddd\enfin.h"
#include <fat.h>

void main()
{
char filename[]="test.txt";
char mode[]="w";
FILE stream;


   setup_adc_ports(NO_ANALOGS);
   setup_adc(ADC_OFF);
   setup_psp(PSP_DISABLED);
   setup_spi(SPI_SS_DISABLED);
   setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
   setup_timer_1(T1_DISABLED);
   setup_timer_2(T2_DISABLED,0,1);

   // TODO: USER CODE!!
 
   
   if(fatopen(filename,mode , &stream) != GOODEC)
   {
      printf("Error opening file");
      return;
   }
   
}


i got not Enough RAM for All variable
What should i do plz Crying or Very sad Crying or Very sad


First off you try to read comments in FAT.c library and you will immediately see that first you have to use fat_init function before using of any other functions. Second the issue can really be in small RAM memory of your MCU. You should read datasheet and then you will know if that's not problem.
Last thing in your code on this forum don't use this if(fatopen(filename,mode , &stream) != GOODEC) in condition because you don't know if the compiler doesn't throw return value first and then it compares condition with incorrect value. You rather use this

int8 check;
if((check =fatopen(filename,mode , &stream)) != GOODEC)



++++++++++++++++++++++++++
martind1983,

Do not reply to old threads from 2009.
No one is waiting for the reply.

- Forum Moderator
++++++++++++++++++++++++++
temtronic



Joined: 01 Jul 2010
Posts: 9203
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Apr 15, 2013 8:01 am     Reply with quote

also...
unless you use PROPER signal translation hardware you'll never get a 5 volt PIC to 3 volt memory card.Can't be done..
So before you go any further, show us the schematic of what you have..or the pinout connections.

No sense blaming software if you have wrong hardware !!

hth
jay


++++++++++++++++++++++++++
temtronics,

You too. Check the thread date.
No one is waiting for the reply.

- Forum Moderator
++++++++++++++++++++++++++
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.    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