Pages: [1]   Go Down
Author Topic: MicroSD card and Serial/Reset issue  (Read 1009 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey all,

I'm trying to store arrays to a 2GB SD card which I can then access later. I am using the EtherTen 328P board which contains a microSD socket.
I am able to read/write files to the card in small testing sketches, however I have come across an issue in my main program.

My program seems to reset and start over at times when I am running my program, which I can see using the Serial Monitor. The serial port also sometimes shows garbage and random characters while running the program. Usually the program will restart midway through a Serial.Print() statement.

I am using the standard SD commands (#include <SD.h>). The arrays I am writing can be 400 bytes max.

My question is, might the SD commands be taking up too much SRAM, if I only have 2KB of it? I also read/write from the Serial often in my program, could this contribute to the issue?

My code is long and confusing, so I wont make you read through it, I'm just curious if this is a known issue.

Cheers,
Joshua

Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 152
Posts: 6191
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Running out of SRAM is a known issue. It happens a lot, especially if you use a lot of strings without using the "F" function. For an example:
Code:
Serial.println("This is a string that will be put in SRAM before printing");
Serial.println(F("This string will be printed from program memory"));
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey thanks a lot for your reply, I have not heard of using the F function when printing strings!
Much appreaciated!
Logged

Pages: [1]   Go Up
Jump to: