Arduino Simulation with Proteus
We 'll show how to simulate the celebrated open-source electronics prototyping platform Arduino with Proteus .You can find other informations, project files and arduino software at itshomepage.
Let 's run ISIS Schematic:
To simulate the core of Arduino platform we need only a few components: the atmega328P Microcontroller, a Crystal and two Capacitors.Let' s look for these devices in the library:
Click on "P"button and write atmega as keyword:
Double click on the model and this appears under Devices panel:
Same operations for the Crystal and Capacitor:
Now we have all the components in the panel Devices:
Let 's click on the components and place them on the layout:
Right click on the component and select Rotate ..to place it correctly:
Double click on the crystal and set the frequency to 16Mhz:
Double click on capacitors and set the values:
Let 's start wiring the circuit:
Click on "Terminals Mode" on the left toolbar and select the ground reference
Nowselectthepowersource
Connect the pins to the power source as in the picture below:
Finally we get the Arduino schematic:
After downloading the software from the Arduino site run the program:
TheArduinomainwindowappears
Let 's choose to load the blink example from File menu:
The window shows the C code of the program:
This program simply turn on and turn off a led with a period of 1 second for every function.Let's save the program in a directory of our choice:
The program is saved in pde format:
Come back to the program and click on the Verify button to check the correct syntax:
Once the syntax has been verified make sure that "ArduinoDuemilanove or Nano w/ ATmega 328" is selected from Tools/Board menu:
Now click on the Upload button
At the end of the process an error message appears, because Arduino board is not connected, we can ignore it:
Instead make sure that applet directory has been created in the directory of the pde file:
Let's open applet directory and we can see the hex file generated:
Now come back to the Arduino schematic and double click on the microcontroller, in the window that pops up select the hex file:
Selectthefollowingsettings:
We' re ready to simulate.Click on play buttoninthe bottomleft cornerof thelayout:
license VSM for AVR is required to enable the simulation.As result of running program the pin 19 of microcontroller start blinking with a period of 1 second