I am using an USBasp programmer to program my ATMega328P. Whenever I try to upload a program or try to burn a bootloader, it shows the following error:
Binary sketch size: 1,084 bytes (of a 32,256 byte maximum)
avrdude: error: programm enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
I have checked all connections and everything is correct. Please help me.
Whenever I try to upload a program or burn a bootloader, the LED under 'R' blinks and goes off.
Sounds like the system clock on your ATmega328p is not running. Did the chip ever have an Arduino bootloader? If so, did you connect the 16 MHz crystal and load capacitors?
Another possibility is that the fuses are set to disable the Reset pin (to allow it to be used for digital I/O) or to disable serial programming. If so you will need a High Voltage Programmer to reset the fuses. Something like the High Voltage Rescue Shield.
I don't think the chip had ever got an Arduino bootloader. I got it from eBay. I don't have any external components. Just the programmer and the ATMega328P.
I am not in the USA. I am from Chennai, India. I am sure that my MCU is original. It has got text on it saying Atmel 1401 ATMega328P-PU. And what is a crystal and how do I connect it to my ATmega328P. I am a newbie so I don't understand what these things are. In ebay.in, there are only USBasp programmers. I am not able to get a AVRisp or USBTinyISP. How much does a crystal cost? I am gonna first try to buy a crystal and use it. If it doesn't work I will try to use a different programmer. If a different programmer works, I will replace my USBasp on eBay. If it still doesn't work, I will replace my ATmega328P on eBay and get a Arduino Clone.