Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

ATmega micro-controllers also have great community support and documentation because of their use in Arduinos. If I was relying on an electronic device to protect my health I'd trust a simple 8-bit device more than something as complex as a Raspberry Pi.


If I was relying on an electronic device to protect my health Iā€˜d trust my garbage collected code on a 64 bit ARM CPU using real CPU timers way more than my own ability to not segfault or OOM myself to death (literally) with low-level embedded C code.

YMMV.


Segfaulting and OOM on MCU's is far more rare than on a device with an entire operating system on top.

In most cases, MCU IDE's like the classic Arduino one don't even give you an allocator, all data must be statically allocated beforehand.

IIRC it doesn't use the stack either. The main() and loop() functions initialize all their variables statically.

When you have 2KB of memory to share between code, data and stack, allocating and using stack for function calls is luxury that only introduces problems.

Hence, I've never ever ever seen an MCU crash from segfaults or OOMs.

On the plus side they will also use vastly less energy. 10 Milliamps is enough to drive a ESP8266 or ESP32, in deep sleep you start counting microamps. A single battery cell can easily last a month.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: