Sketch load error Atmega168

Hi guys!

I've been working with my Arduino UNO R3 and an Atmega168-20PU (choosing Arduino Diecimila as board to load the program) because I hace a PCB designed to work with it, so I just use Arduino to load the program in the microcontroller.

Suddenly, when I switched the ATmega to to upload another version of my program, the onboard led dinidn't blink as it used to when it recognized the Atmega, and I can't upload programs anymore. The error I get is the typical sync error: no initial serial response from the ATmega. However, if I swicth the ATmega168 to an ATmega320 (selecting Arduino UNO board this time to upload the program properly) it DOES recognize it, and I can upload any program without problems.

I considered the ATmega being broken, but I bought another one and the issue is still the same.

Any ideas would be helpful. Thanks in advance,

I'm not sure that I understand your question. Does your ATmega168 has a Diecimila bootloader ? How did that bootloader get in the ATmega168 ?

I think the other microcontroller is a ATmega328P ? And that has the Uno bootloader ?