Hypothetical extra memory.

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
BTK7
 
Posts: 13
Joined: Sat May 16, 2015 10:44 am

Hypothetical extra memory.

Post by BTK7 »

I am pretty new to Arduino, and I guess C (as in programming with C). I own an Arduino Uno R3. I recently (3 days ago) received it in the mail along with 2 TFT LCDs (breakout). One with touch screen and one without.

I have a background of taking 3 programming courses in college, and one of tinkering with scrapped computer parts in my basement. I am familiar with C++ and am strong in Java.

Just coming off of my second Java course, I am high on database usage.

Example of my capabilities:
I currently have made a Photo sensor display the amount of resistance it is producing (I think that's the number it produces at least, don't take my word for it) to a TFT LCD screen.

Question:
My question refers to the microSD card that can be equiped to the TFT screens.

Can you, hypothetically, execute code stored on a microSD card? Or even, perhaps, read a text file from the microSD card?

I guess my question is, can the microSD card become an extension to the Arduino memory capability.

Thanks for any help!
BTK7

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Hypothetical extra memory.

Post by adafruit_support_bill »

You can read and write text or other data to the SD card. You won't be able to execute code from it on an UNO - unless you write your own loader for it. The Atmega 328 processor on the UNO uses the Harvard Architecture which separates program and data memory. On the UNO, the program memory is protected in normal operation and you can't write to it.

For more information about memory on the UNO, see this guide: https://learn.adafruit.com/memories-of- ... chitecture

User avatar
BTK7
 
Posts: 13
Joined: Sat May 16, 2015 10:44 am

Re: Hypothetical extra memory.

Post by BTK7 »

Thanks! I'll check it out when I get home from work.

User avatar
rotopenguin
 
Posts: 1
Joined: Sat May 16, 2015 5:20 pm

Re: Hypothetical extra memory.

Post by rotopenguin »

The best an AVR is going to be able to do for "executing" from external storage would be to make up some kind of bytecode interpreter, burn it into flash, and have the MCU pitter-patter through the bytecode stream. It'd be murder on speed of course, but that is roughly what the dozens of BASICfoo chips do all the time. Doesn't look like anybody's done much that way in open-source, apparently creating a BASICfoo firmware isn't half as fun as selling $50 chips to the education market.

The real answer is that when you start having these thoughts, it's time to bump up to a new chip. I'm getting into the 8266, which starts with .5MB of external flash and should run from SD (but no board does that yet?). It does NOT provide the timing guarantees of an AVR since your code is generally interruptible by WiFi work, but it is still an amazing level of power from such a cheap chip. The C.H.I.P. Kickstarter shows that Pi levels of power are shrinking down into the space, too.

User avatar
BTK7
 
Posts: 13
Joined: Sat May 16, 2015 10:44 am

Re: Hypothetical extra memory.

Post by BTK7 »

So I only understood about half of all that, but I'll chalk that up to me being a n00b. My next question, after reading a bit about it, is if there is a tutorial on how to read and write from the SD card in the TFT display. I have seen the examples of how to get bitmapped images off of it, but haven't seen much in the department of using that port for its card alone. I would be using this SD card (in my new situation in my mind) to take inventory for some hypothetical items, and if an item was removed, it would remove an entry from the SD card's "Database". I'm assuming I will be writing much of this code, and quite possibly doing the information maneuvering from a text file, but I still need the basic "Read and write".

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Hypothetical extra memory.

Post by adafruit_support_bill »

haven't seen much in the department of using that port for its card alone.
It is just like any of the other SD card interfaces. There is nothing TFT specific about it.
https://learn.adafruit.com/adafruit-mic ... d-tutorial
https://learn.adafruit.com/adafruit-dat ... me-clock-1

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”