Getting rid of the Hobby King usbasp SCK error

JustinTime
Posts: 140
Joined: Tue Jan 29, 2013 4:12 am
Country: -
Location: SoCal

Re: Getting rid of the Hobby King usbasp SCK error

Post by JustinTime »

No taker on the fuse question in the previous page? I suspect that my m128 problem stem from the programmer. I suspect that I didn't flash it correctly. The only thing would be the fuses. I don't know if I give the command that Romolo posted before or after I flash. I know that when we flash the m128 first we have to erase the fuses and then reset them. Do I have to do the same when flashing the programmer? Are the fuses mentioned in the post on the previous page erasing or protecting?

User avatar
gohsthb
Posts: 1412
Joined: Wed Dec 28, 2011 2:32 pm
Country: -
Location: Naperville, IL

Re: Getting rid of the Hobby King usbasp SCK error

Post by gohsthb »

You would simply write the values needed to the fuses. There is no fuse erase command. You could set the fuses before or after flashing doesn't really matter, just as long as both get done.
-Gohst

Sent from my LG-P999 using Tapatalk 2
User avatar
bstott
Posts: 8
Joined: Sat Mar 30, 2013 12:14 am
Country: -
Location: Pittsburgh, PA

Re: Getting rid of the Hobby King usbasp SCK error

Post by bstott »

Having read a description of the USBasp I use from ebay - they describe their firmware as having an auto timing (sck) adjust feature. Since we mostly are using the Chinese programmers I'd hazard they are using basically the same code base and all have the auto adjust timing. As my guessing continues - Since our programmers work by ignoring the error message --- the programmer firmware starts and alerts about sck timing then adjusts to slow down and continues the programming process to completion.

Result: Keep the auto timer adjust feature and ignore the error. Or upgrade the firmware. Our choice. I am now going to ignore the error since my USBasp requires finding its unique points to jumper and there is other more fun hacking to do....
Been there..... Don't want to do it again!
User avatar
bstott
Posts: 8
Joined: Sat Mar 30, 2013 12:14 am
Country: -
Location: Pittsburgh, PA

Re: Getting rid of the Hobby King usbasp SCK error

Post by bstott »

Note on fuses.

When initially programming a stock avr chip the fuses are to be set for features and use. Once they are set we should only be adjusting/programming the eeprom and firmware as needed. The fuses are a different process and not affected by programming. Some chips have a limited number of times they can have different features changed. And the fuses are a do once. Unless of course you screw with them..... Oh, a higher than 12V discharge or a short can corrupt or erase the fuses.

This is from programming the ATMEGA chips from the manufacturer.

Corrections to my efforts are always appreciated.
Been there..... Don't want to do it again!
User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: Getting rid of the Hobby King usbasp SCK error

Post by rperkins »

to add some clarifications about your 'guessing'.
bstott wrote: Since we mostly are using the Chinese programmers I'd hazard they are using basically the same code base and all have the auto adjust timing
True - most of the chinese usbasp programmers have autospeed firmware in which the source code is not available.

bstott wrote: As my guessing continues - Since our programmers work by ignoring the error message ---.
False - Actually the warning message ' Can not set SCK period' is generated by the avrdude software. The programmer does not generate the message. The programmer with the chinese firmware simply ignores timing requests from avrdude. Avrdude generates a warning saying, in simple terms, ' The programmer is not responding to my timing request and I am not controlling the speed'

bstott wrote: --- the programmer firmware starts and alerts about sck timing then adjusts to slow down and continues the programming process to completion.
False - The programmer firmware does not alert about sck timing ( see above ). The firmware autoadjust's its speed. The parameters and details of how the chinese firmware accomplishes this are not published as the source code is not published. This may have been desireable in the early days of usbasp where there was a 'slow speed' jumper. Now that avrdude/usbasp supports the -B option, utilizing firmware that responds to that option is more desirable, IMHO.

bstott wrote: Result: Keep the auto timer adjust feature and ignore the error. Or upgrade the firmware. Our choice. I am now going to ignore the error since my USBasp requires finding its unique points to jumper and there is other more fun hacking to do....
This will probably work fine for you until you mangle the fuses and need to use the '-B' option to have control over the timing. Specifically if you have to provide an external osc to the mcu and am using a relatively slow clock. I advise using one programmer to update the other one to real, open source, usbasp firmware. It will only take a minute. Nothing like the time lost removing the 100 ohm resistors. But I have seen 1 person who preferred the autospeed option, so to each his own.

User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: Getting rid of the Hobby King usbasp SCK error

Post by rperkins »

bstott wrote: When initially programming a stock avr chip the fuses are to be set for features and use.
True

