Arduino detected but program is not getting uploaded

Hi friends

The issue which I am posting here is not a new instance, it has happened few times before and I would like have some help on this topic and ensure if my predictions are right.

So to start with the board details, I am having a custom made arduino board with a cp2102 chip. The board supports both Atmega328 and also Atmega8. I am using an Atmega8.

The board works completely fine until I connect my arduino to my computer and also an external power source (connecting a common ground). And the question is, how to fix this. The program is not getting uploaded, but the board is detected.

My task was to turn on and off a relay board powered by a 12V DC adapter through command from my keyboard. So I had to use the serial communication for that. The program had no flaw. The program uploaded and when I tested with the onboard LED, using serial monitor, the programmed worked fine. But the moment when I connected the board to the relay board and connected the GND of the relay board with that of the Arduino, the arduino suddenly stopped working. After this the program is not getting uploaded.
I tried burning the bootloader too, but not successful. Now what should I do to fix this problem and how to tackle this grounding issue.

I hope my question is clear enough. Kindly help me with this issues as I have bricked nearly 5 microcontrollers so far :frowning:

Thanks in advance.

you should not connect any thing to TX & RX pin of controller while uploading code. you should try remove pins intially & then you can add while running

or

you can use any other avilable port provided TX & RX line are not occupied.

you should give us error report while upload code

i am guessing you might getting serial occupied error while upload.

No my tx and rx ports are not programmed and are neither connected. And about the error, i had no patience to wait for the IDE to show the error. It was simply showing as Uploading..... and it went on for nearly 10 minutes. The Rx led alone was flashing now and then.

is it possible to take screen shot of your uploading code.which version of iDE & on which OS u r using