Problem writing to sd card
Moderator: Benj
-
- Posts: 63
- Joined: Mon Dec 23, 2013 5:51 pm
- Been thanked: 8 times
- Contact:
Problem writing to sd card
hi,
I'm here with a problem and do not know what could be.
I have a code to save 20 temperature probes for sd card.
But when I open the records from the recording appear esquecitos characters.
If any can help me grateful.
Thank you
I'm here with a problem and do not know what could be.
I have a code to save 20 temperature probes for sd card.
But when I open the records from the recording appear esquecitos characters.
If any can help me grateful.
Thank you
- Attachments
-
- 1_3.txt
- registration
- (9.21 KiB) Downloaded 216 times
-
- RTD_DataLogger_V1.15.fcfx
- (139.51 KiB) Downloaded 238 times
- 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: Problem writing to sd card
Hello,
I think the problem may be down to your program structure.
A typical program will have a while 1 loop in the main which loops forever and calls the functions.
In your program the structure looks to be like this as one possible option.
Main -> Menu -> Registar -> FileName -> Menu -> Registar -> FileName -> Menu -> Registar -> FileName -> Menu -> Registar -> FileName -> Menu -> .......
As you can see we have re-entered the Menu macro and this will likely corrupt the first instance (if we ever get back to it). Best case scenario the stack will eventually fall over and then things get a bit unpredictable.
I would see if you can re-arrange your code so that it is called from a loop in the Main, maybe using variables to keep track of what your doing in the loop.
I think the problem may be down to your program structure.
A typical program will have a while 1 loop in the main which loops forever and calls the functions.
In your program the structure looks to be like this as one possible option.
Main -> Menu -> Registar -> FileName -> Menu -> Registar -> FileName -> Menu -> Registar -> FileName -> Menu -> Registar -> FileName -> Menu -> .......
As you can see we have re-entered the Menu macro and this will likely corrupt the first instance (if we ever get back to it). Best case scenario the stack will eventually fall over and then things get a bit unpredictable.
I would see if you can re-arrange your code so that it is called from a loop in the Main, maybe using variables to keep track of what your doing in the loop.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 63
- Joined: Mon Dec 23, 2013 5:51 pm
- Been thanked: 8 times
- Contact:
Re: Problem writing to sd card
Hi Benj
I made a program with only the part that is giving me problems, is much simpler.
But I still with the problem.
If I am able to help thanked
I made a program with only the part that is giving me problems, is much simpler.
But I still with the problem.
If I am able to help thanked
- Attachments
-
- RTD_DataLogger_V1.15_main.fcfx
- (72.36 KiB) Downloaded 245 times
-
- oi.txt
- (78.87 KiB) Downloaded 220 times
-
- Posts: 63
- Joined: Mon Dec 23, 2013 5:51 pm
- Been thanked: 8 times
- Contact:
Re: Problem writing to sd card
hi,
I noticed that with several program to see my records, they never show the same mistakes.
Which program do you use to be records?
best regards
I noticed that with several program to see my records, they never show the same mistakes.
Which program do you use to be records?
best regards
-
- Posts: 63
- Joined: Mon Dec 23, 2013 5:51 pm
- Been thanked: 8 times
- Contact:
Re: Problem writing to sd card
Hi
After all is not the open log file program. I'm desperate. can help?
After all is not the open log file program. I'm desperate. can help?
- 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: Problem writing to sd card
Hello,
I've had a go at simplifying your program so you don't need as many variables etc. I'm not sure why you're getting the corruption but hopefully this should make it easier to see what's going on.
I have reduced the sensor count from 20 to 5 temporarily so we can quickly and easily change bits of the code without having to do it 20 times to see if it works.
I have reduced the append function down to a single cycle per loop and this should hopefully greatly reduce the comms to the card and hopefully also reduce the chance of the error.
Have a go and let me know how you get on.
I've had a go at simplifying your program so you don't need as many variables etc. I'm not sure why you're getting the corruption but hopefully this should make it easier to see what's going on.
I have reduced the sensor count from 20 to 5 temporarily so we can quickly and easily change bits of the code without having to do it 20 times to see if it works.
I have reduced the append function down to a single cycle per loop and this should hopefully greatly reduce the comms to the card and hopefully also reduce the chance of the error.
Have a go and let me know how you get on.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 63
- Joined: Mon Dec 23, 2013 5:51 pm
- Been thanked: 8 times
- Contact:
Re: Problem writing to sd card
hi benj
Thanks for the reply
I put your code to work and had the same problem.
I leave the file to view
best regards
Thanks for the reply
I put your code to work and had the same problem.
I leave the file to view
best regards
- Attachments
-
- oi.txt
- (310.85 KiB) Downloaded 224 times
- 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: Problem writing to sd card
Hello,
Is it the simulation or embedded code that is creating the log files with issues your posting? Looks like there is a bug lurking here somewhere.
Is it the simulation or embedded code that is creating the log files with issues your posting? Looks like there is a bug lurking here somewhere.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 63
- Joined: Mon Dec 23, 2013 5:51 pm
- Been thanked: 8 times
- Contact:
Re: Problem writing to sd card
Hello benj,
The file I posted is what gave me when your post code on my hardware
The file I posted is what gave me when your post code on my hardware
-
- Posts: 63
- Joined: Mon Dec 23, 2013 5:51 pm
- Been thanked: 8 times
- Contact:
Re: Problem writing to sd card
Hello
I'm back to my project.
But still no progress.
I leave the record of my memory card.
490 490 records in practically the value gets spoiled.
Does not detect a change lines.
What could it be?
File in Excel
greetings
I'm back to my project.
But still no progress.
I leave the record of my memory card.
490 490 records in practically the value gets spoiled.
Does not detect a change lines.
What could it be?
File in Excel
greetings
- Attachments
-
- RTD_DataLogger_V1.15_main-1.fcfx
- (27.38 KiB) Downloaded 231 times
-
- oi.xls
- (205 KiB) Downloaded 202 times
-
- Posts: 528
- Joined: Sat Dec 01, 2012 1:23 pm
- Location: Sweden
- Has thanked: 49 times
- Been thanked: 101 times
- Contact:
Re: Problem writing to sd card
Hi,
Can you please try this modified file and let us know if or how it worked.
/Daniel S
Can you please try this modified file and let us know if or how it worked.
/Daniel S
-
- Posts: 63
- Joined: Mon Dec 23, 2013 5:51 pm
- Been thanked: 8 times
- Contact:
Re: Problem writing to sd card
good Morning
It does not work. Gives the same error
Any more suggestions?
greetings
It does not work. Gives the same error
Any more suggestions?
greetings
-
- Posts: 528
- Joined: Sat Dec 01, 2012 1:23 pm
- Location: Sweden
- Has thanked: 49 times
- Been thanked: 101 times
- Contact:
Re: Problem writing to sd card
It still says that the file I provided hasn't been downloaded yet so how have you been able to test it?
edit: I just downloaded the file I provided and it instantly says it's been downloaded 1 time. I just wanted to make sure the information was accurate.
edit: I just downloaded the file I provided and it instantly says it's been downloaded 1 time. I just wanted to make sure the information was accurate.
-
- Posts: 63
- Joined: Mon Dec 23, 2013 5:51 pm
- Been thanked: 8 times
- Contact:
Re: Problem writing to sd card
In his commentary is a file. I test this file. If you can post again thanked.hyperion007 wrote:It still says that the file I provided hasn't been downloaded yet so how have you been able to test it?
edit: I just downloaded the file I provided and it instantly says it's been downloaded 1 time. I just wanted to make sure the information was accurate.
-
- Posts: 528
- Joined: Sat Dec 01, 2012 1:23 pm
- Location: Sweden
- Has thanked: 49 times
- Been thanked: 101 times
- Contact:
Re: Problem writing to sd card
Sorry but I don't understand what you just said.
I have attached a file, which you have not downloaded...
I have attached a file, which you have not downloaded...
hyperion007 wrote:Hi,
Can you please try this modified file and let us know if or how it worked.
/Daniel S
-
- Posts: 63
- Joined: Mon Dec 23, 2013 5:51 pm
- Been thanked: 8 times
- Contact:
-
- Posts: 63
- Joined: Mon Dec 23, 2013 5:51 pm
- Been thanked: 8 times
- Contact:
Re: Problem writing to sd card
Good afternoon,
Any other opinion? I am desperate.
Does the configuration of DSPIC or perhaps viewing program records?
Attached leave the system I am using
Can I get help?
Any other opinion? I am desperate.
Does the configuration of DSPIC or perhaps viewing program records?
Attached leave the system I am using
Can I get help?
- Attachments
-
- ujet32_plus_manual.pdf
- (3.23 MiB) Downloaded 152 times
- 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: Problem writing to sd card
Hello,
Looks like a nice little board, do the manufacturers know of any potential problems with the hardware?
Have you tried more than one card? Also have you tried formatting the card? I've received flash based devices before from sources like eBay and they are essentially fake but look the real deal until you try and store data.
Is there a pattern at all you can see to what is going wrong?
Have you tried reducing the number of sensors to 1 and seeing if you can get this to work reliably?
Looks like a nice little board, do the manufacturers know of any potential problems with the hardware?
Have you tried more than one card? Also have you tried formatting the card? I've received flash based devices before from sources like eBay and they are essentially fake but look the real deal until you try and store data.
Not sure what you mean by this.490 490 records in practically the value gets spoiled.
Is there a pattern at all you can see to what is going wrong?
Have you tried reducing the number of sensors to 1 and seeing if you can get this to work reliably?
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel