Version 45 (modified by dsl, 22 months ago) (diff)



MCUSim is a digital simulator of the 8-bit AVR microcontrollers. It is written from scratch to assist in circuit simulation, firmware debugging, testing, and signal tracing.

Simulator can be extended by creating models written in Lua. They may affect state of a simulated MCU in several ways, e.g. access internal registers, generate signals on its pins or terminate the whole simulation, and play roles of the significant parts of a circuit connected to the microcontroller (external EEPROM, humidity sensor, MOSFET switch).

There is an interactive script also to prepare a simulated MCU instance which is installed together with the simulator executable. It is particularly helpful to set up microcontroller for a firmware debugging (via remote GDB target at localhost:12750) or create a firmware test with Lua models to check conditions and parameters.

Registers of a simulated MCU can be saved into a VCD (value change dump) file and read using GTKWave viewer.

Release version

Tarball with sources: N/A
ZIP archive with sources: N/A

Current version

Tarball with sources: mcusim-0.1.92.tar.gz, mcusim-0.1.92.tar.gz.sha1
ZIP archive with sources:,

MCUSim tips and guides

  1. Preface
  2. Getting Started
    1. General Notes
    2. Install from sources
    3. Simulation example - ATmega8A and Fast PWM (Timer/Counter2)
    4. Simulation example - ATmega8A and Phase Correct PWM (Timer/Counter2)
  3. MCUSim Internals
    1. Main AVR simulation loop
    2. How to add a new AVR microcontroller
    3. Check MISRA C rules

Attachments (6)

Download all attachments as: .zip