Notes from the Spark Gap Podcast

Charles Guan
4 min readFeb 5, 2019
Photo by Alexandre Debiève on Unsplash

The Spark Gap podcast covers practical topics in embedded electronics, especially relevant for junior engineers getting hands-on with embedded products. Sadly, Karl and Corey stopped releasing new episodes, but the current archive of 53 episodes has great information. I summarize some of my favorite lessons below.

Many lessons will be obvious to the experienced embedded engineer, but I hope there's something new to learn for everyone.

Ep. 3: Powering Electronics

Don't expect to get a clean 5V or 9V from your wallwart power supply.

  • Linear regulators
  • Simple, usually stable with a minimum current
  • Inefficient, power loss = dV * I
  • Special variants
  • Low dropout regulators (LDOs)
  • Precision Vref (for A/D and D/A references, not for supply)
  • Switched-mode
  • Switching noise couples to output. Use a capacitor or linear regulator to filter out noise
  • Buck (V_in > V_out)
  • Boost (V_in < V_out)
  • Double-check max current specs for V_out
  • Buck-boost (useful when V_in changes over time, such as in coin cell batteries)
  • Can be used for ground isolation between input and output
  • Be careful of the DC jack polarity
  • A lot more resources in the show notes

Ep. 6: USB

  • Options for adding USB to your board (ordered by increasing levels of effort)
  • Use an FTDI USB-serial converter
  • Can use a separate EEPROM for custom VID/PID.
  • Use a microcontroller with a USB PHY built-in
  • Use an external PHY
  • Can use USB 2.0 to supply 500 mA to your project, but not all of that power is available immediately, requires negotiation
  • Be cognizant of ground loops: USB power may couple ground to earth ground.
  • USB protection
  • Ferrite bead for high frequency noise on power line
  • ESD diodes for data line spiking

Ep. 12: Ethernet

Steps to add Ethernet connectivity to an embedded project

  • PHY options:
  • Traditionally, get an RJ45 (although not required). 100 ohm differential pair wiring to the PHY
  • Get an external PHY, and ensure proper magnetic coupling between differential pairs in the connector, or an external Ethernet transformer IC (several years ago, Raspberry Pi had this hiccup.) Wire this 50 Ohm single ended to MAC
  • Use Tiva C Connected Series, which includes a PHY
  • Connection between external PHY and microcontroller with MAC are MII or RMII (4 or 2 bit parallel bus), easily interchangeable
  • Get a microcontroller with built-in MAC.
  • Find an open-source protocol and TCP/IP stack such as LWIP or uIP.
  • Send a command over a BSD socket! (No need for a Web page).

Additional notes:

  • If you only have 1 communication method, use ethernet, TCP/IP is super reliable.
  • If dropping a few packets is okay, UDP works, too
  • Can also provide power over Ethernet (PoE)

Ep. 41+42: Making Choices

It's easy to get analysis paralysis when working on embedded electronics, because there are so many different ways to build the same function.

Some rules of thumb for picking a part:

  • Turn the project goals into product specs, so you can prioritize parameters
  • Use the components that everyone else is using, for the most part.
  • Simulating an op amp or part usually doesn't help you narrow down choices.
  • If you've narrowed down to 5 choices, just ask for evaluation boards to test their supposed specifications.
  • Company loyalty is not reliable. From each company, some parts are good, and some parts are terrible. They're big companies with many teams.
  • If nothing else just use a cheap one with a common pinout (so you can switch them out).

Next hold-up: what should my PCB stack up be?

  • Start simple. For example, ground on top and bottom, then signal and power.
  • Ask your fab house! They're fully of knowledge. They'll probably recommend via sizes, too.
  • Don't be a perfectionist on board layout.

Ep 18. Serial Communications

UART, I2C, and SPI are common on-board communications. They also discuss CANBUS, which is popular in automotive applications.

UART

  • Point-to-point, full duplex
  • Either side can start up comms.
  • Very simple in firmware and layout. Easy to mess up directions
  • Easy to overflow buffer, but can add hardware flow control (RTS/CTS)
  • UART and SPI are point-to-point while others can communicate to multiple
  • UART can get worse at >115200 baud because your sampling rate might not be fast enough.

SPI

  • 1 master with multiple peripherals
  • Chip select pin (GPIO) needed for each peripheral.
  • Every SPI device is writing and reading at the same time, but it's often ignored so it's only used as half-duplex at a time, because it's difficult to synchronize data transfer except in streaming.
  • On-board use only, signal integrity is terrible with long cables (same is true with UART, but SPI runs at higher rates)

I2C

  • All devices on same 2 wires, uses addressing to talk to different devices.
  • Anyone can pull clock line low to initiate communications.
  • Open-drain (requires pull-up resistors)
  • Need to watch capacitance on the bus (RC time constant)
  • Resistors in series occasionally needed to limit slew rate.
  • Up to Mbits/s. But much cleaner and robust at standard 100kbit speed

CANBUS

  • Multiple peripherals
  • 2 data lines. Differential signaling rejects common mode noise.
  • Designed for error correction, lots of bus arbitration, and long cables
  • No real clock (like UART).

--

--