Notes on electronics (learning some basics)

Sparkfun.com provides some useful info for an electronic newbie such
as myself.  I've seen some of this while I was a high school student, but
electronics wasn't the main path, so I barely remember about it.

These notions are just interesting for hardware hacking, but they
might also be helpful for work!

As usual, these notes are not meant to be a summary of the pages I'm
referencing: please read the full pages! :)


https://learn.sparkfun.com/tutorials/logic-levels

Digital ommunication translates voltages into binary values.  The
voltage on a communication line is interpreted according to ranges:

V_oh = Output High, min voltage expressing high
V_ol = Output Low, max voltage expressing low
V_ih = Input High, min voltage read as high
V_il = Input Low, max voltage read as low
Undefined behaviour "floating" in the "noise margin"

The ranges could be around 5V or 3.3V.  The latter takes less energy.
3.3V is somewhat 'backward compatible' to 5V: components are able to
generate a signal that is recognized by a 5V component.  The opposite
holds only if the 3.3V component is 5V tolerant.


https://learn.sparkfun.com/tutorials/serial-communication

Saying "serial protocol" usually implies using asyncrhonous serial
communication.

To cope with the lack of shared clock:
- Baud rate>  Unlikely to have it beyond 115200 bps
- Framing>
   Data chunks have variable size, e.g. 8 bits.
   Can be 5 to 9 bits, little or big endian.
   Start bit: signals begin of tx, moving line from 1 to 0
   Stop bit: end of tx, moving line form 0 to 1.
   Parity bit: basic error checking, optional

Common standards:
- TTL (Transistor Transistor Logic), usualy 3.3V or 5V
  where HIGH=1, LOW=0.
- RS-232, old style, voltage range from -13V to +13V,
  or even +/-3V or +/-25V, and flipped logic (HIGH=0, LOW=1).
  Better suited for longer range communication.


https://learn.sparkfun.com/tutorials/serial-peripheral-interface-spi

SPI (Serial Peripheral Interface) is a synchronous serial.
The receiver end can be as simple as a shift register.
Sampling happens on the clock edge (either 0 to 1 or opposite).
SPI is full duplex.  The controller side defines the clock, which
also determines the response from the peripheral.
Chip select: held high disconnect the peripheral from the SPI bus.


Next Up: https://learn.sparkfun.com/tutorials/i2c/