Embedded Hardware Interfaces
Embedded hardware interfaces are the wiring-level protocols, such as GPIO, UART, I2C, SPI, and CAN, that a microcontroller uses to talk to sensors, displays, and other chips on the same circuit board.
itComputer architecture and hardware | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Don't Panic
Don't Panic - Embedded Hardware Interfaces
Embedded hardware interfaces are the small agreements that let the chips on one circuit board stop glaring at each other and exchange signals. A microcontroller has sensors, displays, memory, and motor drivers nearby. It cannot negotiate with them in prose, so it uses wires, voltage levels, timing, and a few very firm rules about which bit is allowed to arrive when.
The useful surprise is that not every named interface is a data link. GPIO is one on-or-off signal with no protocol at all. PWM sends no structured message; it changes average power by varying duty cycle. ADC goes the other way and turns a continuously changing voltage into a number. Calling all three communication is how a board ends up with a very confident yet dim LED.
For actual serial traffic, choose the shape of the problem. UART is two wires and a prior agreement about baud rate; it suits a debug console or one peripheral. I2C saves pins by putting several addressed devices on one open-drain, two-wire bus. The pull-up resistors do the apparently unglamorous job of restoring a released line high, which turns out to be central rather than decorative. SPI spends more pins for speed: clock and data lines are shared, but every device gets its own chip-select line.
CAN has a different personality because it expects many nodes and an electrically noisy environment. Its two differential wires carry frames whose identifiers also set priority. When nodes begin together, the lower identifier wins arbitration without corrupting the message. That is less a queue than a polite argument conducted at wire speed, with no raised voices and very strict rules about zeros.
Start with the Slides tab when you need the choice map: one signal, one peripheral, several low-speed devices, higher throughput, analog control, analog measurement, or many noisy nodes. Keep the Cheatsheet nearby for wire names, I2C speed modes, SPI modes, and Linux device paths. The Practice Reference is for confirming GPIO, I2C, and SPI wiring from userspace before firmware turns a loose connection into an afternoon of theories. The Quiz is there to check whether the map still holds once the acronyms begin arriving in a small convoy.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://www.nxp.com/docs/en/user-guide/UM10204.pdf
Supports
- SDA/SCL two-wire bus, open-drain signaling requiring pull-up resistors
- 7-bit and 10-bit device addressing
- Standard-mode (100 kbit/s), Fast-mode (400 kbit/s), Fast-mode Plus (1 Mbit/s), High-speed mode (3.4 Mbit/s), and unidirectional Ultra Fast-mode (5 Mbit/s)
- Quiz answers on pull-up purpose and speed-mode ordering
- https://docs.kernel.org/driver-api/spi.html
Supports
- SPI as a synchronous four-wire link (SCK, MOSI, MISO, chip-select) with no formal standards body
- Host/target (master/slave) roles and full-duplex operation
- Absence of device addressing; one chip-select line required per device
- CPOL/CPHA clock polarity and phase defining SPI's four clock modes
- Typical SPI use cases: sensors, memory, displays, ADC/DAC, SD/MMC cards, BIOS flash
- Typical SPI clock speed (~10 MHz) cited in the cheatsheet
- Quiz answers on SPI wiring cost and clock-mode mismatch
- https://docs.arduino.cc/learn/communication/uart/
Supports
- UART as asynchronous, point-to-point serial communication over TX/RX with no shared clock line
- Byte framing: start bit, data bits, optional parity bit, stop bit(s)
- Requirement that both ends agree on baud rate in advance
- Typical UART use cases: debugging, logging, connecting peripheral modules
- Quiz answer on why baud rate must be pre-agreed
- https://docs.kernel.org/driver-api/gpio/intro.html
Supports
- Definition of GPIO as a flexible, software-controlled digital signal
- GPIO use cases: driving indicators, reading switches, bit-banging serial protocols
- Open-drain/open-source signaling concept and its role in shared-bus protocols like I2C
- Quiz answers on GPIO's basic function and the bit-banging technique
- https://docs.kernel.org/userspace-api/gpio/chardev.html
Supports
- GPIO character device model (/dev/gpiochipN, line offsets)
- Line request/read/write operations underlying gpiodetect, gpioinfo, gpioget, gpioset
- Practice-reference GPIO command usage
- https://docs.kernel.org/i2c/dev-interface.html
Supports
- I2C userspace device file naming (/dev/i2c-N)
- i2c-tools utilities (i2cdetect, i2cget, i2cset, i2cdump) and their purposes
- I2C_SLAVE ioctl addressing (7-bit vs. 10-bit)
- Practice-reference I2C command usage
- https://docs.kernel.org/driver-api/pwm.html
Supports
- PWM defined by period and duty cycle
- Typical PWM use cases: LED dimming, fan speed control, haptic feedback
- Quiz answer on what duty cycle controls
- https://docs.espressif.com/projects/arduino-esp32/en/latest/api/adc.html
Supports
- ADC definition and purpose (converting analog voltage to digital form)
- Resolution in bits and corresponding output value ranges (e.g., 12-bit default, 0-4095)
- Attenuation settings extending measurable input voltage range
- Distinction between raw and calibrated (millivolt) readings
- Quiz answer on ADC resolution vs. measurable range
- https://docs.arduino.cc/language-reference/en/functions/analog-io/analogRead/
Supports
- analogRead() returning a value proportional to input voltage
- Classic AVR-based Arduino ADC resolution (10-bit, 0-1023 range)
- Quiz answer on ADC resolution vs. measurable range
- https://www.tekeye.uk/downloads/can2spec.pdf
Supports
- CAN differential signaling (CAN_H/CAN_L)
- Multi-master bus architecture
- Non-destructive arbitration by dominant/recessive bits, lowest identifier wins
- Standard (11-bit) vs. extended (29-bit) frame identifiers (CAN 2.0A/2.0B)
- Classic CAN maximum bit rate of 1 Mbit/s, cited in the cheatsheet
- Quiz answers on CAN arbitration and identifier priority
- https://www.raspberrypi.com/documentation/computers/raspberry-pi.html
Supports
- 40-pin GPIO header present on standard Raspberry Pi boards
- 3.3V GPIO I/O level
- I2C, SPI, and UART listed among the board's hardware communication interfaces
- https://www.can-cia.org/can-knowledge/history-of-can-technology
Supports
- CAN development at Bosch beginning in 1983, public introduction in 1986, and Intel's first controller chip in 1987
- Bosch CAN 2.0 publication and CAN FD introduction in 2012
- Timeline events for CAN development and adoption
- https://www.iso.org/standard/20380.html
Supports
- Publication of the first ISO 11898 CAN standard in November 1993
- Timeline event for the standardization of CAN physical and data-link layers
- https://www.ti.com/lit/an/slva689/slva689.pdf
Supports
- Pull-up resistance and total bus capacitance determine I2C rise-time behavior
- Pull-up selection trades rise time against sink-current and power constraints
- Field Notes on measuring the electrical budget rather than treating I2C as a software-only bus
- https://www.saleae.com/support/getting-started/protocols
Supports
- Logic 2 protocol decoding for SPI, I2C, serial, and CAN
- Landscape entry for observing decoded interface traffic
- https://digilent.com/shop/analog-discovery-3/
Supports
- Logic analysis and protocol support for SPI, I2C, UART, and CAN
- Landscape entry for correlating digital-interface transactions with generated and measured signals
- https://www.totalphase.com/products/aardvark-i2cspi/
Supports
- I2C and SPI host/target operation, configurable I2C pull-ups, SPI polarity and phase, and GPIO use
- Landscape and Field Notes entries for testing an interface before firmware owns the bus
- https://www.peak-system.com/products/hardware/external-pc-interfaces/pcan-usb/
Supports
- USB connection to CAN networks and APIs for CAN communication with control devices
- Landscape entry for observing and exercising the CAN portion of this course
