Let's Make Robots!

Using an Arduino as USB-TTL serial link, with automatic reset of the target

AttachmentSize
Arduino_as_USB_TTL_with_reset.pde826 bytes

When uploading code to a home brew Arduino clone, one of the magic tricks are to the the target chip to reset at the right moment. Usually the challenge is to detect when the serial or USB interface between computer and target goes up, and then reset the target at that exact moment.

The Arduino folks described a method to do that where they simply use an Arduino board, remove the AVR there and then wire up the external target avr to the board, using the Arduino USB interface alone. Removing a 28pin chip without the proper tool involves the rick of breaking a log or two on the precious original Arduino AVR chip. Their guide is here: http://arduino.cc/en/Tutorial/ArduinoToBreadboard

I have "invented" method to do the same, but without the need for removing anything from the Arduino board. Instead of disabling the Arduino by removing the chip, I have written a small sketch that makes the Arduino silent on the serial interface while still listening for trigger-reset condition. While the sketch runs in "ready for new upload" mode it will blink pin-13 led slowly, to indicate that it's alive and ready to party! At the moment the method has only been tested on my Arduino Duemilanove, but I expect it to work elsewhere too.

After loading the sketch to the Arduino we block it's own automatic reset circuit. This han either be done by putting a 22uF, or similar, cap between reset pin and a gnd pin (remember to polarize it correct). Alternatively, if no suitable cap can be found, a simple wire between reset and vcc can be used. This method have one major disadvantage! If you press the reset button on the Arduino you will short your USB bus!!! You have been warned.

Now you are ready to wire up the connections between Arduino and target AVR.

  • Arduino gnd goes to AVR pin.8 and pin-22
  • Arduino vcc goes to AVR pin-7 and pin-20
  • Arduino pin-0 goes to AVR pin-2
  • Arduino pin-1 goes to AVR pin-3
  • Arduino pin-2 goes to AVR-pin-1

Notice that all but the last wire (reset) are the same as in the original Arduino guide linked above.

Now go and upload "blink" to the target, while doing so, the Arduino led will blink fast.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Gareth's picture

Thanks for documenting this method......  I have only used the ATBreadboard version....(that has some strange qwerks).

Will try this way when i get some more virgin Atmels.

 BTW :- keep your Crystal leads as short as possible ...... or they will pick up more than "Dust" from the ether

mogul's picture

Yeah. I have added a ether dust clamping resistor on the rx side. dunno if it will help anything there.

mogul's picture

I should mention that the normal xtal and two caps used for oscillator has been left out from the schematic for simplicity reasons. (ok, bad excuse. I forgot them and now I'm too lazy to make a new drawing.) Thanks goes to Bajdi for pointing out!

Bajdi's picture

I can confirm that this works :)