bstott wrote: Once they are set we should only be adjusting/programming the eeprom and firmware as needed.
The fuses are a different process and not affected by programming.
The fuses determine where the mcu boots up. This matters when you use a bootloader. The fuses also determine the size of the bootloader. IMHO the fuses are more closely tied to the programming then what this statement suggests. Maybe in the narrow context of a 9x/9xr it may have some validity, but not in an overall sense. I believe even Eepe lets you set the fuses concerning whether you want the eeprom erased during a flash upgrade. ( in other words, reset all the models and preferences to default )

bstott wrote: Some chips have a limited number of times they can have different features changed.
The eeprom has a limit to the number of times it can be overwritten but I dont see how that applies to fuses.
But I can agree If you enable reset disable 'RSTDISBL' or Disable Serial programming 'SPIEN' via the fuses then those are harder to change back :)

bstott wrote: And the fuses are a do once.
Maybe if you would of said ' fuses are not programmed as often as ...'

bstott wrote:Oh, a higher than 12V discharge or a short can corrupt or erase the fuses.
I dont believe avr are used at those voltage levels unless you are talking about Parallel HIgh voltage programming. Then 12v is applied to the reset. ( I have never done this , just read about it )



Hopefully I've helped out here. I'm sure some of my assumptions could use some clarifications also. Right now the timers configurations are buzzing around my head :) but we'll get to that shortly.
aster
Posts: 4
Joined: Wed Sep 14, 2016 2:44 pm
Country: -

Re: Getting rid of the Hobby King usbasp SCK error

Post by aster »

Hello this topic saved my usbasp from the trash, but i have a different version than yours

Tell me if i m doing everything correct please

I upload the sketch arduino isp programmer on my uno
Than i make the connection with the usbasp
Using the cmd with avrdude it say me that from the atmega8 it doesn t answer with the expected exadecimal code

This is my usbasp what do i have to bridge to program it?
20160914_164740.jpg
User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: Getting rid of the Hobby King usbasp SCK error

Post by rperkins »

Its been a while but i would try jp3. If that doesnt work copy and paste the exact error code because most usbasp used a m8 mcu but a few used something different (m88?). The firmware you load has to match the mcu on your usbasp
aster
Posts: 4
Joined: Wed Sep 14, 2016 2:44 pm
Country: -

Re: Getting rid of the Hobby King usbasp SCK error

Post by aster »

another few hours spent...

so my usbasp with driver from zadig correctly recognized by my windows 10 mount an atmega8A au

the JP3 is between the pin PC2 of the atmega8A that is a ADC, is possible that is it?
the JP2 is connected to the reset on the ISP

i tried everything, every possible connection but nothing seem to work

my cmd promt:

Code: Select all

D:\Programmi\AVR\bin> avrdude -c arduino -p atmega8 -P COM3 -F -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 "D:\Programmi\AVR\bin\avrdude.conf"

         Using Port                    : COM3
         Using Programmer              : arduino
         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  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom         4    20   128    0 no        512    4      0  9000  9000 0xff 0xff
           flash         33    10    64    0 yes      8192   64    128  4500  4500 0xff 0x00
           lfuse          0     0     0    0 no          1    0      0  2000  2000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  2000  2000 0x00 0x00
           lock           0     0     0    0 no          1    0      0  2000  2000 0x00 0x00
           calibration    0     0     0    0 no          4    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : Arduino
         Description     : Arduino
         Hardware Version: 3
         Firmware Version: 4.4
         Vtarget         : 0.3 V
         Varef           : 0.3 V
         Oscillator      : 28.800 kHz
         SCK period      : 3.3 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x1e950f
avrdude: Expected signature for ATMEGA8 is 1E 93 07
avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0

avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: Fuses OK

avrdude done.  Thank you.
i also tryed to set the fuses according to this guide http://blog.lincomatic.com/?p=1480 but obviusly it didn t let me do it
User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: Getting rid of the Hobby King usbasp SCK error

Post by rperkins »

This line is what is important in your post.

avrdude: Device signature = 0x1e950f

if you do a search on that signature i think you are reading your arduino.
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Getting rid of the Hobby King usbasp SCK error

Post by MikeB »

0x1E950F is the signature of an ATMEGA328P.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
aster
Posts: 4
Joined: Wed Sep 14, 2016 2:44 pm
Country: -

Re: Getting rid of the Hobby King usbasp SCK error

Post by aster »

Yep i don t understand why i don t read the atmega 8 :(, by the way the pin to short was jp1, that is connected to the reset pin
aster
Posts: 4
Joined: Wed Sep 14, 2016 2:44 pm
Country: -

Re: Getting rid of the Hobby King usbasp SCK error

Post by aster »

I suggest this lecture if someone would have new problems, quite sure that they have already solved it

http://forum.arduino.cc/index.php?topic=149668.105

And here there are incredible good firmware with auto detection of clock speed! I suggest to eveyone to upgrade

Post Reply

Return to “PROGRAMMERS”