TinyCircuits Forum

TinyCircuits Products => TinyDuino Processors & TinyShields => Topic started by: MagnusRunesson on December 26, 2015, 09:45:11 AM

Title: TinyArcade and memory usage
Post by: MagnusRunesson on December 26, 2015, 09:45:11 AM
Hi everyone!

First of all, I'm super excited about the TinyArcade! I ordered the 3 DIY kits and is eagerly awaiting their arrival. :)

I'm preparing some games for it and have a few questions, but I figured I should start one thread per question to keep it simply, I hope that is ok!

So first of, memory on the TinyArcade.

If TinyArcade is based on Arduino Zero, and the Arduino Zero have 256 KB FLASH and 32 KB SRAM, will the TinyArcade also have 256 KB flash and 32 KB SRAM? Will the code execute from FLASH or does the executable AND runtime data need to exist in the 32 KB SRAM?

Also, is there a memory handler for the 32 KB SRAM?

Cheers!
Title: Re: TinyArcade and memory usage
Post by: Ben Rose on December 28, 2015, 08:18:47 PM
Hi Magnus,

Keeping topics separate is fine-

Correct- the TinyScreen+ board inside the arcade cabinet has the same processor as the Zero with 256KB FLASH and 32KB RAM.

Code executes from FLASH by default, so the 32KB SRAM is free.

Memory handler? At software level, everything is C++, so the answer might depend on what programming background you have :)
Title: Re: TinyArcade and memory usage
Post by: MagnusRunesson on December 29, 2015, 05:05:18 PM
Oh ok, so I can use everything that comes with standard C/C++ like malloc/free and new/delete? Are the libraries pre built as library files for each platform or do they come as c/cpp files that are compiled for the proper platform at build time?

I've been programming c and c++ for 15+ years but I'm new to Arduino and still a bit confused as to what the Arduino app can and cannot do.

It seems like my .ino file is basically renamed to .cpp and built with a template program that contain a C entry point with a main loop that call the loop function in my ino file, but I don't have my computer around so I can't verify that.
Title: Re: TinyArcade and memory usage
Post by: Ben Rose on December 30, 2015, 09:18:46 PM
Knowing that, I can answer a bit better. Arduino's 'programming language' is C++ with a few layers of libraries to make it look pretty. I believe new/delete may not be implemented, but malloc/free are available(although often avoided since most Arduino platforms have so little RAM). There is in fact a main.cpp hidden away that calls setup and loop. The .ino is pre-processed(function declarations are added in) and everything is compiled(all libraries have source code). If you check the Arduino github account, all the source/build files are available but not necessarily presented in an obvious way.
Title: Re: TinyArcade and memory usage
Post by: MagnusRunesson on January 03, 2016, 10:27:05 AM
Cool, thanks for clearing that up!

Looking through the source for Arduino has been very useful. I've been curious how functions like millis and micros was implemented.
Title: Re: TinyArcade and memory usage
Post by: MagnusRunesson on January 05, 2016, 02:28:09 AM
Another question regarding memory on the TinyArcade. Out of the 256KB flash memory, how much will be available to the app? Is any flash memory (or SRAM) reserved for your game loading code or any other kind of boot loader?