← All projects
Course

Microprocessor Systems

Microprocessor Systems (E155) · Fall 2024

Seven projects on an iCE40 FPGA and an STM32 microcontroller, from a seven-segment decoder to SPI, interrupts and Wi-Fi, ending in a tilt-controlled sand simulator.

  • FPGA
  • SystemVerilog
  • STM32
  • Embedded C
  • SPI
  • Interrupts
The final project, an interactive physics engine, in its 3D-printed housing

E155 at Harvey Mudd pairs an iCE40 UltraPlus FPGA with an STM32L432KC microcontroller. I wrote SystemVerilog for the FPGA and bare-metal C for the microcontroller, and debugged both with testbenches, an oscilloscope and a logic analyzer. Each lab built on the one before, and the final project put both chips to work together.

Pick a lab below to see the design, testing and results.

Labs

The finished seven-segment display showing the letter F
Lab 1

FPGA Bring-up & Seven-Segment Decoder

Assembling and testing the FPGA/MCU board, then a combinational SystemVerilog decoder that drives a seven-segment display from four switches, verified on every input.

  • FPGA
  • SystemVerilog
  • SMD soldering
  • QuestaSim
Read more
Dual seven-segment display driven by the FPGA on a breadboard
Lab 2

Multiplexed Seven-Segment Display

Two seven-segment digits sharing one set of FPGA pins through time multiplexing, with PNP transistor drivers sized from the iCE40 datasheet.

  • FPGA
  • SystemVerilog
  • Time multiplexing
  • Transistor drivers
Read more
Block diagram of the keypad scanner system
Lab 3

Keypad Scanner

FPGA logic that scans a 4×4 matrix keypad, debounces it with a state machine, and shows the last two keys pressed on the multiplexed display from Lab 2.

  • FPGA
  • SystemVerilog
  • FSM
  • Debouncing
  • Testbenches
Read more
Schematic of the STM32 driving an LM386 amplifier and speaker
Lab 4

Digital Audio Player

Bare-metal STM32 firmware that plays music through a speaker, using two hardware timers for pitch and note length, with frequency error checked across three octaves.

  • STM32
  • Timers
  • Embedded C
  • LM386
  • MATLAB
Read more
Flowchart of the interrupt handlers and main loop
Lab 5

Motor Speed with Interrupts

Interrupt-driven quadrature decoding on an STM32 that measures motor speed and direction to within 0.05%, compared directly against a polling implementation.

  • STM32
  • Interrupts
  • Quadrature encoder
  • Embedded C
Read more
The web page showing temperature readings at different resolutions
Lab 6

IoT Temperature Sensor & Web Server

An STM32 reads a DS1722 temperature sensor through a register-level SPI driver I wrote, and serves live readings, adjustable resolution and LED control on a web page through an ESP8266.

  • STM32
  • SPI
  • UART
  • ESP8266
  • Embedded C
Read more
The finished physics engine in its 3D-printed housing
Final project

Interactive 2D Physics Engine

A tilt-controlled sand simulator. An FPGA runs the particle physics and drives a 64×64 LED matrix in 12-bit color while an STM32 reads an accelerometer and streams the gravity direction over SPI.

  • FPGA
  • SystemVerilog
  • STM32
  • I2C
  • SPI
Read more
← All projects