avrdude: warning: cannot set sck period. please check for us

Go To Last Post
33 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hello , I'm using a USBasp with ATMEGA328P , eclipse IDE , OS 8.1 win 64bit however at the time of writing I have this error with sck ,
the frequency of the clock is 16000000
avrdude : warning : Can not Set sck period . usbasp please check for firmware update .

Launching C : \ WinAVR - 20100110 \ bin \ avrdude - pm328p - cusbasp - b19200 - Uflash w: teste.hex : a
output :

avrdude : warning : Can not Set sck period . usbasp please check for firmware update .
avrdude : AVR device initialized and ready to accept instructions

Reading | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # | 100 % 0.00s

avrdude : Device signature = 0x1e950f
avrdude : NOTE : FLASH memory has been specified , an erase cycle will be Performed
To disable this feature , specify the- D option .
avrdude : erasing chip
avrdude : warning : Can not Set sck period . usbasp please check for firmware update .
avrdude : reading input file " teste.hex "
avrdude : input file auto detected as Intel teste.hex Hex
avrdude : writing flash ( 168 bytes ) :

Writing | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # | 100 % 0.12s

avrdude : 168 bytes of flash written
avrdude : verifying flash memory against teste.hex :
avrdude : load data flash data from input file teste.hex :
avrdude : input file auto detected as Intel teste.hex Hex
avrdude : input file contains 168 bytes teste.hex
avrdude : reading on- chip flash data :

Reading | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # | 100 % 0.09s

avrdude : verifying ...
avrdude : 168 bytes of flash verified

avrdude done . Thank you .

avrdude finished

thank

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You need to set the programming clock NO FASTER than 1/4 of FCPU of the target AVR.

I would argue that it is absurd to expect a 16MHz programming clock. It is common that SPI output clocks cannot run faster than 1/2 of the clock rate of the master. And, if it is bit-banged, it might be significantly slower.

I think you are just setting it way too fast. Try 1MHz for a start and work up from there.

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Ah-ha. I was going to suggest that you Google: "avrdude : warning : Can not Set sck period . usbasp please check for firmware update "

However most of the first hits gave silly advice.

A modern Chinese USBASP will set the SCK period automagically.
There is NO reason to upgrade the firmware. Just ignore the warning.

Historically, the first USBASP design used a SLOW jumper. The first fischl.de firmware did not support "setting sck period" with the -B# switch.

So the only people who need to upgrade firmware are those with a very old home-made usbasp.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

David.
then I have no solution ... kkkk :(

tried various clocks, but nothing ..

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

@vagner,

Describe your symptoms.

Quote:
avrdude : 168 bytes of flash verified

As far as I can see, your avrdude command was successful in your original post.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

@ David.

avrdude: warning: cannot set sck period. please check for usbasp firmware update.

but my LED does not blink, I need to make a rpm counter (tachometer) for an academic work with SPI communication to the supervisor, but not the LED flashes in my tests

thank you for your attention

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Time to show the code and how you built it.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If your LED does not blink, you have probably written an incorrect program! (or wired your LED backwards)

As far as the USBASP is concerned, it has initialised the AVR, read the correct signature, erased, burned and verified your program correctly. i.e. perfect in every step.

Post your 'program code'. We may spot your error.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

that!!!


#define F_CPU 16000000UL
#include <avr/io.h>
#include <util/delay.h>

#define set_bit(Y,bit_x) (Y|=(1<<bit_x))
#define clr_bit(Y,bit_x) (Y&=~(1<<bit_x))
#define tst_bit(Y,bit_x) (Y&(1<<bit_x))
#define cpl_bit(Y,bit_x) (Y^=(1<<bit_x))

#define LED PB0 //LED
int main( )
{
DDRB = 0xFF;

while(1){
set_bit(PORTB,LED);
_delay_ms(1000);
clr_bit(PORTB,LED);

}
}

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You need another _delay_ms(1000) statement.

If you are using conventional active-low LED, you are seeing it off for 1000us and on for about 0.5us.

You might see the brief flash if you have good eyesight.

OTOH, most young people use weird active-high wiring. Not even a hawk would see the 0.5us off period in a lit LED.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I know that, even with the following code does not work

while (1) {
set_bit (PORTB, LED);

}

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

I know that, even with the following code does not work

Is your LED connected "active high" or "active low"?

Why did you reject the "put time between changes" test?

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Is your LED connected "active high" or "active low"?

Why did you reject the "put time between changes" test?

"active high"

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So, what voltage is on PB0 after your program starts?

Is your AVR coming out of reset? What voltage is on the /RESET pin?

And,

Quote:

Why did you reject the "put time between changes" test?

to help diagnose connection? When you do the toggle with a suitable interval in between, what levels do you see?

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The PB0 after recording this down,

yes, with this reset,
with a greater range, still has no exit in any PB0

using eXtreme Burner AVR got the following error when saving ...

[img]https://lh6.googleusercontent.com/-WfwS5OzuDw4/U3EALBGfreI/AAAAAAAAC_U/X...

erase the memory works,

this happens in eclipse

[img]https://lh4.googleusercontent.com/-gAVpX36lwTs/U3EALCluHQI/AAAAAAAAC_Y/t...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, you can't really expect much from Extreme Burner. No software 'checks' erasure. And I would not trust Extreme anything.

At least you know that avrdude is 100% reliable.

Correct your C code. Then build it and burn it with avrdude.

Make sure that you connect your LED the right way round.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 2

In my experience with USBasp devices, this message is common and can be ignored.

This type of error is due to bad design on the part of the person who wrote the USBasp program. It is a programmer's status message that should NEVER be seen by the actual user. With all respect to programmers everywhere, they seem to all be stuck in a 1970s mentality where PDP-11 mini-computers with the processing capacity of a modern XMEGA chip cost $250,000, and program memory was measured in kilobytes.
At that time it was considered normal to use very brief error messages of 20 chars or less, and to leave these messages active in the finished code. It seemed a courtesy since other users were most likely other programmers.
In the present time, to leave a incomprehensible programmer's message in the code that the user interacts with is like farting in a elevator. To leave a 20 character error message in a system that has hundreds of thousands of bytes of program memory available. along with no in-line documentation of what the problem could be or how to fix it is simply a sign of a brain-dead, lazy, 1970-era-stuck C programmer. Which more often than not is the case with all modern 'professional' programmers.

Be that as it may, I suggest putting a string at the end of your code stating what the program source file name is, the version currently present in the flash, and the e-mail address of the programmer. In fact, put two strings: one written normally and the other being the same but with the character pairs inverted.
Then you can read the flash memory directly from the AVR and see what file and version the code is by looking at the 'raw' bytes with a hex editor. If the character pairs are inverted in the ID string, then the program being used to read the flash has it's 'endian' function reversed.

AVRdude can use this command to read the flash:
avrdude -p m328 -c USBasp -U flash:r:WhatsThisFlash.txt:r

Then the file 'WhatsThisFlash.txt' can be viewed in a text editor that has binary code display in hex monitor format. At the end will be your message string, for example: " MyCodeFile.c ver 1.02 myaddress@yahoo.com"

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Blinked, blinked!!
many hours of work over blinked ...

thank you all for your patience and help, once you have the design tachometer post here ...
acredio but that the error was only because I was using a usb adapter in USBasp ... when plugged directly into the USB port worked all ...

thank you all again ...

ahhh
delete this line also


# define F_CPU 16000000UL

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I don't believe you.

I often use USBASP with an un-powered USB hub on a laptop. It works fine.

Your 'Eclipse' screenshot showed a successful 'burn' of your program.

Anyway, I am pleased that you have everything working now.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:
I donok @ David.
but it happened, wore a cord equal to that
[url]http://www.ebay.com/itm/6ft-6-Feet-USB-2-0-A-Male-to-A-Female-Extension-...

the recorded code was the same, except the one line of code!

# define F_CPU 16000000UL 

thank's!!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ah-ha. You had a 2m extension cable rather than a 'hub'.

All the same, I would expect the USB to work ok regardless. The USBASP uses USB v1.0 which is low speed. Mind you, I have run pen-drives off of a longish USB extension without problems.

If you have a virgin AVR it will run at 1MHz.
If you had used F_CPU of 16MHz, you would still blink. Just 16x slower.

I suggest that you look carefully to see what your problem was. It is normally wrong wiring. But your screenshot showed perfect comms with the USBASP !

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

it may be late, but just want to thank you as i had the same issue, and the error message can just be ignored.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

myavrfreaks001 wrote:

it may be late, but just want to thank you as i had the same issue, and the error message can just be ignored.

 

I am even later - story of my life laugh but I use these cheap Chinese USBasp programmers a lot to burn the bootloader to ATmega 32U4 in a quadcopter flight control board and this error message is always generated despite the bootloader having been successfully burnt to the chip.

Pedro :)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

