I am writing code on Arduino mega. My current code is working fine. However, I'm not using all the pins.

My question is:

  1. I have the hex file for my code and I can purchase a Mega2560 MCU. Is there any way to upload the hex file to it and how?
  2. What are the circuits I would need to to build?
  3. Eagle files of the Arduino mega are available here. Is this circuit more than enough?
  • The Arduino circuit is overkill for production use. May 20, 2014 at 4:50
  • @IgnacioVazquez-Abrams I didnt understand what you are saying
    – AMPS
    May 20, 2014 at 4:52
  • Last time I checked, the chip on the Mega was SMD only; that's hard to solder, and would be difficult to load a bootloader on the chip soldered to some PCBs. May 20, 2014 at 21:13
  • 1
    @AMPS - I've rolled-back your recent edit on this question because it substantially changed the content (including going from a 2560 to a 328, which is a different chip entirely). Editing your question to clarify it is OK, but changing it entirely (especially after there is already an answer) is not OK. May 22, 2014 at 9:47
  • 1
    @but i found that if i post question eqicalent of that all saying replicate question. So i am changing here itself. Yes i accept fact IC are change.
    – AMPS
    May 22, 2014 at 10:06

1 Answer 1


If you buy an empty mega2560 IC. It won't contains any bootloader. That means that you need an extra circuit, a programmer, to upload your HEX file into your MCU. "When to use the bootloader" questions link

But, if you buy your mega2560 from an Arduino provider, you should be able to order the MCU with the arduino booloader already programmed. Then a simple serial link from your PC to your MCU will suffice to program the MCU with your Arduino sketch using the Arduino environment. You could clone the serial part that you have on the Eagle files of the original Arduino to do this.

In summary:

  • Programming an empty chip requires a programmer
  • Programming a chip that has a booloader requires either a programmer, or a simple serial link.

You may also use another Arduino with the suited sketch as a programmer and use it for programming another empty MCU. There are examples of this on the web.

  • There is Device avr pocket programmer if i use device and ISP . Is it possible to upload boot loader.
    – AMPS
    May 20, 2014 at 10:11
  • @AMPS yeah that should work.
    – sachleen
    May 20, 2014 at 17:05
  • @AMPS - if you already have an Arduino of some sort, you don't need to buy another board just for programming bootloaders. Some of those little programmers are based on software USB with diodes to approximate the USB electrical spec. May 21, 2014 at 14:08
  • @ChrisStratton How to dothis??
    – AMPS
    May 22, 2014 at 10:07
  • If you already have an arduino you don't need another ISP programmer but you'll be able to use your arduino with bootloader to burn a bootloader on a clean chip. Just follow the steps on this site. arduino.cc/en/Tutorial/ArduinoISP
    – Handoko
    May 22, 2014 at 17:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.