I had a AtMega328P that bootloaded and used for sometime. But recently I bootloded again forgetting that it was already bootloaded. I followed the standart Arduino as ISP procedure while I was bootloading it for the second time. But now when I try to upload code on the chip using FTDI adapter, it does not accept code giving me the error of:
avrdude: stk500_getsync(): not in sync: resp=0x00 (I guess this means something wrong with my bootloader because I checked my wirings billion times and changed the ports and reinstalled the IDE)
After it stopped accepting code I bootloaded it couple more time with the same technique. I also tried taking the chip out of an UNO board and programming my presumably corrupted AtMega328P with this UNO board. I also bought a USBasp module and tried programming my chip with it, it also did not work. But strangely the chip works when I plug it onto an UNO board itself.
I've been using Arduino but I've never learned much about the AtMega328 chip itself. Thus I'm new in microcontrollers and I don't know why this chip doesn't work after trying so many things.
What am I donig wrong? Am I wasting my time, is the chip already broken?
I would really really appreciate some insight on the many ways to burn bootloader to this chip and to program it.