Using Arduino Uno R3 to program Atmega328P

Well I have successfully built a shield for programming my Attiny85 chips using my Arduino Uno as the ISP. My question and where I am confused is how would I upload sketches to a stand alone Atmega328P chip? I had a friend that recently closed an electronics shop that gave me a butt load of these Atmega328P-PU chips. Same chip in the Arduino Uno. I just want to be able to write my sketches in the Arduino IDE and then using the Arduino Uno to send the sketch to the standalone chip. That way I can use the Atmega328P chips in my standalone projects. Is this possible to do? Thanks.

I use a Sparkfun FTDI BASIC for uploading sketches to my breadboarded OPTIBOOT ATmega328 . It is a 3.3V FTDI because I have two
Pro-Mini's, one 3.3V, the other 5V. I use the FTDI for uploading sketches to those as well so I am getting my money's worth for the FTDI. I can't help you with loading the bootloader into the ATmega328 but I've see tutorials on the net and there's lot's of folks here who know how to do that. The first person I would ask is Crossroads. He has a business making and selling Arduino related products so he would definately know. Also Nick Gammon (because he knows everything).

The approach of using the UNO as an ISP should work just as well for the 328P chips. If you're programming them through the ICSP interface like this, you aren't using the bootloader so you don't need to worry about burning one. However, you might still need to set the fuses (and the IDE usually does that during the process of burning the bootloader). If you want to be able to plug your 328P chip into the socket on the UNO and program it via USB, you'd need to put a bootloader on the chip first.

Well I don't really want to plug a 328P chip into my Arduino and program it then remove it for a standalone project. I just wanted to use the Arduino Uno as the programmer for a standalone 328P chip. I have already done this for an Attiny85 chip. I made a shield for the Arduino as well. I simply plug the shield on top of the Arduino and put the Attiny85 into the socket. Then I load my sketch into Arduino IDE and upload it to the Attiny85 using the Arduino as the programmer. I am wanting to accomplish this same thing only using the 328P chip in place of the Attiny85. Does this make more sense?

Use Nick Gammon's Arduino as ISP to load the fuses for 16 MHz external oscillator, then burn a bootloader so you can download sketches via serial port.

If you have a lot of chips and plan to do a lot of projects, then an Atmel AVR ISP MKii programmer is a great tool.

I use mine all the time for 328Ps, 1284P, 2560s.

Thanks for the responses. I still don't think anyone understands what I am trying to do here. :disappointed_relieved: :frowning:

You need to put a sketch onto a chip.
There are multiple ways to do that.
I personally would just put the chip into your project, have the project have an appropriate ICSP and/or FTDI header, and program it rigtht in place.
If you want to program outside of your project, go right ahead.
You need the fuses set to agree with your project hardware- internal oscillator? external oscillator? Speed? Etc.

I just plan on using the internal 8 MHz of the 328P. I don't see why I should have to burn a boot loader onto the chip if I am not going to be using inside the Arduino Uno. I just want to build a shield just like I did for my Attiny85 chips and then program the 328P chips with my desired sketches using the Arduino Uno as the ISP. I have a laptop with no serial port so there is no point in buying a $39 programmer when I can just use my Arduino. I literally have hundreds of these 328P chips and like I said would be nice to pop one into a DIP socket within a proto board and use the Arduino to program them. Then when my sketch is on the chip I can simply pop it out and use it in my circuits.

Well, 8 MHz needs a fuse change - as delivered from the factory, they are set to 8 MHz and divide by 8 fuse is set for the clock, so they run at 1 MHz.
To set the fuses, you need to control the ICSP lines - Reset, SCK, MISO, MOSI.
Up to you how you do that.
I have no problem with no bootloader and starting the sketch after a reset.
To do that, you need to load the sketch via the ICSP lines.

The MKii programmer is run from USB port, not serial - if you say Serial that is generally understood to mean a 9-pin RS232 type port, just to stay in synch on terminology.

Take a look at this post

or this one

You can design your shield from the info on this post .

FallenDemon:
Thanks for the responses. I still don't think anyone understands what I am trying to do here. :disappointed_relieved: :frowning:

I don't understand why you say that. I thought your original post was pretty clear, and that's what I responded to. If you aren't trying to upload a sketch via ICSP using an Arduino as an ISP then perhaps you ought to start again and explain your question more clearly.

My question and where I am confused is how would I upload sketches to a stand alone Atmega328P chip?

I think your question has been answered several times over...
I don't know what else more you could ask for in an answer to that question.