Programming an Arduino using the serial port

Generally the Tools > Programmer selection is only used for Tools > Burn Bootloader and Sketch > Upload Using Programmer and is not used for standard uploads.

“Programmer” setting

For standard uploads you can set Tools > Programmer to anything you like because it will have no effect.

Using an Arduino UNO for serial port programming other Arduino IC’s

A nice and simple way to do it as the UNO has a removable ATmega and the reset pin as well as the UART TX and RX pins.

Remove the ATmega from the UNO.

Connect as follows:

UNO PinDevice Being Programmed
0V0V
RESETRESET
IO0RX (programmer TX)
IO1TX (programmer RX)

Note UNO marked RX pin is uC RX even though the PCB arrow is confusing (it is not connected other device RX)

Using a FTDI cable for serial port programming

Works fine but you need a to implement the reset of the microcontroller. Its often simpler just to use an Arduino UNO (for 5V parts) with the microcontroller removed and connect the GND, RESET, TX and RX pins, like here.

Automatic reset

Connect the FTDI cable DTR via 100nF capacitor to to the arduino microcontroller reset pin.

Manual reset

You can pull reset to GND yourself, say using a button on your PCB or the reset button on an Arduino board. There’s a nack of when to release it, its a bit of a bodgit solution, but it can work fine. Releasing as soon as the Arduino IDE says “Uploading” can work, with maybe another press needed once it says “Done uploading” to make the program run.

If the Arduino microcontroller is not reset when trying to program you’ll likely get an error message like this:

avrdude: stk500v2_ReceiveMessage(): timeout
USEFUL?
We benefit hugely from resources on the web so we decided we should try and give back some of our knowledge and resources to the community by opening up many of our company’s internal notes and libraries through mini sites like this. We hope you find the site helpful.
Please feel free to comment if you can add help to this page or point out issues and solutions you have found, but please note that we do not provide support on this site. If you need help with a problem please use one of the many online forums.

Comments

Your email address will not be published. Required fields are marked *