How do you beat square wheels for going up and down stairs?
So to recap, this will not work then.
But would it work with a Nicla Sense ME?
Or another one like it?
Thanks everyone for your help!
Have you not been paying attention?
In summery no it will not work unless you attempt to re engineer the boot loader code and override the normal operation of the ARM based processor.
To summarise the summery.
If you have to ask, then you can't do it.
@Grumpy_Mike
I mean do those have enough memory to store WAY more code than a Mega2560 ![]()
![]()
I don't even need a SD card if another board would work, obviously
It is very difficult to do a direct comparison because they get compiled into different machine codes, with different efficiency, to a greater or lesser extent depending on the compiler.
It also depends on how you write code, as to how effective or rambling it is.
But for only a first rough approximation look at the different amounts of flash memory in each alternative.
@Grumpy_Mike
Thanks mate, will do!
As Grumpy_Mike says, you don't know. You can easily test by installing the board package for a board of interest and compile your sketch for that board.
Below are some results for blink on different boards.
Classic Nano
Sketch uses 924 bytes (3%) of program storage space. Maximum is 30720 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.
Nano Every
Sketch uses 1118 bytes (2%) of program storage space. Maximum is 49152 bytes.
Global variables use 22 bytes (0%) of dynamic memory, leaving 6122 bytes for local variables. Maximum is 6144 bytes.
MKR Zero
Sketch uses 10996 bytes (4%) of program storage space. Maximum is 262144 bytes.
Global variables use 1992 bytes (6%) of dynamic memory, leaving 30776 bytes for local variables. Maximum is 32768 bytes.
Due
Sketch uses 10684 bytes (2%) of program storage space. Maximum is 524288 bytes.
No report on dynamic memory
M0
Sketch uses 11484 bytes (4%) of program storage space. Maximum is 262144 bytes.
Global variables use 2188 bytes (6%) of dynamic memory, leaving 30580 bytes for local variables. Maximum is 32768 bytes.
Oh shocker, the last 3 use around 200x as much RAM (dynamic memory) as the classic Nano. Don't let this discourage you to run the test, your results can be far better due to the way linkers work.
Note:
- I only have the classic Nano; the other boards are installed to be able to help users on the forum. I did not update any of the packages before i ran the test so there might be little variations in the results if you run the test.
The current code I'm running which is 19% of program storage space, and 21% of dynamic memory, does not fit on ANY other boards except the Mega ADK.
It won't even compile for a Raspberry Pi at all - gives me heaps of errors.
Bill Roy's bitlash was mentioned earlier. It can exist in SRAM and interpret BASIC scripts on the SD-card. It will not be overly fast in performance, but you can easily create a bunch of code 'overlay'ish kind of subprograms.
Adafruit's CircuitPython runs natively currently on 6 official Arduino hardware platforms, just not clasic AVR-based h/w.
Downloads (circuitpython.org)
Personally I would suggest, if you are really interested in OS-ish behavior on a Mega2560, then start with a known-clean task-switcher as a core and build out the rest:
Setting Up FreeRTOS on Arduino - Tutorials (exploreembedded.com)
For inspiration:
Linus-Torvalds - Google Search
@mrburnette
Is circuit python c++? That's the only language I can understand.
What is freeRTOS? Does it work on SD cards?
It is written in C, but is its OWN complete language... well (very) well documented with volumes of reference materials.
PS: it will change your way of thinking about software problem solving.
Research FreeRTOS... I did provide a link.
Is it able to be used on the normal arduino boards?
I've tried it out - how do I use that for my own tasks?
Like provides the 6 supported real Arduinos.
Were I trying to understand a fundamental knowledge component of any OS I would read the documentation.
Building software to implement a "command" is child-play:
This does not an OS make... still, I once thought it clever.
Not the normal ones though
OMG ...
Sorry, but obviously you are not being serious ![]()
I really try and take inquiries in this forum seriously, giving Ops (young & old) the benefit of asking questions without the knowledge old farts like myself have struggled to acquire by virtue of years in the industry (@72, many years.) Please do your homework and do not disappoint with such lame terminology as "normal..."
Am I able to use the AVR boards - ie a mega?
By normal I mean AVR boards.
You can write functions that run as tasks.
If you can write a sketch to do one thing with delay() or other blocking code,
I can show you how to convert it to run "in parallel" with other tasks (converted delay code) so smoothly you can run motors and sensors in coordinated fashion.
32K flash is a lot of code&data space for an 8 bit machine. But filling 256K?
Until you know basic C through pointers and bit-logic, any big or hard projects you do will waste your time compared to doing small projects.
