Let's compare real-world examples of Von Neumann and Harvard architectures using two popular microcontroller families: STM32 and Arduino AVR. ![1570285536497](https://hackmd.io/_uploads/rkTu_6mHxg.png) **1. [Arduino](https://www.ampheo.com/c/development-board-arduino) AVR (Harvard Architecture)** **Example: [ATmega328P](https://www.ampheo.com/search/ATmega328P) (used in [Arduino Uno](https://www.ampheo.com/product/a000046-25542493))** * 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](https://www.ampheo.com/search/STM32) (Von Neumann-Like Architecture)** **Example: [STM32F103](https://www.ampheo.com/search/STM32F103) (Blue Pill) or [STM32F4](https://www.ampheo.com/search/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:** ![企业微信截图_20250703164537](https://hackmd.io/_uploads/r17BQT7rge.png) **Summary:** * [Arduino](https://www.onzuu.com/manufacturer/arduino) AVR: True Harvard architecture — best for predictable, low-power applications with strict timing. * [STM32](https://www.ampheoelec.de/search/STM32): Von Neumann-like, more flexible and efficient in software, better for multitasking, RTOS, and high-level features.