Page 1 of 1

sd card read-write

Posted: Wed Jun 24, 2020 10:34 am
by kabouras_33
Hello all,
I have a question i try for days now to accomplish one basic (in my opinion task)
So i am developing a system in which i receive a string of info and then parse them convert them and so on....
so i try to store a string "23/12/22 12:34 CBS1 AL _" to txt and "23/12/22 12:34 CBS1 AL " to csv when i choose on the same time.
the goal here is to be able to write into files and to be able to read back only from the txt when i push a button and csv only from pc...
I am very unsuccesfull.....the data always gets corrupted and sometimes after writing 4-5 strings...
any help or example to write in to 2 files and retrieve from one reliably would be most welcome

Re: sd card read-write

Posted: Wed Jun 24, 2020 10:53 am
by stefan.erni
Hi kabouras

Can you post your program so I can have a look?

Re: sd card read-write

Posted: Wed Jun 24, 2020 11:24 am
by kabouras_33
yeah of course 5 min please!

Re: sd card read-write

Posted: Wed Jun 24, 2020 11:38 am
by kabouras_33
ready

Re: sd card read-write

Posted: Wed Jun 24, 2020 4:21 pm
by stefan.erni
Hi kabouras

Have you already tried to write the two files to the card and then read both with the computer?
Without your are reading a file with the PIC? Are both files ok?
And why did you choose the return string size just to 240 when you read max 255 byte?
Sometimes reduce the spi speed help, change the divider by 16.
And some of the card are very slow in read and write. I mean they need a long time to do it, you need to wait before you can write-read again.
With a Sandisk Extrem Pro 32G, I had the least problems.

regards

Stefan