[DIYbio] Micropython vs C++ for microcontrollers

I don't wish to hijack this thread, so I changed the subject line.

John didn't say why he preferred micropython to C++ (which he called "the arduino language"). But the compactness and speed of C++ code over an interpreted subset of Python gives it a substantial advantage on small processors, where both CPU execution speed and memory space are both limited.

C++ is a very rich and expressive language, and perhaps 95% of all microcontroller development is done in either C++ or the subset of it that is C.

With Arduino clones going for $1.42 with free shipping, there is also a cost benefit to using the Arduino platform.

John alludes to "easy programmability" as a problem with "50 cent microcontrollers".
It takes a few seconds to download a program into an Arduino Pro Mini using a $2 FTDI board. If that is too hard, you can simply plug a $1.83 Arduino Nano into a USB cable and program it in the same amount of time, at the cost of reduced battery life due to the onboard FTDI chip in the Nano. You can also do your development on the Nano, and run your production code on the Pro Mini since they use the same processor.

Micropython is a wonderful little language, and even though the cheapest board I could find was at $2.71 almost twice the cost of the Arduino, that is still peanuts, and the board you get has a 32-bit processor, WiFi, lots more processor speed and lots more memory. With the extra speed and memory, micropython is much less crippling, but at the cost of the loss of real-time processing (since WiFi needs to take control of the board often to look for packets coming in and to advertise itself).

But if the code was written in C++ (which is what the OS on that board is programmed in, and which the board supports using the same Arduino IDE as the Nano and Pro Mini), it would run up to 100 times faster and take up less memory, allowing you room for larger programs, or more data. And your code doesn't stop to garbage collect memory every once in a while, hampering real-time processing.


-----
Get a free science project every week! "http://scitoys.com/newsletter.html"



On Wed, Mar 13, 2019 at 9:23 AM John Griessen <john@industromatic.com> wrote:
On 3/13/19 10:59 AM, S James Parsons Jr wrote:
> Each bench tool node currently works off an Arduino Uno clone cost about $3. 

I prefer micropython over arduino language.
Some tools are so simple they can be done with 50 cent microcontrollers, but that lacks
easy reprogrammability.

Would your boards get cheaper with bulk orders?

Sure, that's how the world works.  Also, you can reduce the specs.  For instance, my controllers
have a USB power converter on board, and a battery monitor and battery for portability -- all that
can be left off.  The MCUs for running micropython cost around $2.50 in 100's, so they
might not work out for the simplest tools unless you like the easy reprogrammability.

> My number one priority is, "how can I make this affordable"!

With that as the one true top priority, you need to be sure how large your number of customers is,
and ditch easy reprogrammability, because that always costs more.

It's normal how these decisions are not black/white, but grey areas.
I think keeping easy reprogrammability available is part of a system's appeal more than
$1 less cost per node.

--
-- You received this message because you are subscribed to the Google Groups DIYbio group. To post to this group, send email to diybio@googlegroups.com. To unsubscribe from this group, send email to diybio+unsubscribe@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/diybio?hl=en
Learn more at www.diybio.org
---
You received this message because you are subscribed to the Google Groups "DIYbio" group.
To unsubscribe from this group and stop receiving emails from it, send an email to diybio+unsubscribe@googlegroups.com.
To post to this group, send email to diybio@googlegroups.com.
Visit this group at https://groups.google.com/group/diybio.
To view this discussion on the web visit https://groups.google.com/d/msgid/diybio/65c84d7a-7d6d-d7bd-c4a0-e320808b6ee8%40industromatic.com.
For more options, visit https://groups.google.com/d/optout.

--
-- You received this message because you are subscribed to the Google Groups DIYbio group. To post to this group, send email to diybio@googlegroups.com. To unsubscribe from this group, send email to diybio+unsubscribe@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/diybio?hl=en
Learn more at www.diybio.org
---
You received this message because you are subscribed to the Google Groups "DIYbio" group.
To unsubscribe from this group and stop receiving emails from it, send an email to diybio+unsubscribe@googlegroups.com.
To post to this group, send email to diybio@googlegroups.com.
Visit this group at https://groups.google.com/group/diybio.
To view this discussion on the web visit https://groups.google.com/d/msgid/diybio/CAA0yOM78Q%2BS2RmwbPRy2ub5AMj-WoQr6nT%3DieDZEF%3DT0iiPu3A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

0 comments:

Post a Comment