Generally in Embedded programming you create the HEX file after compiling the C code .This Hex file is fused on to the Microcontroller for use in applications.For e.g for a PIC microcontroller you use MPLAB IDE to build the HEX file from C code .

But in case of Arduino , you may not even know that the IDE is generating a HEX file.The process is hidden and you just Compile & simply Upload.

If you’re using Proteus  Design Suite for simulation of Arduino , you need to use the HEX file .Here is how to retrieve the HEX file generated by Arduino IDE.

Open the Arduino IDE & go to File –> Preferences

prob6

 

Check mark the box against “Show verbose output during Compilation” & click OK.

Verbose output will print debugging messages.It will print the complete command line of each external command executed as part of the build process.

prob7

 

Open the sketch to compile.

Now instead of simply clicking on the Tick mark to Verify  press

 

SHIFT  +   Image 1       or        CTRL+  Image 1

 

Image9

Now you can see the build process messages at the bottom of the IDE (black area for messages).

The last but one line before Binary sketch size is the path to the HEX file.

 

prob9

Here the Path is

  C:\Users\UserName\AppData\Local\Temp\buildxxxx.tmp\Blink.cpp.hex

 

Image 10

 

Image 11

Copy the HEX file & store in a different location to use in Proteus.In upcoming posts we shall see how to install Arduino inside Proteus & link this Hex file for Simulation.