View previous topic :: View next topic |
Author |
Message |
fahdovski Guest
|
fat.c Problem Not Enough Ram error *** Locked - old thread |
Posted: Sat Dec 19, 2009 1:24 pm |
|
|
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 |
|
|
AAA000 Guest
|
SAME PROBLEM HERE |
Posted: Sat Dec 19, 2009 1:50 pm |
|
|
Anyone get any idea? I have the same problem. |
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1933 Location: Norman, OK
|
|
Posted: Sat Dec 19, 2009 3:04 pm |
|
|
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 |
Posted: Sat Dec 19, 2009 3:10 pm |
|
|
PIC16F877
ccs 4.084 |
|
|
Ttelmah Guest
|
|
Posted: Sat Dec 19, 2009 3:32 pm |
|
|
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
|
Re: fat.c Problem Not Enough Ram error |
Posted: Mon Apr 15, 2013 7:38 am |
|
|
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 |
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: 9220 Location: Greensville,Ontario
|
|
Posted: Mon Apr 15, 2013 8:01 am |
|
|
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
++++++++++++++++++++++++++ |
|
|
|