When I use my usbasp with raw AVRDUDE (on command line) while I am loading a .hex file or when I am using WINAVR, I always get that message: "Cannot Set sck period . usbasp please check for firmware update " but AVRDUDE continues on and flashes my hex file.  When I use the USBASP as a programmer on the Arduino IDE, I get the same message, and the process halts, no upload.  Is there a way to prevent the stoppage on Arduino IDE?

 

JAx

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I haven't used AVRDUDE and am far from being an Arduino power user smiley sorry. You have obviously selected USBasp in Tools in the IDE and I assume that the USBasp is showing up in Device Manager.

 

I really do not know what to suggest. Can you use Arduino as ICSP.

 

I basically have only used USBasp to burn the bootloader to an Atmega32U4 and that's about it.

Pedro :)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

please solve this error ...previously the programmer is working...suddenly it stop to working and its to writing program in the controller...it showing following error

 

 

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

My brain is wired in such a way that I cannot ignore those warnings.

So I have reflashed every Chinese USBasp I have with Fisch's firmware (And donated him some money).

Paul van der Hoeven.
Bunch of old projects with AVR's:
http://www.hoevendesign.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avrdude.exe: warning: cannot set sck period. please check for usbasp firmware update.
avrdude.exe: AVR device initialized and ready to accept instructions

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

avrdude.exe: Device signature = 0x1e9403
avrdude.exe: NOTE: FLASH memory has been specified, an erase cycle will be performed
             To disable this feature, specify the -D option.
avrdude.exe: erasing chip
avrdude.exe: warning: cannot set sck period. please check for usbasp firmware update.
avrdude.exe: reading input file "C:\Users\suman\Documents\Atmel Studio\first\first\Debug/.hex"
avrdude.exe: can't open input file C:\Users\suman\Documents\Atmel Studio\first\first\Debug/.hex: No such file or directory
avrdude.exe: write to file 'C:\Users\suman\Documents\Atmel Studio\first\first\Debug/.hex' failed

avrdude.exe: safemode: Fuses OK

avrdude.exe done.  Thank you.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

please give the solution ....

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It's saying there is no hex file. So either the build failed or you have it looking in the wrong place.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
It's saying there is no hex file.

Doesn't the forward slash in the filename look strange?  Some kind of typo in the invocation line? I don't think we have seen the invocation command?

 

File names

  • You cannot use the following characters anywhere in a file name:
     

    • Tilde
    • Number sign
    • Percent
    • Ampersand
    • Asterisk
    • Braces
    • Backslash
    • Colon
    • Angle brackets
    • Question mark
    • Slash
    • Pipe
    • Quotation mark

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

thanks for reply..

build is successful. 

 

this is my arguments in external tools 

 

avrdude -c usbasp -p m16 -U flash:w:$(ProjectDir)Debug\$(TargetName).hex:i 

 

 

still i am geting same error... help  

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Go on. It is pretty clear that you are looking for ".hex" because TargetName has evaluated as "".
.
The macros in AS7 are dependent on context. Make sure that your last mouse operation is on a Project window.
From memory, AS6.0 and AS5.x did not evaluate macros properly anyway. AS7.0 should be ok.
.
David.

Last Edited: Sat. Aug 5, 2017 - 09:17 AM