11 ms·
Great form-factor to easily re-use existing battery enclosure, but I have been wondering lately about the long-term future of arduino. With the low price of so
by pedalpete 11y ago
Great form-factor to easily re-use existing battery enclosure, but I have been wondering lately about the long-term future of arduino.
With the low price of something like the Pi Zero which is running a full version of linux, or something like the Esp8266 which can run many different languages, you're basically paying shipping costs. What benefit does arduino have in this future, other than a large existing network, which I understand can't be overlooked as a strength.
- simcop2387 11y agoPi Zero will never directly replace something like the arduino. Running linux (or any OS) can be a huge liability when you need to talk to some other bit of hardware that has strict timing requirements. That said, things like the ESP8266 and Arm Cortex M* processors are definitely becoming far more attractive than the AVRs in the lower end Arduino products (Due and others are also using ARM).
- mschuster91 11y ago> Running linux (or any OS) can be a huge liability when you need to talk to some other bit of hardware that has strict timing requirements. Not just the timing is critical, also the failure causes (and modes) are far bigger in number when running an OS. E.g. if you properly code in C or ASM for a microcontroller and avoid things like recursion, it's very hard to crash due to OOM errors.
- marcosdumay 11y agoTo be fair, a 8MHz (16MHz?) CPU is also a huge liability when you have strict timing requirements. For almost anything, the Pi will probably give you better guarantees by sheer speed... and you can always compile the kernel with a real-time patch. Not saying running on the bare metal is worthless, but an Arduino is a really low end board.
- joshvm 11y agoI think that's confusing liability with speed. Running interrupt-free code on an ARM or AVR is incredibly reliable. I would argue much more reliable than going to the length of patching the kernel. Just because it's slow doesn't mean you can't predict what's going to happen, they're two separate issues.
- Sanddancer 11y agoYes, but even with rt-linux, you've got a jitter of potentially several dozen microseconds, and each interrupt routine will vary. With an AVR, your delay is 4 clock cycles every time, which comes out to .2 microseconds at 20 Mhz. This is the kind of guarantee you can get with being on an intimate level with the chip which you can't get with any OS.
- deleted 11y ago[deleted]
- eru 11y agoAt least not any OS that's not geared for realtime from the ground up.
- tremon 11y agoIt's not just about the OS, it's about the platform (hardware). Even with a fully-optimized RTOS on a standard PC platform, you might run into millisecond-latency due to non-maskable interrupts, cache misses or bus contention (DMA bus-mastering kills any real-time guarantees). That's not even considering the stalls introduced by SMM or TPM instructions.
- jevinskie 11y agoI would think it would be difficult to achieve the low jitter of a simple, fixed # of cycles / instruction, architecture like AVR in a superscalar, cached, speculative architecture like modern X86 CPUs. A hard RTOS is necessary, but perhaps not sufficient with most X86 microarchs. Maybe you can disable some of that dynamic behavior via MSRs but probably not all.
- Unklejoe 11y agoTiming requirements don't necessarily translate to _speed_ requirements. Microcontrollers like the Arduino/Atmel are perfect for situations where you need to guarantee that some signal will be asserted exactly 250 (no more, no less) nanoseconds after some other external event, _no_matter_what_. Since there's usually no OS running on something like an Arduino, you're basically forced to write very deterministic event driven programs. Also, since most (maybe all) instructions on those Atmel microcontrollers execute in a single clock cycle, you can easily dissect your C functions and know exactly how long they will take to execute. I wouldn't trust Linux for such an application even with a "real time" scheduler. Linux as a RTOS certainly has it's place, but it's best left for systems that can actually benefit from the added complexity. For most typical microcontroller projects, the extra features of a full Linux kernel would just get in the way. Note: There's nothing stopping someone from using a RPI in such a way as well (bare metal), but they are really geared for more complex applications, so there isn't as much support in that area. Also, the hardware is probably a little more complex. Therefore, my statements assume we're comparing an Arduino to an RPI running Linux.
- blhack 11y ago>Microcontrollers like the Arduino/Atmel are perfect for situations where you need to guarantee that some signal will be asserted exactly 250 (no more, no less) nanoseconds after some other external event, _no_matter_what_. What is an example of something like that?
- viraptor 11y agoSampling from external sensors for example. If you're measuring something changing over time, you may need very precise timing.
- quanticle 11y agoMusic, for example. If you're doing audio processing for music, it's much more preferable to have something that takes 20ms consistently to transform an input than something that takes 5ms 90% of the time and 50ms 10% of the time (due to, e.g. interrupts). That 50ms gap will show up as a note that's audibly behind the beat, while the improvement from 20ms to 5ms isn't really that beneficial. EDIT: another example is controlling a UAV. You can design around a system that consistently takes 20ms to process an input (e.g. by limiting the max speed). It's a lot more difficult to design around a component that takes 5ms most of the time, but will randomly take 50ms here and there, because you don't get to control when those lag spikes happen.
- winter_blue 11y agoCouldn't you write a really simple kernel[1] or bootstrapping program, and effectively run your program without an OS? Does an architecture (ARM / AVR / x86) limit the possibility of writing real-time code if the code is the OS, and just runs on the bare metal? Your program would run in ring 0, be the only "process" and have full access to RAM. You decide whether you want to handle interrupts or not. (I assume there's a way to select what interrupts you want to handle.) [1] For e.g., this tutorial explains how to write a basic x86 kernel: http://www.jamesmolloy.co.uk/tutorial_html/ http://www.jamesmolloy.co.uk/tutorial_html/
- mnw21cam 11y agoThere's no such thing as bare metal any more. https://en.wikipedia.org/wiki/System_Management_Mode https://en.wikipedia.org/wiki/System_Management_Mode - the CPU itself may at times spend some time doing "other things" such as changing the spin speed of the cooling fans, or interpreting the signals from the USB keyboard. The OS (running in ring 0) has no control over this - the CPU effectively just pauses for a little bit every now and again.
- pjc50 11y agoI'm not aware of any ARM systems that have this yet.
- jevinskie 11y agoTrustZone. It is "one level deeper" just like any other hypervisor or monitor. As far as I know, it is quite common in Android phones for HSM and DRM purposes. Yay? =\ http://www.arm.com/products/processors/technologies/trustzone/ http://www.arm.com/products/processors/technologies/trustzon... Edit: And, of course, it is probably exploitable in some way. See http://bits-please.blogspot.com/2015/08/exploring-qualcomms-trustzone.html http://bits-please.blogspot.com/2015/08/exploring-qualcomms-...
- sklogic 11y agoCan you bit-bang a 640x480 VGA on a Pi? No. Not even in bare metal, no OS. But a lowly attony85 can do it easily.
- hatsunearu 11y agoGenerally there is a trade-off between latency and throughput. Embedded Linux is generally geared towards more throughput than latency. Microcontrollers have less throughput-oriented features (threads, for instance), which makes them very well suited for latency-critical real time stuff.
- rorosaurus 11y agoFor what it's worth, you can code bare metal on the Raspberry Pi as well. It just doesn't have the community and support that Arduino currently has. https://github.com/dwelch67/raspberrypi https://github.com/dwelch67/raspberrypi
- danellis 11y agoIt also doesn't have the easily available official documentation like you get for a Cortex-M from ST, Atmel, etc.
- onnoonno 11y agoBut you still have a lot less predictability: - DRAM refresh - cache hits/misses
- mnw21cam 11y agoThere are quite a lot of systems out there with real-time requirements, where the system is not running a real-time predictable operating system - instead the likelihood of a missed deadline are averted simply by over-provisioning. You can get away with murder pretty much this way by just making your processor several times faster than is strictly necessary, provided you don't have any really long pauses in processing (like for instance having to swap in a page from disc). It works well enough most of the time for video playback. In essence, a job that requires 90% of the CPU time on predictable hardware can often be solved by just throwing faster hardware at it. If the RasPi can do it using 5% CPU, then it's probably fine. YMMV. Don't do this on medical equipment, space rockets, or self-driving cars.
- tremon 11y agoIn the literature, that's often distinguished as soft real-time vs hard real-time requirements. Hard real-time is for when you absolutely cannot miss a deadline without adverse effects (production stalls, equipment crashes, etc), while soft real-time is for situations where missing a deadline is recoverable (like your example, a video renderer would simply skip the current frame and start processing the next frame).
- tyingq 11y agoNot in the Pi Zero price range, but the AM335x processor inside the BeagleBone Black has an interesting way to deal with the need for strict timing. The AM335x has a pair of "PRU" units on the die, that are roughly little microcontrollers that have access to the main ARM's memory. So, you can write to main memory from Linux, jitter and all, and then let the PRU stream it out to anything that needs high speed, predictable data. This guy put a BB black inside an old MAC SE, and is driving the CRT with the PRU...very cool: http://www.nycresistor.com/2014/02/02/30th-anniversary-mac/ http://www.nycresistor.com/2014/02/02/30th-anniversary-mac/
- lee_s 11y agoThe AM335x PRU is exactly the Cortex-M core that they were talking about :). It just happens to be on-die with the main core. Very cool project, thanks for linking!
- blhack 11y agoYou can buy an arduino for about $2: http://www.aliexpress.com/item/Best-prices-high-quality-UNO-R3-MEGA328P-for-Arduino-UNO-R3-NO-USB-CABLE/32612797755.html?spm=2114.01010208.3.38.5dtgmr&ws_ab_test=searchweb201556_7,searchweb201602_5_10017_10005_10006_10034_10021_507_10022_10020_10018_10019,searchweb201603_7&btsid=e1422a39-d50e-4a5d-b045-8bc3f68448f3 http://www.aliexpress.com/item/Best-prices-high-quality-UNO-...
- ryan-c 11y agoHow can that possibly be that cheap even for just the raw components? The AVR chip alone is > $1 even in large quantity. Counterfeit parts?
- jdietrich 11y agoThe USB->serial chip will definitely be a knockoff, as we saw with FTDIgate. I'm not aware of counterfeit AVRs, but they could well be grey market.
- tzs 11y agoFrom what I've seen, the USB->serial chip on the inexpensive Chinese Arduino compatibles on AliExpress generally is not an FTDI knockoff. They usually seem to use a CH340 or CH341. This does not try to emulate or pretend to be an FTDI. It has a different interface and needs a separate driver. The only problem I've heard of with these is that the drivers are not shipped with some operating systems (such as OS X) and so you might have the hassle of installing a driver. FTDI drivers come with all major operating systems, so one less thing to deal with. I believe I've seen Uno clones on AliExpress that are about twice as expensive as the cheapest clones (so around $6) that use an ATmega16u2 to handle this, which is what a genuine Arduino Uno uses, and so is no more hassle than a real Uno. There are some USB->serial chips that cost more than a CH340 but quite a bit less than an FTDI, and that work with the generic serial communications driver that is built into all major operating systems. I haven't seen any Arduino clones that use these, which is a shame. I'd love not having to rely on any vendor-specific code.
- 11y ago
- petra 11y agoWhat about porting the Arduino code to the esp8266/esp32 ? powerful chip + huge network. Altough as a prototyping platform, i can understand how javascript would be more appealing. And for production, even by startup, the Arduino is far from ideal, mbed is much better.
- askvictor 11y agoIt's already done; you can program the esp8266 using arduino ide.
- jumasheff 11y ago* Look at Espruino (JavaScript) firmware: http://www.espruino.com/EspruinoESP8266 http://www.espruino.com/EspruinoESP8266 * Micropython (a complete Python3 rewrite) is currently being ported to esp8266: https://github.com/micropython/micropython/tree/master/esp8266 https://github.com/micropython/micropython/tree/master/esp82...
- ithkuil 11y agoshameless plug: portable JavaScript+C programming environment for esp8266/esp32/cc3200/RPi https://github.com/cesanta/smart.js https://github.com/cesanta/smart.js. Supports over the air updates (OTA) both and rapid development and updating your device fleet.
- prutschman 11y agoIf I prototype something with an Arduino, I can easily switch to directly sourcing ATmegas and spin my own boards. The Pi Zero is the next thing over from vaporware. I know some people who have a few, but all of the official vendors linked from https://www.raspberrypi.org/products/pi-zero/ https://www.raspberrypi.org/products/pi-zero/ are either out of stock, or have "limit one per household." I'd been having trouble figuring out where to source the BCM 2835 SoC that powers the Zero, and there's (allegedly) a reason for that: https://olimex.wordpress.com/2014/08/28/who-fears-from-the-competition-rpi-foundation-pressed-broadcom-to-stop-selling-bcm2835-to-competing-projects/ https://olimex.wordpress.com/2014/08/28/who-fears-from-the-c...
- software_radio 11y agoI have a pile of them here. It's not vaporware.
- sklogic 11y agoCan you build one? Can you even source a Broadcom SoC? While Arduino-compatible MCUs can be trivially dropped into your own PCB designs. Some can even run dead-bugged with little to no effort, due to a much higher degree of integration.
- prutschman 11y agoCongratulations on being a person of the sort I mentioned, who managed to get a few of them. If I build one into a product can I buy 100 of them? 1000 of them? Can I source the SoC to make my own board based on the design?
- pauly 11y agoafter the initial batch all manufacturing resource was supposedly moved to the pi 3 so they're still tricky to come by. I'm sure they'll be back though. There's an interview in https://www.raspberrypi.org/magpi/issues/43/ https://www.raspberrypi.org/magpi/issues/43/ that explains this I think. I have one pi zero and (like 99% of raspberry pis - or is it raspberries pi? - in the wild) I have not done anything useful with it yet.
- tzs 11y agoPi Zero consumes about 80 mA when idle. An Arduino Pro Mini can do an order of magnitude better, and that's without getting fancy with sleep modes and a watchdog timer. For things where most of the time is idle, and so you can have the Arduino spend most of its time in a very low power mode and just wake up when it is time to read a sensor or adjust a control or something like that, you can do something like on average three orders of magnitude better than the Pi Zero. (Four orders of magnitude if you do a little hardware hacking on the Arduino). That's the difference between having to change a couple AA batteries every day or two (Pi Zero) and running for a year off of a coin cell (Arduino). Here's an article on power consumption of an Arduino Pro Mini: http://www.home-automation-community.com/arduino-low-power-how-to-run-atmega328p-for-a-year-on-coin-cell-battery/ http://www.home-automation-community.com/arduino-low-power-h... Here's one on Pi Zero power consumption: http://www.jeffgeerling.com/blogs/jeff-geerling/raspberry-pi-zero-power http://www.jeffgeerling.com/blogs/jeff-geerling/raspberry-pi...
- ant6n 11y agoI wonder whether it would be possible to create a tablet/laptop with an e-ink display, where the processing switches between a low-powered ARM and something like an Arduino. When the Arduino is used, the ARM would be turned completely off.
- striking 11y agoThat's the thinking behind the big.LITTLE concept, and it's in use today. It's nice because in addition to power savings, it doesn't take up as much of the PCB as an ARM+Arduino combo would.
- masklinn 11y ago> I wonder whether it would be possible to create a tablet/laptop with an e-ink display, where the processing switches between a low-powered ARM and something like an Arduino. You'd have to deal with different architectures and a lot of headaches, but it's the idea behind ARM's big.LITTLE, where you pair high-perf high-power and low-perf low-power cores. So your tablet's SoC might have a ~200mW A53 for mostly-idle use with a ~1W A72 for more active "high-performance" work loads. And the only additional hardware is the additional cores and the interconnect, the SoC is shared between "low-perf" and "high-perf" cores, which probably wouldn't be the case for an arduino/arm mix.
- StavrosK 11y agoEveryone focuses on the Pi Zero, but yeah, I agree with you. Ever since I discovered the ESP, my Arduinos have been gathering dust.
- ant6n 11y agoAfter some Googling, you probably mean this: https://en.wikipedia.org/wiki/ESP8266 https://en.wikipedia.org/wiki/ESP8266?
- ssalazar 11y agoIn addition to what others have said, Arduino has 8 built-in ADCs, which are essential for some physical computing applications. Pi (Zero or otherwise) has no built-in analog input capabilities.
- blt 11y agoI think there will always be applications where an OS is not needed, but 32-bit micros with floating point like the STM32-F4 (~168 MHz ARM) can do a lot of cool stuff that's impossible with Arduinos. Nontrivial robot state estimation and control, for example.
- lallysingh 11y agoI'm surprised we're not seeing RPI unikernels yet.
- dahart 11y agoFor me, the Arduino's appeal and value is in not having an operating system, and just how directly you are dealing with the hardware. Your C code is the only thing running, and it talks directly to the pins. It's crazy easy to get started, it has a ton of potential for cool projects, but is so limited that your projects are manageable and you're forced to be creative. You only get a few K, so you get to be clever and kludgy and do whatever it takes as fast as you can make it. I really like that bigger better tiny hobby computers are being developed, but the things you mentioned - running Linux & many different languages - don't appeal to me the same way Arduino does. Adding modern day benefits like tons of memory or 3D display means I'll be just programming, like I would at my day job developing console games. With the Arduino, on the other hand, I'm always hacking.
- hatsunearu 11y agoPi Zero has abysmal real time capabilities. And things like the Beaglebone Black have better real time capabilities but as someone who has worked with BBB for over a year now, it is so horrible to develop for I almost cried. Embedded Linux is pretty bad for hacking, but it's pretty good for industrial controllers and other "solved" problems. Microcontrollers are still the way to go.