# AVR programming

This question might be asked somewhere, if so all references would be appreciated.

Hello, I have programmed Atmel chip Atmega32U4 through USB. It is possible because it supports USB programming. I used for that Atmel Studio to create the hex file and then I used Atmel FLIP to get it onto chip. It works very well and it is easy to do. I haven't used any other method so far. Now I want to program Atmega328P and I want to do it through some outer programmer like USBtiny because it seems like Atmega328P won't support through USB programming. Anyway I don't have any programmers, but i have Arduino. So I thought how can I use Arduino to program the chip. I been googling for a while and what I found is only teaching how to make chip basically like Arduino. So I burn the bootloader and I can upload Arduino sketches. But I don't want that. Whole point is to get rid of Arduino. I want to upload hex file directly to chip. And now it gets a little complicated for me. I have read about AVRdude, it should be possible with it. I also read someone said AVRdude is worst program. My question is, what are my options? Can I use some fancy graphical software like Atmel FLIP? Can I use FLIP somehow? Thanks for your time.

• Actually, you can program the 328 through USB. Someone has made bitbang USB for the AVR. Aug 5, 2018 at 12:35
• You can program the chips using an SPI interface. Look on the internet for AVRDUDE. AVRDUDE runs on many platforms. e.g. a Raspberry-Pi. p.s use capital I not i in your text (just pretend you are very important. :-) Aug 5, 2018 at 12:54
• Search term: "ArduinoISP" Aug 5, 2018 at 13:02
• Yes, im aware of AVRdude through SPI. Im looking for alternatives. Aug 5, 2018 at 13:52
• Buy an "AVR-ISP-MK2" or compatible, then you can use it with Atmel Studio directly. Aug 5, 2018 at 13:54

You can use the same techniques documented for loading Arduino sketches, to load traditional non-Arduino AVR projects. This is because all the Arduino system does is pre-munge the source files, feed them through tools from an ordinary avr-gcc to produce a hex file and then uses avrdude (or in a few cases something else) to command the programmer.
So for example, the writeups you found on using an Arduino-as-ISP sketch on an existing Arduino to program an ATmega328p on a breadboard and turn it into an Arduino would work fine. You would just run avrdude yourself to load your own .hex file, instead of an Arduino sketch or bootloader.
avrdude is of course a complex program with many options. The easiest way to figure out how to use it is to cheat: Open up the Arduino IDE, enable verbose output in an options menu somehwere, and then use it to program your board. Then simply select and copy the avrdude command line, and modify the name and location of the .hex file. This is particularly true if you use the copy of avrdude and configuration files for it installed by the Arduino IDE.