Try   HackMD

Let's compare real-world examples of Von Neumann and Harvard architectures using two popular microcontroller families: STM32 and Arduino AVR.

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

1. Arduino AVR (Harvard Architecture)
Example: ATmega328P (used in Arduino Uno)

  • Architecture: Harvard
  • Code (Program) Memory: Flash memory (e.g. 32 KB)
  • Data Memory: SRAM (e.g. 2 KB)
  • Instruction and Data buses: separate
  • Instruction word size: 16 bits
  • Data word size: 8 bits

Implications:

  • Can fetch instructions and read/write data at the same time
  • Efficient for simple embedded control tasks
  • Code and data stored in different physical memory regions

Example Behavior:
When you use pgm_read_byte() to read a constant from flash memory, it’s because code and data memory are separate—normal pointers can’t access program memory directly.

2. STM32 (Von Neumann-Like Architecture)
Example: STM32F103 (Blue Pill) or STM32F4 series

  • Architecture: Modified Harvard / Von Neumann-like
  • Unified memory space using bus matrix
  • Code and data often reside in the same address space
  • Uses caching and pre-fetch to overcome bottlenecks
  • Instruction and data fetches may share buses at certain points

Implications:

  • Simpler software model (code and data are addressable with standard pointers)
  • Easier to use C/C++ pointers on both RAM and Flash
  • Slight performance tradeoff compared to pure Harvard for some real-time tasks

Side-by-Side Comparison:

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

Summary:

  • Arduino AVR: True Harvard architecture — best for predictable, low-power applications with strict timing.
  • STM32: Von Neumann-like, more flexible and efficient in software, better for multitasking, RTOS, and high-level features.