Does USBASP need to know what kind of MCU it's programming?

greets

I'm trying to use a USBASP programmer to program an Atmega48-20pu with the blink led 13 sketch. The 48-20pu has the same pin configuration as the 328. I don't have a definition of the 48-20pu in the tools board menu, I'm not sure if it's needed since I'm using an external USBASP programmer.

This is the message I get when trying to program the chip:

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.

Have I missed something?

naut: I don't have a definition of the 48-20pu in the tools board menu, I'm not sure if it's needed since I'm using an external USBASP programmer.

You do, because it's avrdude that actually does the programming through the USBasp, and it needs to know (inter alia) the particular signature of the chip. Each Atmel model of chip has a different "signature" (just an identifying number) that avrdude asks for in order to perform a sanity check before attempting to upload a program.

naut: This is the message I get when trying to program the chip:

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.

Have I missed something?

That message actually looks like USBasp isn't even getting the (unexpected) signature. If it is "factory fresh", the chip may need to initialised running the USBasp in "slow clock" mode (should be a jumper marked S.C.)

When you've set that, you should get a different avrdude error message, this time complaining the signature is wrong. But you are making progress. Next, you just have to find the parameters required from the datasheet and create a correct definitions entry in boards.txt for your chip.

The parts have different signature bytes:
ATmega48A 0x1E 0x92 0x05
ATmega48P 0x1E 0x92 0x0A
ATmega48PA 0x1E 0x92 0x0A

ATmega328 0x1E 0x95 0x14
ATmega328P 0x1E 0x95 0x0F << Duemilanove, Uno, Nano, others

The IDE/Avrdude combination checks those.

– 4/8/16/32KBytes of In-System Self-Programmable Flash program memory
– 256/512/512/1KBytes EEPROM
– 512/1K/1K/2KBytes Internal SRAM

Boards.txt is used to define what these are for the chip being programmed - especially things like how big the bootloader area is.

Another big difference:

In ATmega 48A/48PA there is no Read-While-Write support, and no separate Boot Loader Section.
In ATmega48P, there is no Read-While-Write support, and no separate Boot Loader Section.

Boot Loader Support – Read-While-Write Self-Programming
The Boot Loader Support applies to ATmega88A/88PA/168A/168PA/328/328P.

I interpret that as: You MUST use an AVR ISP Programmer to load code into the 48A/48PA.

You also need to check avrdude.conf to see if Atmega48A or Atmega48PA or Atmega48P are defined. If not, then you have more work to do to perhaps copy a similarly spec’ed part and updating that section to reflect the '48A/P/PA that you are using.

Then, update pins_arduino.h to add atmega48 definitions as needed, or create a variant for one.

I interpret that as: You MUST use an AVR ISP Programmer to load code into the 48A/48PA.

Yep, USBASP AVR programmer v2.0, lots of them on ebay. I use it to program a 328 (without arduino bootloader) on a diavolino clone.

I could not find the info on how to initialize a 48-20pu chip. Is it difficult?

I’ve found an Atmega48 definition in the boards menu in Arduino IDE, but with it is the same error message as in the first post.

here is the definition from the boards.txt :

atmega48.name=---ATmega48---
 
atmega48.upload.protocol=avrisp
atmega48.upload.maximum_size=4094
atmega48.upload.speed=38400
atmega48.upload.using=USBasp

atmega48.bootloader.low_fuses=0xe2
atmega48.bootloader.high_fuses=0xdf
atmega48.bootloader.extended_fuses=0xff
atmega48.bootloader.path=atmega
atmega48.bootloader.file=ATmega48.hex
atmega48.bootloader.unlock_bits=0x3F
atmega48.bootloader.lock_bits=0x0F
 
atmega48.build.mcu=atmega48
atmega48.build.f_cpu=8000000L
atmega48.build.core=arduino
atmega48.build.variant=standard

I’m using a 16mhz crystal with the chip, but the definition has 8Mhz as the frequency, could this be the problem?

Could be - try changing this line

atmega48.build.f_cpu=8000000L

to

atmega48.build.f_cpu=16000000L

or

atmega48.build.f_cpu=16000000UL

atmega48.build.f_cpu=16000000L

or

atmega48.build.f_cpu=16000000UL

nope, doesn't work, I get the same error.

I tried the same procedure with a 328 that I took out of a Uno, worked fine.

I'll try the the slow clock mode on the USBASP (use jumper on J3), the only thing is that I updated the firmware on the USBASP and I've heard that the new firmware does not have the slow clock capability.

naut: nope, doesn't work, I get the same error.

That's because it's still not establishing communication to the point where it's even getting the device signature from the device.

naut: I've heard that the new firmware does not have the slow clock capability.

I'd be surprised if that was true, because if it is, that's really dumb. You need the SC option, precisely for situations like initialising the clock fuse settings on a new chip. A programmer without that option has a major limitation.

Where did you read the option wasn't available in new firmware? Now that you mention it, I have seen some later versions of the USBasp advertised where the SC was supposedly settable by a software cmd. Maybe that's what you have now, and you'll have to get an updated version of avrdude that supports the cmd. I doubt it would work from within the IDE though, you'd have to run avrdude manually.

Anyway, let us now the results of setting the SC jumper one way or the other.

Anyway, let us now the results of setting the SC jumper one way or the other.

tried to burn the bootloader, same result:

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.

Maybe that's what you have now, and you'll have to get an updated version of avrdude that supports the cmd. I doubt it would work from within the IDE though, you'd have to run avrdude manually.

Ye looks like I'm gonna have to do it with software, hopefully I can find some tutorial.

naut: Ye looks like I'm gonna have to do it with software, hopefully I can find some tutorial.

You will also probably have to download the most recent version of avrdude to ensure it has the new functionality. I'm not sure which version we are up to at the moment, though... I'm still using 5.10 (probably should upgrade.)

I interpret that as: You MUST use an AVR ISP Programmer to load code into the 48A/48PA.

It's theoretically possible to use a bootloader on the m48; it has the ability to write its own flash. But it has to be done somewhat differently than on CPUs with a separate bootloader section, and I'm not aware of any Arduino-compatible bootloaders that will work.

Note that you also need to specify the cpu when compiling the Blink sketch. The interrupt vectors are shorter on the m48 than on a m328 or m168 (and the chip is different than an m8), so a sketch compiled for m328 probably won't work at all.

so I’ve d/l AVRDUDES, a GUI for avrdude.

I replaced the avrdude.exe and avrdude.conf that came in the zip file with the same files from the arduino 1.0.5. bin directory, I think they are more recent.

Now I’ve tried different options, baud rates, bitclock settings and still getting the same message:

avrdude.exe: set SCK frequency to 32000 Hz
avrdude.exe: error: programm enable: target doesn't answer. 1 
avrdude.exe: initialization failed, rc=-1
             Double check connections and try again, or use -F to override
             this check.

here are some settings I’ve tried:
-c usbasp -p m48 -P com3 -b 9600 -B 8
-c usbasp -p m48 -P com3 -b 19200 -B 8

-c usbasp -p m48 -P com3 -b 9600 -B 12
-c usbasp -p m48 -P com3 -b 19200 -B 12

I’ve also tried different com ports, same thing.

I have not touched the fuse settings, I don’t want to hurry and brick the chip.

I can’t believe it is so difficult to initialize a chip. How is it normally done? Is all this hassle because of the cheapness of the USBASP programmer?

there is also this page http://www.engbedded.com/fusecalc that helps with the fuse calculation but I have no experience with this stuff yet.

naut: here are some settings I've tried: -c usbasp -p m48 -P com3 -b 9600 -B 8 -c usbasp -p m48 -P com3 -b 19200 -B 8

-c usbasp -p m48 -P com3 -b 9600 -B 12 -c usbasp -p m48 -P com3 -b 19200 -B 12

I've also tried different com ports, same thing.

When you are using a USBasp, you don't specify com port settings at all. Change -P to -P usb, and leave the -b settings out, it may be confusing avrdude since you have specified -c usbasp as the programming device.

The usbasp is as good as any isp only programmer you can buy. The next step up is something like the AVR Dragon, because that can also do high voltage parallel programming, which can be useful to unbrick devices that have fuse settings that won't allow further ISP programming. But for your situation, a USBasp is more than adequate (as long as you can still get it to go into SC mode.)

At the command line, type

avrdude

by itself to get it to show you the available options, and also the version. Post the output here. I'm not sure the one bundled with 1.0.5 will be up to date -- the tools are sometimes quite outdated in the IDE distributions.

Edit:

then try this cmd, and see what you get:

avrdude -B 5.0 -c usbasp -P usb -p m48 -v -v -v -v

pico:
But for your situation, a USBasp is more than adequate (as long as you can still get it to go into SC mode.)

