Simulating Arduino in Proteus VSM


6 Comments  →
   by Dost Muhammad Shah    6 Comments  →
 This is an old post which I am reposting… also check Simulating Arduino Mega2560 in Proteus.

Arduino platform is a great tool for everyone who wants to play with microcontrollers in a simple and inexpensive way. It offers perhaps the quickest and easiest ways to do cool stuffs with its rich built-in library and easy to grasp interface. It’s also open-source and for this reason there are many open-source projects with it in the Internet. I have personally enjoyed it a lot. Although Arduino is pretty popular amongst many users, there is no good simulator software for it. Proteus VSM, on the other hand, is a very good circuit simulator software. However it lacks a model or simulator primitive for Arduino. Thus simulating Arduino in Proteus is in a way impossible. If these powerful tools can be synced together then a lot of new possibilities will arise. This is what I wondered from day one of Arduinoing. In this doc we will discuss how to integrate these software and simulate Arduino in Proteus.In Proteus we need to add a .hex or .coff file in a micro in order to simulate its behaviour. However Arduino works with .ino or .pde files and the folders that hold Arduino sketches don’t contain .hex or .coff files. Thus there’s no straight way. Now if there’s no straight path then we have to go around.Firstly we have to make a suitable Proteus schematic like the one shown. You can also download a template provided at the end of post.

RECOMMENDED READ  Energy Monitor Shield -- Monitoring System with Nokia LCD Screen
405495_1826120830872_733664937_nOnce the schematic is completed, we have to set the fuses and clock frequency as shown

429053_1826118790821_849601661_n

Our schematic is ready for Arduinoing. Now we need to upload code for the Arduino in Proteus. To do that we will firstly need to change our folder options in a way that hidden files are no longer hidden. In Windows OS, we have to go to Control Panel and then click Folder Options icon. When the Folder Options window opens, we need to click the View tab and select “Show hidden files, folder and drives”. We must now apply the changes and exit the Folder Options window. We are now just one step behind completing our goal. At this point, we have to open the Arduino IDE and save our sketch at our desired location with our desired name. This is however not mandatory. In our example, we have used the ready-made Blink example provided with the Arduino IDE.

RECOMMENDED READ  Asterix for Banana Pi (FreePBX img file for Banana Pi included)

401401_1826119030827_1361340838_n

It’s necessary that no Arduino board is connected to the PC where we will do the simulation or if it is connected we have change port settings in the IDE so that the code is not uploaded to the board. Next we hit the verify and upload buttons of the IDE. At this point we will be getting an error. This is okay and we are looking for this error. When this error happens, we will get the folder location of the hex file that was about to be uploaded.

400390_1826119910849_565876858_n

We have to navigate to this place and find the .hex file. We can copy it to any preferable location and load it in our previously made Proteus schematic of Arduino. If we don’t copy it and save elsewhere it may get lost

RECOMMENDED READ  easyavr.h Header file for pin/port operations

424955_1826120470863_386550022_n

Once it is loaded and the simulation is run we can see it is working fine.
405495_1826120830872_733664937_n

I hope it will be useful for all Arduino lovers and thereby bring a new era in Arduinoing.

Arduino Proteus Simulation Templates provided by Shawon Shahryar


Leave a comment
  1. Pingback: Simulating Arduino Mega2560 in Proteus. | dms

Leave a Reply