Boswell at the Zoo

Looking at my Arduino

An Arduino Board is a "single-board microcontroller" - it's a small, simple computer, made cheap and open source. Hopefully this examination will be close to just looking at a computer, but it seems useful to focus on a particular instance of "computer", and so I chose one that at it's core is not modular, and again, is intentionally simple - I'll specifically be referring to the Arduino Mega 2560.

At the core of all computers is a microcontroller - the "single-board microcontroller" description of an Arduino board is not technically correct - the board has lots of components, one of those being the processor. The definitions of computer, processor, microcontroller etc are all quite fuzzy, though - depending on the level of abstraction being used, a laptop could be refered to as anything from the usual 1 computer, to hundreds, maybe more, stacked in a henchcoat, if you want to atomize each piece of hardware and get annoying... but, the ATmega2560 is the name of the microcontroller that this board uses.

While I am criminally simplifying the systems in place, the interfacing with the ports and pins actually does not seem that far off this level of communication - the brilliant design of the Arduino as a modable computer, asking to be played with have payed off. The Arduino board is truly beautiful

So, to summarize: the ATmega2560 hosts the CPU, the RAM and the Flash memory. The highly choreographed interplay between these three is far and away the important part of the computer. Any external data, be it from the input/ output pins, or a less common mode of interaction - USB, wifi, ethernet, each rely on the CPU interpreting their data in order for it to be meaningful to The User, and so between, eg, the pin and the CPU is a protocol designed to make sure that the information being fed to the CPU is done so at a rate that cannot jeopardize any of the countless other vital operations it may be performing, in a manner that accommodates this tension and the ATmega2560's single core.\

The crystal oscillator is what the CPU leans on to keep a time. I always figured that each component on a board that sends or receives information is getting a signal from this timing mechanism, but in fact the oscillator communicates strictly with the microcontroller, although it's signal reaches every component internal to the ATmega2560, whether directly or indirectly. That agreement on a standard time is needed for high quality communication is relativley intuitive, and so, in 1929, using similar ideas to today, the US National Bureau of Standards and Technology (NIST) actually maintained some huge, 100 kHZ crystal oscillators (if you can't see the image, it's 4 elaborate setups, each of some large bell like instruments encased in a temperature controlled oven). These timings would be broadcast for radio stations needing a reference for their own frequencies or scientists attempting to calibrate a tool/ measure a frequency. Now, I can go out and buy a 16Mhz clock, the same as on this board, which is 160x faster, has an accuracy 10% as large as its senior (accuracy is measured in ppm! which I will explain..), is almost incomparably smaller, is far less picky with inputs concerning power and temperature, and costs you like a dollar. Just what 100 years of economic forces can do!
How the crystal oscillator actually works relies, on the properties of a crystal. If an object is vibrating, be it a guitar string being played, a leaf swaying in the wind, or a human bobbing in the ocean, the object has a 'natural frequency', which is pretty much how frequent that object will oscillate - a beach ball bobbing with the waves will bob accoring to the waves - assume constant waves and the bobbing will be the natural frequency of the beach ball in that exact system -- if i come and push the ball under, it will bob up quickly, then down, up etc, but would eventually return to this natural frequency if left alone. It's not like an object has an inherent natural frequency, it's a product of the environment causing the vibrating - that crystals have a natural frequency is not unique, however the way in which they vibrate when excited by energy is - the natural frequency is much more consistent that other materials, and so can be polled more accurately. The oscillator will store this crystal in a hermetic (air-tight) container - the system then applies a small voltage to the crystal, which it partly absorbs, causing it to vibrate at a frequency very close to its natural frequency (because the voltage is so small), and the rest is sent back, which the system amplifies and send back. So the loop is made, and each repetition is easily measurable. Just squint a bit and accept that the cut of the crystal can predictably effect its natural frequency if the system it will exist in is known, and then squint some more, or just uncritically accept that this process has been engineered such that the crystal will oscillate 10s of millions of times a second, in a measurable and remarkably predictable manner.