How can I check if the USBASP really goes into slow clock mode when I use a jumper on the slow clock pins? With a scope? …

then try this cmd, and see what you get:

avrdude -B 5.0 -c usbasp -P usb -p m48 -v -v -v -v

avrdude.exe: Version 5.11svn, compiled on Jan 18 2012 at 22:40:34
             Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
             Copyright (c) 2007-2009 Joerg Wunsch

             System wide configuration file is "D:\download progies\arduino\AVR dudes\avrdude.conf"

             Using Port                    : USB
             Using Programmer              : usbasp
             Setting bit clk period        : 5.0
avrdude.exe: seen device from vendor ->www.fischl.de<-
avrdude.exe: seen product ->USBasp<-
             AVR Part                      : ATMEGA48
             Chip Erase delay              : 45000 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        256    4      0  3600  3600 0xff 0xff
                                      Block Poll               Page                       Polled
               Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               flash         65     6    64    0 yes      4096   64     64  4500  4500 0x00 0x00
                                      Block Poll               Page                       Polled
               Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                      Block Poll               Page                       Polled
               Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                      Block Poll               Page                       Polled
               Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                      Block Poll               Page                       Polled
               Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                      Block Poll               Page                       Polled
               Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
                                      Block Poll               Page                       Polled
               Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

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

avrdude.exe: try to set SCK period to 5e-006 s (= 200000 Hz)
avrdude.exe: set SCK frequency to 187500 Hz
avrdude.exe: error: programm enable: target doesn't answer. 1 
avrdude.exe: initialization failed, rc=-1
             Double check connections and try again, or use -F to override
             this check.


avrdude.exe done.  Thank you.

avrdude.exe: Version 5.11svn, compiled on Jan 18 2012 at 22:40:34

So I’ve got a older avrdude version, gonna have to update.

Is there a way to extract the current fuse info from a fresh Amtmega48?

naut:

pico:
But for your situation, a USBasp is more than adequate (as long as you can still get it to go into SC mode.)

How can I check if the USBASP really goes into slow clock mode when I use a jumper on the slow clock pins? With a scope? …

That would be one way. A logic analyzer would also work. Or maybe just trying with something like a factory fresh 328p chip or similar.

naut:

then try this cmd, and see what you get:

avrdude -B 5.0 -c usbasp -P usb -p m48 -v -v -v -v

avrdude.exe: Version 5.11svn, compiled on Jan 18 2012 at 22:40:34

Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
            Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is “D:\download progies\arduino\AVR dudes\avrdude.conf”

Using Port                    : USB
            Using Programmer              : usbasp
            Setting bit clk period        : 5.0
avrdude.exe: seen device from vendor → www.fischl.de
avrdude.exe: seen product ->USBasp<-
            AVR Part                      : ATMEGA48
            Chip Erase delay              : 45000 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                 :

[…]

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

avrdude.exe: try to set SCK period to 5e-006 s (= 200000 Hz)
avrdude.exe: set SCK frequency to 187500 Hz
avrdude.exe: error: programm enable: target doesn’t answer. 1
avrdude.exe: initialization failed, rc=-1
            Double check connections and try again, or use -F to override
            this check.

avrdude.exe done.  Thank you.

That’s not encouraging.

naut:
Is there a way to extract the current fuse info from a fresh Amtmega48?

That cmd should have done it. Here’s what I get using that on a atmega8 chip:

C:\atmel\avrdude510>avrdude -B 5.0 -c usbasp -P usb -p m8 -v -v -v -v

avrdude: Version 5.10, compiled on Jan 19 2010 at 10:45:23
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\atmel\avrdude510\avrdude.conf"

         Using Port                    : usb
         Using Programmer              : usbasp
         Setting bit clk period        : 5.0
avrdude: seen device from vendor ->www.fischl.de<-
avrdude: seen product ->USBasp<-
         AVR Part                      : ATMEGA8
         Chip Erase delay              : 10000 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  Max
W   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ---
-- ---------
           eeprom         4    20   128    0 no        512    0      0  9000  90
00 0xff 0xff
                                  Block Poll               Page
      Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  Max
W   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ---
-- ---------
           flash         33    10    64    0 yes      8192   64    128  4500  45
00 0xff 0x00
                                  Block Poll               Page
      Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  Max
W   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ---
-- ---------
           lfuse          0     0     0    0 no          1    0      0  2000  20
