## Embedded hardware design

A bootloader reads the operating system or application from nonvolatile memory or over a network interface and places it into memory so that it may be run by a processor. Processors manipulate data using a sequence of instructions known as opcodes or machine code. Von Neumann machines follow sequential instructions as opposed to biological and quantum computers or neural networks. Von Neumann machines do not distinguish between data and instructions. The Harvard architecture defines separate address space for instructions and data.

Instructions and data are transferred as electrical signals over buses. There are three types of buses; address, data, and control. The address bus specifies an address in memory and external circuitry determines on which device that address exists through a process known as address decoding. The control bus specifies the state of the current access (e.g. write, read, valid address).

### Processor

A processor may abstractly take 6 actions:

• Write data to memory
• Write data to an I/O device
• Read data form an I/O device
• Manipulate data within the processor

Data and instructions are stored in the processor using registers. That data is manipulated using basic operations (e.g. -, +, NOT, AND, OR, XOR) using the Arithmetic Logic Unit.

A series of instructions may be temporarily stopped by an interrupt, which prevents polling I/O devices and prioritizing tasks. When an interrupt occurs the current state is pushed onto the stack (or shadow registers) and the processor loads a interrupt service routine, which is then executed.

## Arduino and Raspberry Pi

I have gathered a small collection of electronics that grew from taking a few classes at the Artisan's Asylum and a failed project.

I have a few high-stability carbon resistors, which are made from carbon film, that appear to be between 1/20W and 1/3W.

# of resistors Resistance value (ohms) Tolerance (%) Bands
7 330 5 orange, orange, brown, gold
5 10,000 5 brown, black, orange, gold
5 560 5 green, blue, brown gold
1 576,000 1 green, violet, blue, orange, brown

I also have 3 10 kilohm potentiometers.

My first goal was to blink an LED, which meant I first needed to install the arduino package on my Debian desktop:

$aptitude install arduino I was then able to launch the Arduino IDE, which prompted me to add my user to the dialout user group: $ sudo usermod -a -G dialout user

I then pasted the example code to blink an LED into the IDE. Before running the code I connected one of the digital PWM pins on the Arduino as well as a connection to ground to a bread board. I then attached the shorter lead of the LED to ground and the other to a 330 ohm resistor, which completed the circuit.

I've created a repo for circuit related code on GitHub (see github.com/pamolloy/circuit).

## Ohm's Law

Ohm's law states that, given a material that conducts electricity, the current at any two points is proportional to the resistance between those points. That relationship is described by the following equation:

$$I=\frac{V}{R}$$

Variable Definition Units
$V$ The difference in voltage between the two ends of the conductor Volts
$R$ The resistance of the conductor Ohms
$I$ The current running through the conductor Amps

The equation can be more easily understood using the hydraulic analogy.

Based upon the Lumped Matter Discipline (LMD) in electrical engineering one assumes that the current going into and coming out of the conductor are equal. A related assumption is made about the voltage. The sum of the voltage across a circuit is zero. For example, the values here might include the voltage change between either end of a battery or a resistor.

Power delivered by a battery is calculated by the product of the voltage and the current and measured in watts: $p = VI$. The amount of energy delivered is a function of time: $w = pT$, where $T$ is time measured in seconds and $w$ is the number of joules or watt-seconds. Voltage can be increased proportionally by connecting batteries in series. To increase the capacity without increasing the voltage at the terminals, batteries can be connected in parallel. When batteries are connected in parallel each battery must have nearly identical voltage. In contrast for a series of batteries the nominal current capacity must be nearly the same for all batteries.

## Resources

I recently purchased a copy of R. H. Warring's Electronic Components Handbook for Circuit Designers from the Brookline Booksmith.