Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

SD Card read txt file specific data

Status
Not open for further replies.
My comprenhision ends at the point where you are reading a string of the form "2741#8785#3922#5805#" with readString(). The actual data file posted above is 8000 characters longs. Are you sure it can be read with a single readString() call? I rather guess it exceeds the maximal string size.

Btw., you still didn't answer about the used processor and software enviroment. We can guess that it's Arduino IDE, but which processor target?
 

Hi,
I found many articles most of them using example of Arduino IDE of SD Card but I do not need it.
sometimes I think he´s using Arduino, sometimes not.
I´m confused.

No clear error description. I like to help - but it is impossible this way.

Klaus
 

My comprenhision ends at the point where you are reading a string of the form "2741#8785#3922#5805#" with readString(). The actual data file posted above is 8000 characters longs. Are you sure it can be read with a single readString() call? I rather guess it exceeds the maximal string size.

Btw., you still didn't answer about the used processor and software enviroment. We can guess that it's Arduino IDE, but which processor target?
I am using Arduino Mega2560 and Arduino IDE. How to know maximum string range?
 

How to know maximum string range?
Good luck to find the number in Arduino help! But whatever it is, the maximum size of string variables (in contrast to string literals) can't be more than a certain part of the total 2560 SRAM size of 8k. Respectively it's just a bad idea to read the whole file into a string. Better read ID entries one by one, using appropriate file and string handling methods.
 

Hi,

I opened the ATMega2560 datasheet. (The same could you do) First page, 11th line of FEATURES says: "– 8Kbytes Internal SRAM".
You see: No need to read the complete datasheet. You really need to learn to find out such basic stuff on your own.

So it is impossible to use this complete 8kBytes for reading 8kBytes of data into a string variable.
Other variables will use RAM, too. Processing some code algorithm will use RAM and some kind of ARDUINO overhead will use RAM, too.

How much exactly you can use for the string - maybe nobody here can answer.
Maybe there is some fixed limit by the ARDUINO IDE (Compiler) or it is limited by the other used variables, maybe dynamically allocated.

Maybe there is a function (runtime) to give back the string size. (like: sizeof() )

Klaus
 

Hi,
sometimes I think he´s using Arduino, sometimes not.
I´m confused.

No clear error description. I like to help - but it is impossible this way.

Klaus
No error occur in program but it is reading from SD card only first time execute second time it is not working
--- Updated ---

Hi,

I opened the ATMega2560 datasheet. (The same could you do) First page, 11th line of FEATURES says: "– 8Kbytes Internal SRAM".
You see: No need to read the complete datasheet. You really need to learn to find out such basic stuff on your own.

So it is impossible to use this complete 8kBytes for reading 8kBytes of data into a string variable.
Other variables will use RAM, too. Processing some code algorithm will use RAM and some kind of ARDUINO overhead will use RAM, too.

How much exactly you can use for the string - maybe nobody here can answer.
Maybe there is some fixed limit by the ARDUINO IDE (Compiler) or it is limited by the other used variables, maybe dynamically allocated.

Maybe there is a function (runtime) to give back the string size. (like: sizeof() )

Klaus
Thank you for information, you said you like to help but please let me know how I define you please and what information you need I will provide.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top