00 0x00 0x00
                                  Block Poll               Page
      Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  Max
W   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ---
-- ---------
           hfuse          0     0     0    0 no          1    0      0  2000  20
00 0x00 0x00
                                  Block Poll               Page
      Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  Max
W   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ---
-- ---------
           lock           0     0     0    0 no          1    0      0  2000  20
00 0x00 0x00
                                  Block Poll               Page
      Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  Max
W   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ---
-- ---------
           calibration    0     0     0    0 no          4    0      0     0
 0 0x00 0x00
                                  Block Poll               Page
      Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  Max
W   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ---
-- ---------
           signature      0     0     0    0 no          3    0      0     0
 0 0x00 0x00

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

avrdude: try to set SCK period to 5e-006 s (= 200000 Hz)
avrdude: set SCK frequency to 187500 Hz
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.04s

avrdude: Device signature = 0x1e9307
avrdude: safemode read 1, lfuse value: e4
avrdude: safemode read 2, lfuse value: e4
avrdude: safemode read 3, lfuse value: e4
avrdude: safemode: lfuse reads as E4
avrdude: safemode read 1, hfuse value: df
avrdude: safemode read 2, hfuse value: df
avrdude: safemode read 3, hfuse value: df
avrdude: safemode: hfuse reads as DF

avrdude: safemode read 1, lfuse value: e4
avrdude: safemode read 2, lfuse value: e4
avrdude: safemode read 3, lfuse value: e4
avrdude: safemode: lfuse reads as E4
avrdude: safemode read 1, hfuse value: df
avrdude: safemode read 2, hfuse value: df
avrdude: safemode read 3, hfuse value: df
avrdude: safemode: hfuse reads as DF
avrdude: safemode: Fuses OK

avrdude done.  Thank you.

My attempt was to get the bitclock to < 250K, assuming the clock on a m48 is 1MHz from the factory (like on a 328p, for example.) The bitrate needs to be at least 4x slower than the clock. So I asked avrdude to set the bitrate at 200K, and avrdude reported it complied with setting it to 187.5K.

But whether or not the USBasp was really operating at this speed is impossible to say without direct testing of some sort.

Further, my assumption that the chip is internally clocked at 1MHz from the factory may be incorrect. The datasheet needs to be consulted to verify or falsify that assumption.

Edit: You could try to really slow the clock down by setting to (for example) -B 50.0, or even -B 100.0

That's not encouraging.

Can you explain a bit why?

But whether or not the USBasp was really operating at this speed is impossible to say without direct testing of some sort.

If I use a scope, which pins on the ISP header I should attach the probes to?

Further, my assumption that the chip is internally clocked at 1MHz from the factory may be incorrect. The datasheet needs to be consulted to verify or falsify that assumption.

Is this it? :

9.2.1 Default clock source The device is shipped with internal RC oscillator at 8.0MHz and with the fuse CKDIV8 programmed, resulting in 1.0MHz system clock. The startup time is set to maximum and time-out period enabled. (CKSEL = "0010", SUT = "10", CKDIV8 = "0"). The default setting ensures that all users can make their desired clock source setting using any available programming interface.

http://www.atmel.com/images/doc2545.pdf

p.28

naut:

That's not encouraging.

Can you explain a bit why?

Because it was saying it didn't get a response from the chip, even though we had asked it nicely and slowly (supposedly, anyway).

naut:

But whether or not the USBasp was really operating at this speed is impossible to say without direct testing of some sort.

If I use a scope, which pins on the ISP header I should attach the probes to?

SCK is the clock pin from the USBasp. That's pin 3 on the header. GND is pin 6.

naut:

Further, my assumption that the chip is internally clocked at 1MHz from the factory may be incorrect. The datasheet needs to be consulted to verify or falsify that assumption.

Is this it? :

9.2.1 Default clock source The device is shipped with internal RC oscillator at 8.0MHz and with the fuse CKDIV8 programmed, resulting in 1.0MHz system clock. The startup time is set to maximum and time-out period enabled. (CKSEL = "0010", SUT = "10", CKDIV8 = "0"). The default setting ensures that all users can make their desired clock source setting using any available programming interface.

http://www.atmel.com/images/doc2545.pdf

p.28

Yep, that looks like it. And it verifies my assumption. But if the USBasp is really clocking at less than 250K, then it means there is another problem besides the clock rate. And I would be officially out of ideas at this stage.

