Hi all, would it be possible to use an Arduino as a programmer?
I am building some different things, and i can't buy alwas a new Arduino for it. So i thought i could use an ATMEGA328 with the Arduino bootloader and plug it into my Arduino UNO and programm it.
After this it would be great if i could take it out, solder it on a PCB and use it like this. So I would only need a new ATMEGA328 for a new project.
Had somebody tried this yet? To setup an ATMEGA328 i would only need the right power supply and a resonator wouldn't i?
This is done all the time.
Buy yourself some components: 16 MHz xtal,two22 pf caps, 10k resistor, 3 100nF caps.
Put components and blank '328P on a breadboard.
Download "arduino as ISP" sketch into your arduino.
Connect:
+5 to +5,
Gnd to Gnd,
D13 to D13,
D12 to D12
D11 to D11,
D10 on arduino to Reset of the blank '328P
Run the sketch.
Nick Gammon has more detailed writeup here, the above sums it up pretty well.
In both cases I put one, or the other, or both, of these on my board: a 2x3 ICSP header, a 1x6-pin header to connect a USB/Serial adapter for downloading sketches.
You can see the headers on this atmega1284P protoboard
Thanks for the fast reply! :). I think what you post is a simple board to programm the ATMEGA, isn't it?
What i wanted to do was to use my Arduino as such a board and only take the ATMEGA and solder it onto a PCB.
So the crystal and the caps are the only things i need to set it up?
Yes, crytal, 22 pf caps, 10K pullup resistor on the reset pin. 100nF cabs on VC/AVCC pins highly recommended.
You can use a solderless breadboard to install the parts to program the blank chip, then move the newly programmed chip onto your board for soldering.
If you need to re-program it after soldering, having the headers makes that possible, such as on this board
Thanks a lot! I think I could put it back into the Arduino for reprogramming?
Oh the ATMEGA's from the arduino store is already a Arduino UNO bootloader.
So i think I won't need such a board. Or am I wrong?
You are not wrong. If bootloaded already, you only need the Serial port connections for downloading a sketch. Or put it back in the arduino for programming.
So I just need to load a program on it and wire it up like in the Link (second picture). And it will run?
And the other stuff on the website i need to burn the bootloader onto it?
If I would take ATMEGA's out of the Arduino Store I won't need this right?