Bin file burn on adrino mega 2560

i want to know how to burn direct bin file to adrino mega with isp pin plz guide me

Hi @haseebgatal. A good way to get started on this is to let Arduino IDE generate the base command for you:

  1. Select File > New Sketch from the Arduino IDE menus.
  2. Select Tools > Board > Arduino AVR Boards > Arduino Mega and Mega 2560 from the Arduino IDE menus.
  3. Select your ISP programmer from the Tools > Programmer menu in Arduino IDE.
  4. Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
    The "Preferences" dialog will open.
  5. Check the box next to Show verbose output during: ☐ upload.
  6. Click the "OK" button.
  7. Select Sketch > Upload Using Programmer from the Arduino IDE menus.
  8. Wait for the "Upload Using Programmer" operation to finish or fail.

Now examine the contents of the black "Output" panel at the bottom of the Arduino IDE window. You will see the avrdude command Arduino IDE generated for flashing the compiled sketch binary to the board.

For example:

"C:\Users\per\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude" "-CC:\Users\per\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf" -v  -patmega2560 -cusbasp -Pusb "-Uflash:w:C:\Users\per\AppData\Local\Temp\arduino\sketches\D84308DA25B691C55A31BCB0E4C30A1C/sketch_dec10c.ino.hex:i"

You can copy that command, make the necessary adjustments, then run it directly from a terminal.

You can learn about the AVRDUDE command line arguments here:

Give it a try. If you have any problems or questions while doing that, come back here with a detailed description of the specific problem or question you had and we'll help you out.

i just have bin file from my friend . i dont have hex file

how how to select bin file because when i browse bin file cant see

Can you please post the full error message (using code tags as described in How to get the best out of this forum).

Right click in the output window, click "select all" and past it here between code tags.

Screenshots of errors are useless.

See How to update my program by uart? - #18 by Budvar10 how to upload a bin-file instead of a hex-file

Change the last i in the command that @ptillisch showed to an r so it looks like below.

"C:\Users\per\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude" "-CC:\Users\per\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf" -v -patmega2560 -cusbasp -Pusb "-Uflash:w:C:\Users\per\AppData\Local\Temp\arduino\sketches\D84308DA25B691C55A31BCB0E4C30A1C/sketch_dec10c.ino.hex:r"

I do not know for which board your friend compiled the code; the Arduino IDE defaults to hex files for a Mega. If your friend compiled for e.g. a Due, the code will not work.

You will need to run avrdude from the command line, you can not upload using the IDE.

i have avrdude that only support hex file

C:\Users\Dell\AppData\Local\Temp\arduino\sketches\33B683E0EAE5BE29456EF95653B9A362/sketch_dec11b.ino.hex

How do you know? Have you tried with the format option r as shown in my previous reply?

how to do option r i dont understand

It is simple. Instead of this,

it should be
"...sketch.bin:r"
You have bin file, right? Use the command line.

I forgot mention, there is also bin2hex utility available on the web, just search. It is another option for you.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.