open simulator of digital circuits and microcontrollers

In this post I decided to talk about SimulIDE https://simulide.com/ This is a relatively new open source software tool designed for modeling 8-bit microcontrollers of the AVR and PIC families, as well as other electronic circuits. The interface of SimulIDE resembles Proteus. SimulIDE is cross-platform and runs on Linux, Windows and Mac. Next, we will look at the main features of this simulator and talk about my personal impressions of working with this program.

Download and Install

SimulIDE is developed using an open source model, but binary packages are available for all three supported platforms. The project website is available at this link: https://simulide.com/ The source code repository is hidden quite deep: https://launchpad.net/simulide Binary packages for the release and release candidates can be found here: https://launchpad.net/simulide/+download

For Linux, a tar.gz archive is offered, which contains a compiled version with all the libraries. You need to unpack this archive, for example, into your home directory or /opt and run the simulide binary file from the command line or file manager.

For Windows there is a portable version in the form of a zip archive, which you also need to unpack and run the file simulide.exe

Brief overview of the program’s capabilities

After starting the program, the main window opens, which is the circuit editor. SimulIDE comes with a large number of examples, which are located in the examples directory in the program distribution. The screenshot shows the circuit of an oscilloscope on the Atmega328p MCU, which uses a monochrome graphic LCD. To start the simulation, you need to click on the Power circuit button on the toolbar.

SimulIDE main window with example circuit

SimulIDE main window with example circuit

Unlike, for example, Qucs-S or the proprietary Ltspice, modeling in SimulIDE is completely interactive. You can connect virtual meters like in Electronics Workbench or Proteus. The program has an impressive set of analog and digital components, including a library of TTL ICs and CMOS logic. Most importantly, various 8-bit microcontrollers of the Atmega, Attiny, PIC10, PIC12, PIC16 and 8051 families are supported. Arduino is also supported. You can also simulate circuits without microcontrollers. The simulation engine used is a simplified one developed in-house, not SPICE. Transistor models are also used that are greatly simplified for the switching mode. SimulIDE is not suitable for modeling any complex analog circuits. Frequency domain modeling (frequency response analysis) is not supported. For example, I was unable to start a generator using an RC circuit and two inverters. The animated GIF below shows a transient simulation of an oscillating circuit.

Interactive simulation of an oscillatory circuit

Interactive simulation of an oscillatory circuit

Example: modeling a simple circuit on an Atmega328p MCU

Let’s look at a step-by-step example of how to simulate a circuit on a microcontroller in SimulIDE. As an example, we will use an LED graver on the Atmega328p MK. The LED is connected to pin PB0. The source code of the program is as follows.

#include <avr/io.h>
#include <util/delay.h>

#define LED_PIN PORTB0

int main (void)
{
   DDRB |= (1<<DDB0);
   for(;;) {
   PORTB |= (1<<LED_PIN);
   _delay_ms(1000);
   PORTB &= ~(1<<LED_PIN);
   _delay_ms(1000);
   }
}

This program should be compiled using avr-gcc in any way and obtain a HEX file. Now you can start modeling. We launch SimulIDE and place an MK, a 100 Ohm resistor and an LED on the circuit field, which we take from the left panel. MK are in the Micro group. We connect the components with wires. Editing circuits in SimulIDE is intuitive and there should be no problems with it. This results in the following diagram:

Circuit diagram for MK Atmega328p

Circuit diagram for MK Atmega328p

Now you need to specify the firmware file for the MK. To do this, right-click on the component and select Load firmware. Then select the HEX file. Now if the firmware is displayed in the component properties:

MK properties dialog

MK properties dialog

Now you can run the simulation. To do this, press the Power circuit button on the toolbar, and the LED starts blinking. The result is shown in the animated GIF below.

Circuit Simulation

Circuit Simulation

As you can see, the modeling process is extremely simple compared to the previously mentioned Qucs-S and LTSpice. But the simplicity comes at the price of not supporting real SPICE models and lacking full-fledged analog modeling.

Conclusions and my impressions

In my opinion, currently modeling PIC and AVR microcontrollers, which is implemented in SimulIDE, can have very limited use. If only this program had appeared 15 years earlier, there would have been no price for it. Now even radio amateurs are crawling to 32-bit MKs. In my homemade projects, I have already switched to 32-bit MKs. AVR and PIC are completely outdated in my opinion. I don’t see any particular advantages in making new developments on 8-bit. So for me personally SimulIDE is practically useless. But perhaps for those who continue to make devices on 8-bit MCUs, this simulator can simplify debugging. Well, SimulIDE will be very useful for use in the educational process due to its ease of learning and interactive simulation.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *