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, USBasp - USB programmer for Atmel AVR controllers - fischl.de
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