3:20 pm
October 31, 2017
I am using an I2C 2*16 char LED and a Deek-Robot Nano Data Logging Shield (product ID 8105). They both work fine when I interface to them independently from an Arduino Nano, however, when I add them both to the same Nano (as I need to do). They interfere. The SD sheild uses CS PIN 10. Please see attachment for demo code.
The error produces is rather random. Sometimes the LCD display starts flickering with strange chars, sometimes it just goes blank.
Any help is greatly appriciated.
/søren
1:04 pm
October 31, 2017
Further to the above matter.
I tried to locate the problem and whilst I can sucessfully write files to the SD card, I have problems with the SD VIs eating memory and if I run the funktions in a while loop (logging random data) I usually only get 4-8 iterations before my application crashes.
Has anyone managed to get the SD vi's to work ?.
I tested my code both with :
Deek-Robot Shield Model 8105 ( CS PIN10) and Deek-Robot Shield Model 8122 and (CS PIN 4)
They both display the same type of erratic behaviour.
Any help would be greatly appriciated.
/søren
6:43 pm
March 12, 2015
You likely have a memory leak. Take a look at the Important Considerations in the user manual. You have to take care on these platforms as you can easily use up all memory if not coded properly.
In you first VI the problem is that you are creating/initializing the LCD on each iteration. This is creating a new object for every iteration which will quickly eat up your memory. You need to pull initialization functions outside the while loop.
In your second VI you are never closing the file. It is outside the loop which will never terminate, and the close file will never execute. You should be closing the file to purge the data to disk. Otherwise it will keep the data in memory and eventually run out. Take a look at the included "SD Card - Simple Datalogger.vi" example. This one should run without the issues you are seeing.
9:21 pm
October 31, 2017
Steffan,
Thanks for answering, sorry for making a novice mistake. I moved the init part of the LCD outside the loop, unfortunately it did not help. I still only get aprox. 4 iterations (loops) then the application crashes. Using Visuino I created the same code and get a memory warning when compiling the applicaiton. So, perhaps the root problem is memory capacity rather than memory leak ? Visuino is a cool tool, no doubt about that. But its dwarfed by LabVIEW and no real match to G.
/søren
9:27 pm
October 31, 2017
10:53 am
February 19, 2018
All,
I am seeing unexpected results when I use an SD reader with an LCD display. The attached simplified examples show the issue well. When I read and display a single line everything is OK. Wehn I read and display multiple lines from the SD it seems not to work correctly. Help is appreciated and have spent too many hours on this simple fish tank configuration read. My code is in LabVIEW 2015.
Matt
7:07 pm
March 12, 2015
It looks like in the case you identified as not working, you are creating an array of string to display on the LCD, but in the loop you are wiring those strings to the same lines on the display with a 300ms update rate. So not sure what you expect to see but if you don't clear the line first you will see characters from the last string, and 300ms is somewhat fast. Can you explain what you are seeing?
12:39 am
March 12, 2015
I would try getting rid of all your unused code, case selectors and case statements. Even though you are disabling them with boolean inputs, they are taking up code space and creating a lot of extra memory copies. And you have an array control with ~100 bytes sitting on the front panel. Every time your array wires hit case structure boundaries, selectors, etc. you create a memory copy of that complete array. It could be that you are running out of memory. Try creating a copy of the VI with all the unnecessary code removed, or use disable structures instead to remove the code.
5:23 pm
March 12, 2015
The SD card library does take up a lot of memory, but that's a function of the core Arduino libraries. One option is to go to a bigger Arduino platform with more memory. You can also take a look at the Saving Read-Only Data to Program Memory.vi example. This shows how you can store large arrays of read-only data to Program Memory instead of RAM. That might benefit you here. You can use the check unused RAM function but that doesn't tell you about fragmentation. You could have 100 bytes free, for example, but not in contiguous space, so if an array is copied that requires more bytes than this, the memory allocation will fail.
6:39 pm
February 19, 2018
Well, I upgraded to an Arduino Mega with 4x more RAM and same results. In my opinion, reading any size SD file is unreliable and have spent way too much time trying to make this work. I have tried parsing strings, parsing bytes, and reading fixed size fields.
I will be at NI Week next week. Does the Arduino team plan be there? I would like to discuss more in person.
Matt
9:34 pm
March 12, 2015
mattFitz said
Well, I upgraded to an Arduino Mega with 4x more RAM and same results. In my opinion, reading any size SD file is unreliable and have spent way too much time trying to make this work. I have tried parsing strings, parsing bytes, and reading fixed size fields.I will be at NI Week next week. Does the Arduino team plan be there? I would like to discuss more in person.
Matt
Can you upload your latest program that is still not working? We have several complex examples using the SD card interface for file read/write on both an Uno and Mega without any issues. To answer your question, we will not be at NIWeek this year.
45
1 Guest(s)