Pic 18LF1622 buffer sd-card

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times
Contact:

Pic 18LF1622 buffer sd-card

Post by stefan.erni »

Hi Ben

I have a Pic 18LF1622. It's working fine to write date with a sectorsize (512Byte)buffer from the FAT.

So what I need is one(or two) buffer more. So I can write in buffer A new date and on the same time write buffer B to the disk (maybe copy to Fatbuffer).

FC7 let me not create a buffer with 512Byte.
7567: (1250) could not find space (512 bytes) for variable _buffera

But FC7 let me just create 4 buffer's with 256Byte.
So it's not a problem of Dataspace. Is ther a way to go to 512byte?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Pic 18LF1622 buffer sd-card

Post by Benj »

Hello,

The compiler might be struggling to find a single block that is large enough.

You could instead break the 512 byte buffer up into 256 bytes.

If the index to the buffer is < 256 then use the first half buffer, otherwise use the second half buffer. This is how the 512 byte buffer inside the FAT component is done.

Could you use the buffer inside the component at all to save you creating two 512 byte buffers?

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times
Contact:

Re: Pic 18LF1622 buffer sd-card

Post by stefan.erni »

Hi Ben
Is it possible to have longer File name as the 8.3?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Pic 18LF1622 buffer sd-card

Post by Benj »

Hello,

Extended file names are something I've been meaning to tackle for a while but they are not that straight forward and potentially add a lot of overhead to the component.

I'll add it to the list to have another investigation on how easy it would be to add support for them.

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times
Contact:

Re: Pic 18LF1622 buffer sd-card

Post by stefan.erni »

Oh Thank you Ben
I have a wish more ....
Write to the first block before I close the file. I need it to write in the fileheader
- how many block there is in the recorded file(data)
-start and stop time

Post Reply