Connect with us

avrdude unable to program my ATmega328p microcontroller

Discussion in 'Microcontrollers, Programming and IoT' started by yamadanao, Jun 27, 2017.

  1. yamadanao

    yamadanao

    2
    0
    Jun 21, 2017
    I am going to be brief here. So I got my Atmega328p microcontroller from Arduino Uno(I pulled it out of the board). And then I bought my USBASP programmer chip to program my MCU. I properly installed its x64 drivers. Then I made my program to turn an LED on. It got compiled successfully and generated the hex file nicely.

    Here is the atmega328p datasheet
    BUT! when I try to program my MCU it gives an error like this:-

    ERROR LOG:-

    avrdude -p atmega328p -P usb -c usbasp -U flash:w:LEDON.hex

    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.


    avrdude done. Thank you.

    make.exe: *** [program] Error 1

    Then I try to program it using the -F parameter to know the problem more deeply, and I get this error:-

    avrdude: error: programm enable: target doesn't answer. 1
    avrdude: initialization failed, rc=-1
    avrdude: AVR device initialized and ready to accept instructions
    avrdude: Device signature = 0x000000
    avrdude: Yikes! Invalid device signature.
    avrdude: Expected signature for ATMEGA328P is 1E 95 0F
    avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
    To disable this feature, specify the -D option.
    avrdude done. Thank you.

    I have tried everything, but nothing is working. I am using WinAVR on Windows 10 x64 OS. I can put the code if you guys want. Also I have double checked my MOSI, MISO, SCK, RST, Vcc and GND connections. They are perfectly fine.
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-