Replacing the ATMEGA328P IC

Hello
I have a problem when I try to upload a program to a UNO board
and the error is
Arduino: 1.6.12 (Windows 7), Board: "Arduino/Genuino Uno"

Sketch uses 928 bytes (2%) of program storage space. Maximum is 32,256 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2,039 bytes for local variables. Maximum is 2,048 bytes.
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0xe5
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0xe5
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0xe5
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0xe5
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0xe5
avrdude: stk500_recv(): programmer is not responding
Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0xe5
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0xe5
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0xe5
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0xe5
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0xe5

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

,if I replace the IC with a new one would be solved my problem?

Maybe :wink:

Did you select the correct port?
Did you select the correct board?
Does the loopback test work correctly?

Although I'm not the specialist, I'm just asking in case you overlooked this.

If you have a programmer or a second Arduino, you can try to burn the bootloader and see if it solves the isssue.

If not, you can buy 328P chips with a bootloader.

I replaced the IC with the new one but it doesn't work!

Was the new one advertised as having a bootloader? If not, did you burn the bootloader to the new IC?

No I didn't

is it wrong doing? I mean by replacing the new IC and uploading to the arduino the new IC might be damaged?

koronus:
No I didn't

If the ATmega328P wasn't sold as having a bootloader, then you need to burn a bootloader to it before you will be able to upload. To do this, you need to connect an ISP programmer to the ICSP header on the Uno, select the correct programmer from the Tools > Programmer menu, and then click Tools > Burn Bootloader.

If you don't own a dedicated ISP programmer, you can use a spare Arduino board as an "Arduino as ISP":
https://www.arduino.cc/en/Tutorial/ArduinoISP
You may need to put a 10 uF capacitor between reset and ground pins on the Arduino as ISP programmer, as is shown on the Mega in that tutorial but not on the Uno.

If you want to buy a dedicated programmer, I recommend the 6 pin USBasp. You can get them very cheap on eBay if you don't mind waiting for shipping from China:

koronus:
is it wrong doing? I mean by replacing the new IC and uploading to the arduino the new IC might be damaged?

No, no damage. It just won't work until you burn the bootloader.

pert:
If the ATmega328P wasn't sold as having a bootloader, then you need to burn a bootloader to it before you will be able to upload. To do this, you need to connect an ISP programmer to the ICSP header on the Uno, select the correct programmer from the Tools > Programmer menu, and then click Tools > Burn Bootloader.

If you don't own a dedicated ISP programmer, you can use a spare Arduino board as an "Arduino as ISP":
https://www.arduino.cc/en/Tutorial/ArduinoISP
You may need to put a 10 uF capacitor between reset and ground pins on the Arduino as ISP programmer, as is shown on the Mega in that tutorial but not on the Uno.

If you want to buy a dedicated programmer, I recommend the 6 pin USBasp. You can get them very cheap on eBay if you don't mind waiting for shipping from China:
usbasp 6 -adapter for sale | eBay

No, no damage. It just won't work until you burn the bootloader.

ok thank you so much