HOW TO GET HEX FILE FROM ARDUINO ???

HOW TO GET HEX FILE FROM ARDUINO ???


Hello friends, hope you all are fine.Firstly I am wishing you a Happy New Year. In today’s post, I am going to share How to get Hex File from Arduino.If you have worked on PIC Microcontrollers or Atmel etc then you have seen that you always get hex file from their compilers and then you burn that hex file in the respective microcontroller using their programmer or burner. But that’s not the case with Arduino. In Arduino boards, you simply plug it into your computer and you hit Upload button and the code automatically gets upload in Arduino boards. It doesn’t create any hex file.There are many cases when hex file is required. For example, instead of using Arduino board you just want to use the ATmega microcontroller then the easiest way is to write the code in Arduino and then get its hex file and upload it in your microcontroller, which makes the task quite easy. Another example is Proteus simulation, when you want to simulate your Arduino board in Proteus software then you need to get the hex file so that you can upload it to your Arduino board.

Let's Start, Follow the Steps:

  • First of all, open your Arduino software and write your code and test it.
  • Once you are confirmed that your code is ready and you want to generate the hex file, then click on File option in the above menu and then Preferences as shown in below figure:

  • In the above figure, I have used the example of LED Blink and I am gonna generate its hex file.
  • Now when you click on the Preferences, a new window will pop up.
  • In this new window, tick the compilation option as shown in below figure:


  • After ticking it, now click on the OK button and this dialog box will close.
  • Note:

  1. By ticking this option you are allowing the Arduino software to show verbose outputs in the output panel present at the end of Arduino software, which has a black background.
  2. So, you can also tick the upload option but you need to upload the code to get these output commands.

  • Now hit the compile button as we tick the compilation option, so it will compile the code and will give you all the commands as shown below:

  • Now you can see clearly in the above figure that there are many commands in the black portion, these are the verbose outputs which Arduino is giving us.
  • The last line of these outputs, which I have also indicated the link to your hex file, which in my case is:
         C:\UsersSachin\AppData\Local\Temp\arduino_build_336145/sketch_aug14a.ino.hex 
  • Now, remove the name of the hex file from this link and it will become: 
         C:\UsersSachin\AppData\Local\Temp\arduino_build_336145
  • Paste this link in the computer address bar and this folder will open up.
  • In that folder search for your respective file and you easily get the hex file of your code.

Note: 

Actually, while uploading the code to Arduino boards, Arduino software creates the hex file of the code in the temporary folder and once the code is uploaded then it deletes that hex file, that’s the reason we don't get the hex file, but by clicking the option you can easily get the hex file and then can use it for any purpose.

Thank You 


Comments

  1. Titanium Arts – Home of the Iron Necklace
    In ancient Egypt, babyliss pro nano titanium curling iron the Titanium Arts Museum was one of the titanium grades oldest and most revered art grade 23 titanium and crafts in Mesopotamia. columbia titanium pants The titanium white paint museum was built to showcase an

    ReplyDelete

Post a Comment

Popular posts from this blog

HOW TO USE USE ULTRASONIC SENSORS IN PROTEUS ?

ARDUINO LIBRARY FOR PROTEUS AND HOW WE CAN USE ???