For my master thesis I've designed a board with an ATMEGA328P-AU as micro controller. enter image description here As I want to use some libraries and I like the simplicity, I want to use "Arduino" to program it.

Everything works fine to a point: I took an Arduino Uno and uploaded the "ArduinoISP" sketch. I connected the ISP pins and burned the bootloader with board set to "Arduino Duemilanove / Diecimila" - got the message, bootloader burned. I disconnected the ISP pins, took the ATMEGA out of its socket on the UNO board and connected the serial pins.

Here comes the problem I cant figure out:

Once I have done a above procedure I can upload a sketch and Serial communication is working. But I can only upload it once! The second time (no matter if during the same power-up or at another time) I push the upload sketch button, I get no response for several minutes (I once waited up to 10min to confirm there is nothing coming anymore :)). If I unplug either USB or the TX/RX cables I get the error (or for the USB cable something similar):

avrdude: stk500v2_ReceiveMessage(): timeout

avrdude: stk500v2_getsync(): timeout communicating with programmer

When I upload the bootloader again I can once again upload a sketch same as before. Then the same problem happens again.

I checked several question on Stackexchange already (specially all points in this one here) and googled the problem, but until now I am not able to find a solution.

As you can imagine it is quite annoying to always unplug the RX/TX cable and hook up the ISP cable again and burn the bootloader.

So my question: What could cause this problem and how can I solve it?

Btw. I am using the Arduino software version I'm using is 1.6.9

  • Did you change the fuses? What bootloader did you use? – Gerben Jun 19 '16 at 13:50
  • I didn't change any of the fuses. What do you mean, with "what" bootloader? Are there different ones? I burned the bootloader with the board set to "Arduino Duemilanove / Diecimila" in the Arduino 1.6.8 environment. – KarlKarlsom Jun 19 '16 at 14:02
  • How is your serial connection wired up? It's missing from that schematic. – Majenko Jun 19 '16 at 15:57
  • The 2 lines RX and TX just go to a 4pin pin header (for a cable with 4 wires, 5V, TX, RX, Gnd) – KarlKarlsom Jun 20 '16 at 3:38

There is a problem with your circuit and the way you have it wired when programming. You have failed to use the RTS line for Serial programming. You need to have that line connected to the RESET of the ATMega328, this is as the bootloader for programming ove rserial will not start if the IC is not reset. Also you should burn the Arduino UNO bootloader rather than the one you chosen.

Seems you clarified you were using the diode as ESD protection, thank you. It is the recommended arrangement if you have a capacitor attached to the reset line in noisy environments.

The circuit between the RTS signal and the Arduino RESET pin needs to be this:

 RTS >>----||------->> RESET(PIN1)

From the same "Have I bricked my Arduino" that you linked, about 3/4 down Nicks post he mentions the use of serial programming of an Arduino

FTDI    Arduino Uno

GND       GND  (black wire on FTDI cable, blue jumper wire)
CTS       not connected
VCC       5V
TxD       D0 (RX)
RxD       D1 (TX)
RTS       To RESET with a 0.1 µF capacitor in series with it (green wire)

What you can do if you don't have the proper serial programmer with an RTS output, you will have to manually reset the microcontroller to enter the bootloader just as the IDE says "Uploading...".

| improve this answer | |
  • Doh, how did I miss this... Let me give it a try. – KarlKarlsom Jun 20 '16 at 12:35
  • The diode is correct. Please see this application note, its for ESD protection. atmel.com/Images/… Also the Arduino boards are using it. arduino.cc/en/uploads/Main/Arduino_Uno_Rev3-schematic.pdf – KarlKarlsom Jun 20 '16 at 12:38
  • @KarlKarlsom I know its ESD protection but why. Have you got it in a ESD prone environment. I would possibly choose a diode then with a larger pulse current for the ESD protection. – RSM Jun 20 '16 at 16:44
  • 1
    sorry for the late reply and acceptance of your answer. I just now had the chance to test it! The missing reset connection solved the problem! However your suggestion using the UNO bootloader is not working. It says it burned the bootloader. But then I get a timeout when uploading a sketch. With Duemilanove selected as bootloader it is working! – KarlKarlsom Jul 3 '16 at 11:01

Replying to an old post: The Reset diode is not really ESD protection, it is there to shunt any high voltage spikes to Vcc to keep the chip from reacting to a high voltage and going into High Voltage programming mode, and then acting hung when there are further control signals to complete the sequence.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.