Gerd's AVR simulator
(Diese Seite in Deutsch:
Gerd's AVR simulator
AVR assembler simulator for the stepwise execution of assembler
source code - with many extras. Click here if you hate simulators.
- Simulates AVR 8-bit microcontrollers of any type (ATtiny, ATmega, etc.) in
- Just as if you would jump into the controller and you'll see what it does
with your source code.
- Necessary is the source code file only (in *.asm format).
- Assembles the source code with the built-in assembler gavrasm, fast and reliable.
- Allows control over registers, flags, memories, ports, timer/counters, AD converter,
- All is displayed in a convenient form and available only if really needed.
- Can be used to devellop assembler software from scratch as well as for existing
- Well suited even for older projects because of the support for all older AVR
- Stand-alone solution: includes anything needed for all its features, no additions
necessary, no dependencies, no installation necessary. Works out of the box
"like a charm" (a new user).
- Useful to understand AVR controller's hardware and to learn assembler from
scratch: each additional codeline can be assembled and simulated, and it can
immediately be seen what it does within the controller. Forget the "Assembler
is complicated to learn!" statements: it is easier to learn than any other
language and is highly transparent with the simulator.
- Simple handling, no extended learning phase required,
- Works under Windows and Linux, 64-bit executables downloadable,
- Lazarus-Pascal source code available for free for own modifications,
- Fast and comfortable start of new assembler projects, fills in standard
text frames for structured source code in a short or in a comprehensive
format, for linear as well as for interrupt-oriented programs,
Left the comprehensive version, rright with interrupt vectors.
A short version without any extras is also available.
- From Version 1.8 on a comfortable device selector is on board, that
allows to select AVRs (types and packages) by selectable hardware
- Editor for modifying of the assembler source code with several
- The editor, from version 1.7 on, has a syntax highlighter which provides
multiple opportunities for its configuration:
- Forgot the mnemonic of an instruction in AVR assembler, forgot how many
clock cycles it needs or which flags are affected? No problem in avr_sim.
From Version 2.1 on an instruction list comes up and you can search and
find what you need,
- Display of header symbols, ports and interrupts of the applied AVR
- Display of the hardware configuration for PDIP-/SOIC- and QFN-packages,
- Insert the hardware into the source code by simply typing F2:
- Internal assembler gavrasm for quick modification and assembling of
- Comfortable setting and clearing of breakpoints, storing and loading of
- From version 2.3 on: Scan- and alarm function: counts, beeps and/or stops if a
register or a register pair, a portregister or a portregister pair, a SRAM location
or a SRAM pair is written, written with a preselected value or read,
- Control of the simulation in a simulator window,
- Simple overview over I/O ports and timers,
- Display of SRAM content,
- Display of EEPROM content as well as correct Write and Read operations,
- Display and simulation of the watchdog timer,
- Display, simulation and manipulation of AD conversion channels of the
device including a comfortable tool to design a 12/16 key input field with
a resistor matrix as voltage input to ADC channels,
- Configurable four-channel scope for displaying polarity changes on
output compare pins or on any available I/O pin of the device,
- Scope display for R/2R analog values on ports with configurable resolution and
in up to four different channels simultanously in selectable colors.
- Scope display of internal Digital-to-Analog converters for those AVR types that
have these available.
2.1 The latest version
Version 2.3 of the software adds a configurable alarm function, improved breakpoint
organization, DAC recognition and display, and fixes minor bugs in simulation (see
the chapter Changes in the handbook).
a) In version 2.3, as published 05.01.2021, was a fatal
error. The error concerned codelines with a literal constant, such as 'X'. When
browsing in the code, avr_sim froze and did not react any more. To correct this,
download the corrected version 2.3 again.
b) The Linux version unpacked with a 2020 date. It was a previous version. The error
was corrected on February 9th, 2021. Please download the file again.
2.2 Lazarus Pascal source code
The source code is written in Pascal and compiles with Lazarus. A Windows and
Linux version of the source code are provided.
Executable 64-bit versions are available for Windows and for Linux. The
Windows executable is available in a short version and in a
debug version (with range checking features enabled). If you need
executable versions for other operating systems, compile the source
code with Lazarus. The handbook describes how to do that.
The handbooks for the different versions are available in English and in
German language. It holds relevant information for installing avr_sim, for
compiling of the program with Lazarus and describes all features provided.
A brief description of the software internals of avr_sim has been added.
Known errors in the current version are described here.
2.6 Older Versions not available any more
3 Error reports
Due to the enormeous complexity of the task (the devellopment of
the AVRs took two decades and the internals of an AT90S1200 differ
widely from those of an ATtiny814 or an ATmega324) it cannot be
avoided that there are still bugs and missing features in that
software. It would overstrain me to test more than 100 AVR types
and their more than a douzend hardware features. If you
find errors or you miss features of a certain type, please send
me a note (if possible including source code), my email address
is on the title page of the handbooks. I'd like to repair those
errors as I have enough time to do that (I am retired). In that
way I can improve the software. Thanks for each hint ...
None so far.
4.1 Monthly accesses
This shows the monthly accesses to the avr_sim website and the
downloads of Linux- and Windows-files. It seems that the handbooks
4.2 Accesses by versions
This shows the accesses to the different versions of avr_sim.
New releases come every three to four monthes.
4.3 Accesses by executables vs. sources
The share of self-compilators among the total downloads is
5 Links to uses and users of avr_sim
The following internal webpages use avr_sim:
Anthony Peck has used avr_sim to follow his generation of random numbers with an
ATtiny13 in his
associated with a video demonstrating
the calculation process.
- The starter course here uses
avr_sim as instrument for introducing the first assembler projects and to
visualize the effect of assembler instructions.
- The micro-beginner course here
uses avr_sim to understand key AVR instruction execution and basic techniques
in assembler programming of AVRs.
- This webdocument
describes the execution of codes by an AVR and uses avr_sim to show what
is going on internally.
- This document
uses avr_sim to visualize the execution of interrupts.
- This page on
handling date and time demonstrates the handling of date and time info by
demonstrates of avr_sim's built-in device selector.
- This here
uses avr_sim's ADC simulator to follow program execution with key encoders.
- This uses avr_sim's capability to
measure execution times of delay loops in LCD applications.
Please send more application reports on avr_sim to gavrasm (at) avr-asm-tutorial.net.
©2017 - 2021 by