Kamis, 26 Juli 2012

Arduino Simulation using Proteus

This post will teach you how to simulate arduino sketches using proteus.
The sketch will be written using arduino 0017 edition and you can download it from the following link :
http://arduino.cc/en/Main/Software

We will simulate a simple sketch which flashes a LED.

Here is the sketch to be  :
// example 01 : blinking an LED
const int LED = 13;   // LED connected to pin 13
void setup()
{
  pinMode(LED,OUTPUT);
}

void loop()
{
  digitalWrite(LED,HIGH);
  delay(1000);
  digitalWrite(LED,LOW);
  delay(1000);
}

Steps :

1- After writing the sketch press verify to compile the code.
     (Be sure to select  arduino duemilanove or nano w/atmega328 board from tools tab )
2- And you will find that a new folder named applet has been created this folder containing the .hex file to be simulated using proteus.
3- Build the following schematic using proteus as shown in the following figure :
    ( The crystal used has a frequency 16Mhz)

4-Double click on the microcontroller to load the hex file.
5 Then adjust the CKSEL and clock frequency as shown in the following figure :

Here is a link containing the arduino files and the simulation file :
http://www.mediafire.com/?t2i8s2x4346fnyf\

Download this tutorial in PDF HERE

0 komentar:

Posting Komentar