Programing ATmega328pb using USBasp

Sketch uses 4354 bytes (13%) of program storage space. Maximum is 32256 bytes.
Global variables use 482 bytes (23%) of dynamic memory, leaving 1566 bytes for local variables. Maximum is 2048 bytes.
"C:\Users\ilija\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude" "-CC:\Users\ilija\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf" -v -V -patmega328p -cusbasp -Pusb "-Uflash:w:C:\Users\ilija\AppData\Local\Temp\arduino\sketches\23225F0523AAB3FAFEFB788BEA6859E0/ArduinoISP.ino.hex:i"

avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

     System wide configuration file is "C:\Users\ilija\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"

     Using Port                    : usb
     Using Programmer              : usbasp
     AVR Part                      : ATmega328P
     Chip Erase delay              : 9000 us
     PAGEL                         : PD7
     BS2                           : PC2
     RESET disposition             : dedicated
     RETRY pulse                   : SCK
     serial program mode           : yes
     parallel program mode         : yes
     Timeout                       : 200
     StabDelay                     : 100
     CmdexeDelay                   : 25
     SyncLoops                     : 32
     ByteDelay                     : 0
     PollIndex                     : 3
     PollValue                     : 0x53
     Memory Detail                 :

                              Block Poll               Page                       Polled
       Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
       ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
       eeprom        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff
       flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
       lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
       hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
       efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
       lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
       calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
       signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

     Programmer Type : usbasp
     Description     : USBasp, http://www.fischl.de/usbasp/

avrdude: auto set sck period (because given equals null)
avrdude: error: program 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.

Failed programming: uploading error: exit status 1

I cant program my arduino uno and this is the message i get all the time. Can someone please tell me whats the problem?

Thank you

I have a suspicion that that is the problem. Did you install GitHub - MCUdude/MiniCore: Arduino hardware package for ATmega8, ATmega48, ATmega88, ATmega168, ATmega328 and ATmega328PB?

Yes, you are right. That was the problem. I have changed that but now i have a diferent problem. When i try to burn the bootloader, i get the following message:

"C:\Users\ilija\AppData\Local\Arduino15\packages\MiniCore\tools\avrdude\7.1-arduino.1/bin/avrdude" "-CC:\Users\ilija\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\2.2.2/avrdude.conf" -v -patmega328pb -cusbasp -e -Ulock:w:0xff:m -Uefuse:w:0b11110101:m -Uhfuse:w:0b11010110:m -Ulfuse:w:0b11111111:m

avrdude: Version 7.1-arduino.1
Copyright the AVRDUDE authors;
see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

     System wide configuration file is C:\Users\ilija\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\2.2.2\avrdude.conf

     Using Port                    : usb
     Using Programmer              : usbasp
     AVR Part                      : ATmega328PB
     Chip Erase delay              : 10500 us
     PAGEL                         : PD7
     BS2                           : PC2
     RESET disposition             : possible i/o
     RETRY pulse                   : SCK
     Serial program mode           : yes
     Parallel program mode         : yes
     Timeout                       : 200
     StabDelay                     : 100
     CmdexeDelay                   : 25
     SyncLoops                     : 32
     PollIndex                     : 3
     PollValue                     : 0x53
     Memory Detail                 :

                                       Block Poll               Page                       Polled
       Memory Type Alias    Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
       ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
       eeprom                 65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff
       flash                  65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
       lfuse                   0     0     0    0 no          1    1      0  4500  4500 0x00 0x00
       hfuse                   0     0     0    0 no          1    1      0  4500  4500 0x00 0x00
       efuse                   0     0     0    0 no          1    1      0  4500  4500 0x00 0x00
       lock                    0     0     0    0 no          1    1      0  4500  4500 0x00 0x00
       signature               0     0     0    0 no          3    1      0     0     0 0x00 0x00
       calibration             0     0     0    0 no          1    1      0     0     0 0x00 0x00

     Programmer Type : usbasp
     Description     : USBasp, http://www.fischl.de/usbasp/

avrdude: auto set sck period (because given equals null)
avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e9116
avrdude main() error: expected signature for ATmega328PB is 1E 95 16
double check chip or use -F to override this check

avrdude done. Thank you.

Failed chip erase: uploading error: exit status 1

Every time i run this i get the message that my chip has different device signiture?
Do You know what the problem could be with that ?

Thank you for your help,
Best regards

I'm not sure what you mean by that. Do you mean that the below number changes every time? Or that it's always 0x1e9116?

I've tried to find that signature 0x1e9116 but couldn't :cry:

It might be a broken 328PB (it's one bit difference) or USBAsp can't be used to program the 328PB (maybe needs a firmware upgrade, I'm not familiar with USBAsp).

The device signiture of my ATMEGA328PB changes every time i try to read it. It should be 0x1e 0x95 0x16, but it isn't.

I really don't know why that would happen. Maybe some pointers:

  1. Solid power supply?
  2. Decoupling capacitors in place?
  3. Nothing else connected to the ICSP pins?

Further I think that you'll have to wait till somebody more knowledgeable comes along. In the mean time you can provide a schematic of the circuit used to program the 328PB.

I have solved the problem. I have a voltage regulator that makes 3.3V from 5V source near ICSP pins.
Probably it applies noise on the SPI lines, therefor the Microcontroller cant read SPI lines correctly.
Thank you for your help anyways.
Best regards

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.