Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[PIC] sd card, size of file

Status
Not open for further replies.

yann75

Newbie level 3
Joined
Jun 11, 2014
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
19
hi guys :-o

Code:
sbit Mmc_Chip_Select at LATA5_bit;
sbit Mmc_Chip_Select_Direction at TRISA5_bit;

void cr_dosier ()
{
unsigned int size;
unsigned short caract, i;

Mmc_Fat_Set_File_Date(2014, 08, 06, 15, 20, 30);
Mmc_Fat_Assign("test.TXT", 0x80); // Find existing file or create a new one 
Mmc_Fat_append();
Mmc_Fat_Write(" this is just a test ", 21); 
Mmc_Fat_Write("\r\n",2);

Mmc_Fat_reset(&size);
for (i=0; i < size; i++)
{
Mmc_Fat_read(&caract);
UART1_Write(caract);
}
UART1_Write(13);
}
void main()
{ 
while(1)
{
cr_dosier();
}
}
my project is recording data in sd card, i have create a file for testing, but after simulation the probleme that i can't store more than 10 lines. any one have an idea on how to increase the size of the file :smile: or i have to use the sectors !!!!
this is just a test
this is just a test
this is just a test
.
.
.
.
.
this is just a test // 10 times
 
Last edited by a moderator:

I think it might be happening because of the value allocated to the variable 'size'.What is the value assigned to 'size' in this program..?
 
  • Like
Reactions: yann75

    yann75

    Points: 2
    Helpful Answer Positive Rating
Your post misses impotant informations:
- processor (apparently PIC16 or PC18)
- compiler
- SD card library
 
  • Like
Reactions: yann75

    yann75

    Points: 2
    Helpful Answer Positive Rating
I think it might be happening because of the value allocated to the variable 'size'.What is the value assigned to 'size' in this program..?

hi udayan92; thanks for replay
size is variable int .

unsigned int size.

according to the help of mikroc : it said
size: buffer to store file size to. After file has been open for reading, its size is returned through this parameter.
i didn't give a value to size. juste declare it.
 

hi FvM; thanks for replay ;
PIC 18F4520
compiler MIKROC PRO
FAT16 MMC library
 
Last edited:

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top