But in any case, whatever the remaining problems, be assured that it could never have worked without a slow clock. If the factory clock speed is 1MHz, the default USBasp programming speed using avrdude would have been too fast for it, just as it is on a factory 328p.

You just can't do this stuff without a slow clock option. Which is why I was somewhat bemused when you said the latest USBasp firmware disables the SC jumper.

I’ve just tried my other Atmega48 chip in a different socket, a ZIF socket this time, and looks like I got a response:

~~~~~~~~~~~~~~~~~~

avrdude.exe: Version 5.11svn, compiled on Jan 18 2012 at 22:40:34
             Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
             Copyright (c) 2007-2009 Joerg Wunsch

             System wide configuration file is "D:\download progies\arduino\AVR dudes\avrdude.conf"

             Using Port                    : USB
             Using Programmer              : usbasp
             Setting bit clk period        : 8.0
avrdude.exe: seen device from vendor ->www.fischl.de<-
avrdude.exe: seen product ->USBasp<-
             AVR Part                      : ATMEGA48
             Chip Erase delay              : 45000 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        256    4      0  3600  3600 0xff 0xff
                                      Block Poll               Page                       Polled
               Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               flash         65     6    64    0 yes      4096   64     64  4500  4500 0x00 0x00
                                      Block Poll               Page                       Polled
               Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                      Block Poll               Page                       Polled
               Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                      Block Poll               Page                       Polled
               Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                      Block Poll               Page                       Polled
               Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                      Block Poll               Page                       Polled
               Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
                                      Block Poll               Page                       Polled
               Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

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

avrdude.exe: try to set SCK period to 8e-006 s (= 125000 Hz)
avrdude.exe: set SCK frequency to 93750 Hz
avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude.exe: Device signature = 0x1e9205

avrdude.exe done.  Thank you.

The USBASP did read the chip this time, didn’t it?
is this good news? Just some chip pins not contacting the pins in a dip socket?

naut: I've just tried my other Atmega48 chip in a different socket, a ZIF socket this time, and looks like I got a response: [...]

The USBASP did read the chip this time, didn't it?

Yep.

naut: is this good news? Just some chip pins not contacting the pins in a dip socket?

Don't know. Try the other chip in the ZIF would be the first thing I'd try.

But yes, it's definite progress. You know you can communicate with and program these chips with your USBasp setup.

Edit: What exact avrdude cmd line did you use? I don't see the fuse values after the signature, which I would have expected.

Compare your avrdude output with that from the atmega8 I posted above:

avrdude: Device signature = 0x1e9307
avrdude: safemode read 1, lfuse value: e4
avrdude: safemode read 2, lfuse value: e4
avrdude: safemode read 3, lfuse value: e4
avrdude: safemode: lfuse reads as E4
avrdude: safemode read 1, hfuse value: df
avrdude: safemode read 2, hfuse value: df
avrdude: safemode read 3, hfuse value: df
avrdude: safemode: hfuse reads as DF

avrdude: safemode read 1, lfuse value: e4
avrdude: safemode read 2, lfuse value: e4
avrdude: safemode read 3, lfuse value: e4
avrdude: safemode: lfuse reads as E4
avrdude: safemode read 1, hfuse value: df
avrdude: safemode read 2, hfuse value: df
avrdude: safemode read 3, hfuse value: df
avrdude: safemode: hfuse reads as DF
avrdude: safemode: Fuses OK

avrdude done.  Thank you.

phew… I think it’s working now.

I was able to upload the blink sketch to the Atmega48 in the ZIF socket. The slow clock jumper works, and I changed the boards.txt definition of Atmega48 to:

atmega48.name=—ATmega48—

atmega48.upload.protocol=avrisp
atmega48.upload.maximum_size=4094
atmega48.upload.speed=9600
atmega48.upload.using=USBasp

atmega48.bootloader.low_fuses=0xe2
atmega48.bootloader.high_fuses=0xdf
atmega48.bootloader.extended_fuses=0xff
atmega48.bootloader.path=atmega
atmega48.bootloader.file=ATmega48.hex
atmega48.bootloader.unlock_bits=0x3F
atmega48.bootloader.lock_bits=0x0F

atmega48.build.mcu=atmega48
atmega48.build.f_cpu=1000000L
atmega48.build.core=arduino
atmega48.build.variant=standard

so I just changed the baud rate to 9600 and clock speed to 1 MHz. btw, also works with 38400 Baud rate.

Now I want to try to burn the fuses so it would use the external 16Mhz crystal.