Logo
AVR Simulator • ATmega328 on your desktopv0.1

Run AVR firmware without the hardware

A lightweight ATmega328 emulator written in C# and WPF. Load a firmware image compiled into Intel HEX format, step through the disassembly, and watch port pins, analog inputs, and DAC output react in real time.

Test workflowRelease workflow.NET 10C#WPFLicense: Unlicense
Application screenshot

Firmware, memory, and pins in one window

View original assets
AVR Simulator main window with disassembly, hex bytes, ADC controls, DAC output, and GPIO port indicators
Disassembly, HEX bytes & GPIO stateThe code panel follows the program counter while decoding instructions, and the ADC, DAC, and port sections mirror the simulated peripheral registers. Here PB5 is driven high by the bundled Blink example.
Key features

A small core that behaves like the chip

Everything in the README, arranged as the workflow you actually use.

AVR instruction emulation

A decoder loop executes the ATmega328 opcode set, keeping program counter, stack, and registers in sync as the firmware runs.

Intel HEX loader

Reads the .hex files produced by AVR-GCC and avrdude, decodes the records, and maps the resulting bytes into simulated flash.

Live GPIO monitoring

PORTB, PORTC, and PORTD are rendered as LED-style pin indicators, so output writes and toggling are visible while the program executes.

ADC & DAC simulation

Drive analog inputs with the manual voltage slider or a sine wave generator, and watch the DAC output voltage change in real time.

Non-blocking worker

Emulation runs on a background worker, leaving the WPF interface responsive for run, stop, and single-step control.

Extensible core

Chip behaviour sits behind the AVRInterpreter base class, so additional AVR variants can be added without touching the UI.

Blink.c · bundled sample
#include <avr/io.h>
#include <util/delay.h>

int main (void)
{
  /* set PORTB for output */
  DDRB = 0xFF;

  while (1)
    {
      /* set PORTB.5 high */
      PORTB = 0x20;

      _delay_ms(1000);

      /* set PORTB.5 low */
      PORTB = 0x00;

      _delay_ms(1000);
    }

  return 1;
}

The execution loop

Blink.hex is loaded automatically from the execution directory, so a fresh download starts running immediately. Every other firmware image follows the same cycle:

  1. 1. Load firmware

    An Intel HEX file is parsed into the simulated flash address space.

  2. 2. Fetch & decode

    The interpreter reads the next opcode at the program counter and decodes it.

  3. 3. Execute

    Registers, SRAM, the stack, and I/O registers are updated like real hardware.

  4. 4. Observe

    Pin, timer, ADC, and DAC state is pushed to the WPF visualisation.

Browse the sample source
Virtual hardware

Ports, ADC, and DAC you can poke at

Get the build
GPIO port state
high low

PORTB

  • PB0
  • PB1
  • PB2
  • PB3
  • PB4
  • PB5
  • PB6
  • PB7

PORTC

  • PC0
  • PC1
  • PC2
  • PC3
  • PC4
  • PC5
  • PC6

PORTD

  • PD0
  • PD1
  • PD2
  • PD3
  • PD4
  • PD5
  • PD6
  • PD7

ADC control

A 0–5 V manual slider, frequency and amplitude settings, and an optional sine wave generator feed the analog input value the firmware reads.

Virtual DAC

The output panel reports the DAC voltage as both a decimal value and the raw register code, so calibration logic is easy to verify.

Current GitHub release

Download AVR Simulator v0.1

Published September 21, 2026. A portable Windows bundle — unzip it and run the executable, or build the solution yourself.

x86 · .NET 10 WPF

Windows

AVR_Simulator.zip · 135.7 KB

Portable bundle with the self-contained simulator executable, the Blink sample firmware, and the license.

Download .zip

Windows only

The frontend is a WPF application targeting .NET 10 on Windows. The emulation core itself is a standalone .NET class library.

Build from source
Build from source

Set up a local development build

Visual Studio 2022+

Visual Studio setup

Open the solution, switch to the Release configuration, and build. The executable lands in the x86 output folder.

Prerequisites

Windows, the .NET 10 SDK (LTS) or newer, and optionally Visual Studio 2022 for the full IDE experience.

terminal
git clone https://github.com/roboter/AVR-Simulator.git
cd AVR-Simulator

# Open AVR Simulator.sln in Visual Studio
# Select the Release configuration
# Build -> Build Solution (Ctrl+Shift+B)

The built executable lands in AVR-Simulator.UI\bin\x86\Release\net10.0-windows\.

Core and UI separated

AVR-Simulator.Core holds the interpreter, memory map, and HEX parser with no GUI dependencies, so the emulator can be reused in tests or other frontends.

Browse the core

Tested in CI

Instruction execution, memory operations, and HEX decoding are covered by unit tests, and the test workflow gates every release.

View test runs

Supported chips

ATmega328 is fully supported today. Other AVR variants can be added by deriving from the AVRInterpreter base class.

See the implementation

AVR Simulator is released into the public domain under the Unlicense. The original proof of concept was written by tmthrgd; this fork modernises it for .NET 10 with a restructured solution, tests, and automated releases.