Prototyping · Study deck

MCU vs MPU: Measurements and Boundaries

Both controller classes could run the prototype.

Voltage Vera is your guide for this deck.

iotclass.org

After studying this chapter

Learning objectives

You will be able to:

  • Explain: A 12-bit ADC on 3.3 V divides the input into 4,096 steps of 0.806 mV and gives an ideal 74.0 dB signal-to-quantisation-noise ratio.
  • Explain: Naming their actual numbers turns "microcontroller" and "microprocessor" from category labels into a measurable gap a team can plan a battery, a bill of materials, or a review record around.
  • Explain: Arduino and Raspberry Pi are the two boards most prototype teams already recognize, which makes them a useful anchor for the MCU Fit and MPU Fit checklists above.
iotclass.org

Major section

Start With the Situation

Both controller classes could run the prototype.

  • A microcontroller board runs a bounded device-control program; a microprocessor board can run an operating system and more services.
  • Boot is the startup process, and boot time measures how long it takes.
  • The team must compare measured boot time, power, timing, interfaces, and support.
ATmega328 flash, EEPROM, and SRAM roles are compared with explicit firmware and peak runtime budgets.
ATmega328 flash, EEPROM, and SRAM roles are compared with explicit firmware and peak runtime budgets.
iotclass.org

Major section

Arduino and Raspberry Pi in Numbers

That extended version is the more honest fit for a Raspberry Pi-class board.

  • Arduino and Raspberry Pi are the two boards most prototype teams already recognize, which makes them a useful anchor for the MCU Fit and MPU Fit checklists above.
  • Naming their actual numbers turns "microcontroller" and "microprocessor" from category labels into a measurable gap a team can plan a battery, a bill of materials, or a review record around.
  • Neither board is the better one in general; the second prototype is simply answering a question the first prototype never had to ask.
iotclass.org

Major section

Evidence Before the Choice

The controller choice should be backed by evidence, not preference.

  • A threshold crossing must reach the buzzer within the stated 500 ms budget, even when the radio is busy.
  • Energy evidence must include sleep, wake, transmit, and fault states rather than a single idle reading.
  • Application evidence asks whether the gateway can store readings and upload them later.
Controller selection evidence map
Controller selection evidence map
iotclass.org

Major section

Incremental Examples

The prototype is testing application behavior near equipment, so operating-system evidence matters.

  • A door sensor reports open/closed state from a reed switch and sends a status message every few minutes.
  • The main evidence is wake time, GPIO interrupt behavior, sleep current, radio transmit current, and reset recovery.
  • A team is building a machine room monitoring prototype.

Why it matters

This case is harder because the controller is not only reading pins.

iotclass.org

Major section

Incremental Examples (continued)

The firmware can be a small state machine: wake, read pin, debounce, send compact message, confirm local safe state, sleep.

  • The acceptance test should measure current in sleep, wake, transmit, and fault states, then compare the result with the battery-life target.
  • A Linux-capable MPU would add boot time, filesystem, package, and service-supervision risks that do not answer the main question.
  • The software stack can use Linux, systemd services, a web UI, local storage, and log collection.
iotclass.org

Major section

Incremental Examples (continued)

This case is harder because the controller is not only reading pins.

  • A maintenance bench needs a local display, USB barcode scanner, SQLite cache, browser-based setup screen, and Ethernet upload when the site network returns.
  • A Raspberry Pi Compute Module, BeagleBone, or similar MPU-class board is the more useful starting point.
  • The main evidence is boot time, display startup, USB scanner support, filesystem behavior after power loss, local database writes, and service restart behavior.
iotclass.org

Major section

Phoebe's Field Notes: The Vibration Endpoint's ADC Rate Is An Energy Decision

The mathematical gist: A 200 Hz vibration signal needs at least 400 samples each second.

  • A 12-bit ADC on 3.3 V divides the input into 4,096 steps of 0.806 mV and gives an ideal 74.0 dB signal-to-quantisation-noise ratio.
  • The endpoint should use an MCU because the important questions are local and time bounded.
  • The gateway should use an MPU because the important questions are application-level.

