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
sd card read-write
Moderator: Benj
-
- Posts: 128
- Joined: Thu Jul 27, 2017 5:23 am
- Has thanked: 8 times
- Been thanked: 8 times
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
-
- Posts: 128
- Joined: Thu Jul 27, 2017 5:23 am
- Has thanked: 8 times
- Been thanked: 8 times
-
- Posts: 128
- Joined: Thu Jul 27, 2017 5:23 am
- Has thanked: 8 times
- Been thanked: 8 times
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
Re: sd card read-write
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
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