For my master thesis I've designed a board with an ATMEGA328P-AU as micro controller. 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