Why it matters

The endpoint should use an MCU because the important questions are local and time bounded.

iotclass.org

Major section

Hybrid Boundaries

Hybrid designs combine an MCU and MPU when neither side should own every task.

  • The important design work is the boundary: what stays deterministic, what becomes an application service, and what happens when either side fails.
  • Configuration, storage, and network services sit on the MPU side, where a richer software stack can manage them.
  • Sensor sampling, watchdogs, local alarms, and actuator safety stay on the MCU side because they must continue when the application side pauses or restarts.

Why it matters

Sensor sampling, watchdogs, local alarms, and actuator safety stay on the MCU side because they must continue when the application side pauses or restarts.

Hybrid MCU and MPU boundary
Hybrid MCU and MPU boundary
iotclass.org

Major section

Review Record

A controller review should record why the chosen class answers the current stage-gate question.

  • The record should be clear enough that a later builder can repeat the decision.
  • Timing evidence covers endpoint response under radio retry and local alarm; energy logs separate sleep, wake, transmit, and fault states.
  • The next gate still asks for enclosure, cable, and recovery tests.
MCU versus MPU review record
MCU versus MPU review record
iotclass.org

Major section

Freeze Decisions With Evidence

The team picks a controller from habit and never measures timing, energy states, memory headroom, or recovery behavior.

  • The issue appears later when the prototype is harder to change.
  • The: FLASH RELEASE BUDGET shows 4 KiB free, but the: SRAM PEAK BUDGET can still overflow independently; -Os and compressed instructions recover measured headroom, not interchangeable memory.
  • The budget view in @fig-mcu-memory-budget separates persistence from peak runtime use before optimisation is credited as recovered capacity.
ATmega328 flash, EEPROM, and SRAM roles are compared with explicit firmware and peak runtime budgets.
ATmega328 flash, EEPROM, and SRAM roles are compared with explicit firmware and peak runtime budgets.
iotclass.org

Deck summary

Key takeaways

Both controller classes could run the prototype.

  • That extended version is the more honest fit for a Raspberry Pi-class board.
  • The controller choice should be backed by evidence, not preference.
  • The prototype is testing application behavior near equipment, so operating-system evidence matters.
  • The firmware can be a small state machine: wake, read pin, debounce, send compact message, confirm local safe state, sleep.
iotclass.org

Retrieval practice

Recall check 1 of 2

Voltage Vera says: answer from memory, then check your reasoning.

Q1A prototype endpoint wakes on a timer, samples a sensor, drives a local warning output, sends a compact status message, and then returns to a low-energy state. Which controller class should the team test first?

ATest an MCU for timing, sleep, I/O, and fault recovery.
BMPU, because every IoT prototype benefits from a full operating system.
CHybrid, because every design should split sensing and application services.
DEither choice is equivalent as long as the firmware can be written quickly.
Show answer

Answer: A The prototype is mainly proving embedded control behavior at the hardware boundary.

iotclass.org

Retrieval practice

Recall check 2 of 2

Voltage Vera says: answer from memory, then check your reasoning.

Q2A greenhouse prototype uses an MCU to sample soil moisture and control a pump, plus a Linux gateway for a dashboard and cloud upload. What should the boundary contract state before field testing?

AThe gateway firmware version and cloud connector configuration, including the published API version and network retry settings.
BState message format, command IDs, timeouts, safe state, reset, and config owner.
CThe MCU and gateway board compatibility and power wiring.
DThe cloud API endpoint and gateway upload retry policy.
Show answer

Answer: B These details keep real-time pump behavior separate from dashboard and cloud-service behavior.

iotclass.org

Print reference

Answers

Answer key.

  1. A · The prototype is mainly proving embedded control behavior at the hardware boundary.
  2. B · These details keep real-time pump behavior separate from dashboard and cloud-service behavior.
iotclass.org