Uploading .Hex files to atmega MCU

Hi,

With an FTDI adapter I am able to upload C language scripts to a atmega328p or compatible MCU using the Arduino IDE. But, I still haven't figured out how to upload the assembly code (.hex file generated by Avr studio or Atmel studio) to a MCU only. With xLoader it is easy to upload the .hex file to an arduino board.

I do have some experience with assembly (interrupt handling, adc, polling and so on) and, for certain applications I prefer to go with the machine language instead - usually there's no need to add any libraries for small ideas/programs. Not to mention that I really enjoy controlling every bit the MCU handles, such as for data transmission to a LCD display.

Story short: how to upload the .hex file to atmega328p MCU or equivalent?

Can I still use the FTDI adapter? Is it possible using arduino IDE but to upload only the .hex file? How do I do it?

the arduino ide uses the avrdude program to upload the .hex files to the arduino board. so if u have a compiled .hex file you could download avrdude from here AVR Downloader/UploaDEr - Summary [Savannah] or use the gui version of the avrdude aka avrdudess from here AVRDUDESS – A GUI for AVRDUDE | Zak’s Electronics Blog ~* and yes you could use your ftdi in combination with avrdude to upload the .hex file

you could use this command to upload the .hex file with avrdude

-c ft232r -p m328p -P COM5 -e -U flash:w:".hex":a

just change the COM number and specify the hex file including the directory

this is for atmega328p to change it specify the mcu in the command line just google for it.

hope it helps you. :slight_smile:

Avrdude is included in the Arduino IDE.
You are not uploading C language scripts, C lanuaguge is neither scripting language and .HEX is not assembly code. C source code is compiled and translated into machine code and coded into .HEX. Arduino IDE uses .HEX (Intel hexadecimal format) image which is uploaded with avrdude tool. If you switch on detailed log in preferences for uploading, you will see actual avrdude commands for uploading. This is good hint how to use avrdude. See also its help.