LCD and SD card fail to co-exist | Arduino Compatible Compiler for LabVIEW Discussions | Forum

Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 4 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
LCD and SD card fail to co-exist
December 3, 2017
3:20 pm
Avatar
vendersgade
Member
Forum Posts: 5
Member Since:
October 31, 2017
sp_UserOfflineSmall Offline

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

SD_card_error.pngImage Enlarger

Attachments
December 4, 2017
1:04 pm
Avatar
vendersgade
Member
Forum Posts: 5
Member Since:
October 31, 2017
sp_UserOfflineSmall Offline

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

December 4, 2017
6:43 pm
Avatar
Steffan
Admin
Forum Posts: 301
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

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.

Forum Timezone: UTC 0

Most Users Ever Online: 33

Currently Online:
2 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

John: 18

RTSLVU: 15

Dan6077: 11

Member Stats:

Guest Posters: 0

Members: 80

Moderators: 0

Admins: 3

Forum Stats:

Groups: 1

Forums: 2

Topics: 58

Posts: 289

Newest Members: Marielop, engladcub, AbbaLearilky, LeiylaWes, pavlik76Sed

Administrators: geadmin: 5, filipealtoe: 35, Steffan: 89