Skip to content
// Article · Field Report

SPI or I2C on a 0.96-Inch OLED in Test and Measurement Gear

Published admin · Researcher
The short answer

Two serial interfaces on the same 0.96-inch 128x64 module look like a convenience, but they behave differently once the board is inside an instrument. SPI is the faster, more deterministic path and costs a few extra pins; I2C saves pins and shares a bus that sensors and memory may already be using. Choosing between them is not a matter of preference but of how the display is updated, what already sits on the bus, and how much noise the instrument's own power stage injects into the wiring.

Key takeawaysSPI gives the host complete control of timing, which makes a display refresh deterministic and easy to reason about under noise. · I2C uses fewer traces and can share an existing bus, at the cost of speed, pull-up sizing and address conflicts. · The update pattern matters more than the peak rate: a status instrument that rewrites a few characters rarely needs the faster bus. · In an instrument with a switching supply or a relay, the shorter serial traces of I2C are attractive until bus capacitance and pull-ups are counted. · Whichever bus is used, the firmware should sit behind a display layer so a change of interface does not reach the application code.

Test and measurement gear is a conservative environment. Instruments stay in service for a long time, spare boards matter, and the display is usually the last thing on the schedule. That encourages a decision that can be made quickly and justified later, which is exactly what an interface comparison should support.

The two candidates are a clocked synchronous serial bus for SPI [1] and an open-drain, multi-master bus for I2C [2]. Both carry the same commands to the same controller, and both are well supported by every microcontroller family used in instruments [3]. The differences show up in pin count, bus sharing and behaviour under electrical noise.

The sections below compare the two buses for a 128x64 panel in an instrument, discuss bus loading and pull-ups, and describe how an update pattern can make the decision almost irrelevant.

What the two serial buses change on a 0.96-inch OLED

SPI moves bits on a clock the host generates, so the transfer finishes in a predictable time and the host can be sure when the frame buffer has been updated. There is no arbitration and no shared bus state to preserve, which makes it the safer choice when the instrument's firmware has hard real-time tasks.

I2C shares two wires with every other device that uses the bus, and its speed is limited by the pull-ups and the capacitance of the wiring. On a compact instrument board that is rarely a problem, and the saving in pins can be the difference between a two-layer and a four-layer layout.

Both buses end at the same place: a controller inside the module that manages the panel. Because the command set is the same, the choice can be revisited later if the firmware is written against a display layer rather than directly against a bus driver.

SPI and I2C compared for a 0.96-inch instrument display

AspectSPII2CWhich wins in an instrument
WiresClock, data, chip select and a command lineTwo shared lines plus pull-upsI2C, when board space is tight
SpeedLimited by the host and the panel's controllerLimited by bus capacitance and pull-up valuesSPI for full-screen updates
DeterminismHost controls every clock edgeShared bus with arbitration and clock stretchingSPI for real-time firmware
Address conflictsNone, chip select per deviceEvery device needs a unique addressSPI when the bus is already crowded
Noise behaviourClock edges can radiate unless routed carefullyLower edge rates, but pull-ups set the timingDepends on layout more than on the protocol [4]
Illustration: SPI and I2C compared for a Decorative illustration for the section "SPI and I2C compared for a"; visual only, carries no data.

Bus loading and update patterns in an instrument

Pull-ups, capacitance and bus length

An I2C bus is only as good as its pull-ups. Too weak and the edges are slow, inviting errors in a noisy enclosure; too strong and the bus draws unnecessary current. Because an instrument's harness may run between boards, the capacitance of that wiring belongs in the calculation before the bus is chosen.

SPI has the opposite profile: no pull-ups, but a fast clock edge that can couple into adjacent traces. In an instrument with a switching converter, separating the clock from the analogue front end is a layout requirement rather than a nicety.

How often does the display really update?

A measurement instrument typically shows a numeric reading that changes a few times per second, plus a menu that changes on user input. Neither pattern stresses either bus. The full-screen redraw only happens at power-up or when switching modes, and even then a 128x64 monochrome frame is small.

Keeping the interface decision reversible

Instruments are often specified for a decade of service, and a display module that is available today may not be in ten years. The most valuable piece of engineering is therefore not the choice of SPI or I2C but the boundary between the application and the panel.

Illustration: Keeping the interface decision Decorative illustration for the section "Keeping the interface decision"; visual only, carries no data.

A small display layer with functions such as draw text, draw bar and set brightness keeps the instrument's logic independent of both the bus and the controller. If the replacement part arrives with a different command set, only that layer changes, and the change can be tested with a pattern rather than a full regression of the instrument.

Buyers who compare solutions usually ask the same question: how much of the firmware is specific to the panel. When the answer is one file, the interface question stops being architectural. That is the level of detail worth confirming for a DisplayModule 0.96" OLED display before the schematic is released, because it determines how expensive the next supply change will be.

Document the bus at the connector, not only at the microcontroller. If the instrument is serviced years later, the person replacing a display board needs to know which pin carries the clock, which carries data and which line distinguishes commands from pixels. A one-page interface note in the service manual prevents a wrong-board failure.

Sources

  1. Wikipedia: Serial Peripheral Interface
  2. Wikipedia: I²C
  3. Wikipedia: Embedded system
  4. Wikipedia: Electromagnetic compatibility

Frequently asked questions

Is I2C fast enough for a 0.96-inch OLED in an instrument?

For status text and menus, yes. A 128x64 monochrome frame is small, and the interface changes a fraction of it at a time. The bus becomes a constraint only if the firmware redraws the full screen frequently, which an instrument interface rarely needs to do.

Does SPI draw more current than I2C for the same display?

The bus itself is a minor contributor compared with the panel's emission current. A higher clock rate moves more charge per unit time but finishes sooner, so the average difference is usually small. Measure the system rail rather than arguing about the protocol.

Can both interfaces be used at the same time on the same module?

Some modules expose both, but only one is active depending on how the part is configured. Treat the interface as a fixed characteristic of the part you order, and record the variant in the bill of materials so a second source does not arrive with the other option fitted.

What happens to the display if the shared I2C bus locks up?

The application should assume the bus can fail and recover. A watchdog or a bus reset routine that reinitialises the display after a timeout keeps a locked bus from taking the instrument out of service, and it costs very little code.

admin
Vulnerability Researcher · ZeroDayCN

Investigates zero-day activity in the Chinese threat landscape and coordinates responsible disclosure across vendors.

// Get the Brief

The Threat Brief, in your inbox.

Triage-ready advisories land an average of 19 hours before NVD publication. Trusted by 2,100+ SOC teams.