Uploading a skectch into atmega328 that has uno bootloader and is in circuit

Hello,
I managed to burn Uno bootloader into a plain atmega using the my Arduino Mega1280 and the arduino as isp tutorial. Now I have a gadget were the arduino is located and would like to upload sketches using the Uno board. Am I wrong or shouldn't this be possible by just removing the atmega from the uno board and connecting reset, tx,rx,+5,GND to the chip that is on the gadget.

I think this would be a pretty easy way to get the code into the gadget.

Any ideas?

Best Regards,

Tomas
ps Images are nice so I atached a picture of my RGB led light prototype.

Now I have a gadget were the arduino is located and would like to upload sketches using the Uno board. Am I wrong or shouldn't this be possible by just removing the atmega from the uno board and connecting reset, tx,rx,+5,GND to the chip that is on the gadget.

I think this would be a pretty easy way to get the code into the gadget.

Yes, it is that simple and should work fine. Even simpler is to just plug a jumper wire between ground and the reset pin on your UNO. That will hold the chip in reset mode, but still leave the tx,rx,+5, and ground pins free to wire to your standalone UNO chip.

Lefty

I'm thinking what you guys are describing is, e.g., the breadboard circuit in this tutorial (with arduino pin 10 to reset, and pins 11, 12, and 13 the serial programming pins) am I right?:

If so... I'm a little confused on what exactly is happening differently (in context of Arduino-as-ISP) between writing programs to the chip on the Arduino board vs. writing programs to the external chip?
I'm guessing it's related to Reset... what precisely is the function of reset here?

Based on what I've understood, reset serves to trigger the microcontroller to re-initialize, thus be open to (with the original bootloader still in place) new uploads, or if nothing is incoming, just lets it re-run the existent program in its memory. So, when @retrolefty suggested grounding the Reset pin on the arduino while loading programs to an external chip, what does that do?
(Reset is active low based on datasheet, so I understand somewhat...)

(deleted)

retrolefty:

Now I have a gadget were the arduino is located and would like to upload sketches using the Uno board. Am I wrong or shouldn't this be possible by just removing the atmega from the uno board and connecting reset, tx,rx,+5,GND to the chip that is on the gadget.

I think this would be a pretty easy way to get the code into the gadget.

Yes, it is that simple and should work fine. Even simpler is to just plug a jumper wire between ground and the reset pin on your UNO. That will hold the chip in reset mode, but still leave the tx,rx,+5, and ground pins free to wire to your standalone UNO chip.

Lefty

From my experience you also need a jumper wire from the Uno board reset to the reset pin of the stand alone chip. So leaving the chip in with a jumper from between GND and reset wouldn't work. I take the chip off the board. But like I say ....... that's my experience! Maybe I'm just about to learn a simper way of doing this?

giantsfan3:
I'm thinking what you guys are describing is, e.g., the breadboard circuit in this tutorial (with arduino pin 10 to reset, and pins 11, 12, and 13 the serial programming pins) am I right?:
http://arduino.cc/en/Tutorial/ArduinoISP

No it's not.

It's more like this http://arduino.cc/en/Tutorial/ArduinoToBreadboard Look at the Uploading Using an Arduino Board section.

You take the Arduino as ISP to put the bootloader on the chip.
After the chip as a bootloader on it you don't need an ISP anymore (that's why you can put stuff on the chip on the Uno board without needing another board.)

So when you have an external chip with a bootloader. You put your sketch on it the same way you put it on your board. Except it's not ON the board, it's off the board with a couple of jumpers....so the Arduino IDE doesn't know it's off the board.......and it doesn't care!

spycatcher2k:
click upload on IDE
wait for sketch size
tap std reset quickly

OK, so this is how you guys are doing it!

But by jumping the 2 resets together I just let the IDE reset when it needs to reset.

You just gave me an idea! What if I cut the RESET-EN trace and replace it with a 2 pin male header.
When I want the board to act normally I just put a jumper connecting the 2 pins of the RESET-EN.
When I want to load stuff to and external chip. I remove that jumper, connect a jumper to the live side of the RESET-EN and to the reset pin of the external chip. And also put a jumper between the board reset and GND to desable the on board chip.

This should work! No?

(deleted)

Cool, so what exactly is happening exactly when I did the following?

--I left arduino's atmega on the arduino just as it is, throughout the following steps...
--insert standalone atmega on breadboard
--connect up the circuit as shown in ArduinoToBreadboard tutorial (i.e., with SCK, MISO, and MOSI pins of arduino and of standalone atmega chip connected to each other)
--reset pin of standalone atmega chip (datasheet pin #1) with pull-up resistor, as well as a cable to pin #10 of Arduino (which is used in the ArduinoISP sketch for slave reset)
--arduino reset pin never handled by me (i.e., left open)

--I loaded ArduinoISP sketch to arduino
--burn bootloader using ArduinoIDE's Tools > Burn Bootloader command.
--then use AVRdude to load a hex file, e.g. avrdude -c avrisp -p m328p -P com3 -U flash:w:Blink.cpp.hex

The visible result is that everything worked fine... the Blink program is indeed uploaded, as I checked by placing an LED on standalone atmega chip.

But is there anything wrong with this approach of uploading code to the standalone chip? (i.e., with Arduino's atmega chip and reset pin left untouched, and shorting MOSI, MISO, and SCK pins between Arduino and standalone atmega chip)
I guess my question is...
What is the difference between that approach VERSUS the other approach discussed in this thread (i.e. where we first remove the Arduino Atmega chip from the board and ground Arduino's reset pin and then upload to standalone chip via ArduinoIDE/AVRdude with the RX and TX pins cross-connected?

(deleted)

this works super well for me, spycatcher2k. although the timing of tapping the standalone atmega chip's reset has to be really on the mark!

Question:
what could be a way we can make this self-controlled? so that you can keep the atmega chip on the arduino ISP and still not have to manually mess with the standalone atmega chip's reset wire each time to be programmed.

spycatcher2k:
To upload to your standalone :
(ard - Arduino & std - stand alone)

ard rx - std tx
ard tx - std rx
+5 to +5
gnd to gnd

no power on std
short ard reset to ard gnd

remember to select the type of chip you are uploading to
click upload on IDE
wait for sketch size
tap std reset quickly

Drew.

(deleted)