4 ms·
> between the Arduino,RPi,etc. and your vanilla laptop or PC RPi is closer to a vanilla laptop/PC than it is to an Arduino. Arduino describes an ecosystem of
by paulannesley 11y ago
> between the Arduino,RPi,etc. and your vanilla laptop or PC
RPi is closer to a vanilla laptop/PC than it is to an Arduino.
Arduino describes an ecosystem of microcontrollers, traditionally 8-bit AVR and more recently 32-bit ARM. Microcontrollers are designed specifically (physically, instruction set, cost) to control low-level digital and analog IO, and not to run a general Operating System.
Raspberry Pi etc are general purpose computers. They only differ from your general laptop etc in form factor, and that they're built around a System on a Chip (SoC) rather than discrete CPU and peripherals. In that regard it's much like your cell phone, tablet, Chromebook and other budget laptop/desktop computers. But general computers are moving in that direction too — on-chip graphics, ethernet etc. Because RPi targets education and hobbyists, its form factor exposes some general purpose IO (GPIO) pins, much like a general computer parallel port might.
As far as I know, Raspberry Pi doesn't have ADC on-board, but you can wire an external one into its digital GPIO/SPI pins. You could also plug a USB or serial port ADC into your laptop, or your RPi.
With regard to “physical computing”, there's generally a real-time requirement, which cannot be achieved with a multi-tasking OS. Microcontrollers generally run at less then 100 MHz (often 8 or 16 MHz), but because of their instruction set design, timer and interrupt systems, and lack of multitasking, they can reliably and rapidly sample inputs or trigger outputs. A 48 MHz microcontroller could perhaps come close to 1 MHz sample rate.
SoC devices and general purpose computers are designed to run a multi-tasking OS at GHz speed with heaps of RAM. But despite that, this example shows an inability to reliably control I/O at more than 100 KHz when running a general (multitasking) OS. IO tasks that do require real-time characteristics (USB, ethernet, etc) are delegated to separate controller chips.
It's possible to write “bare-metal” code to run directly on a Raspberry Pi (or any computer) without an operating system which brings it closer to behaving like a microcontroller, but the instruction set isn't optimized for this, nor are the compilers/toolchains, and nor is the I/O and on-chip peripherals of the SoC.
Hope that meandering ramble helps.