Usbasp programmer issue

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

My friend wants to upload a arduino bootloader into a new atmega328, I said it can be done using a usbasp, and tools--burn bootloader. Buy It had sync error. So I just tried it using a a GUI called "SinaProg" and searched it, to get back a device signature, but it said check connections and try again, I did a wild guess and placed a 12MHz crystal in the xtal pins of m328 (since the usbasp had 12Mhz) and searched again, we were able to get a handshake, and the device signature. I did the same thing with with a attiny85, when tried searching avrdude responded to check the connection and try again, but when tried with a 12MHz at the xtal, it was programmed, to run in 1MHz, which worked well once I removed the crystal, even I2C worked properly.

Why was it so, what was the need for keeping a crystal of equal freq in the m328?

Should the programmer freq be greater that or equal to the uC freq? 

If so to prog a 16Mhz uC, should the programmer crystal be changed some how?

Is it the programmer that is faulty? Is it that it cant provide the pluses for the m328 or tiny85 to respond.

I'm sorry if this question has been asked before, I couldn't find one. 

This topic has a solution.

Clament John | Still in school 

Last Edited: Mon. May 29, 2017 - 09:18 AM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

The USBASP normally has a 12MHz crystal because the original standard design used 12MHz. 12MHz is convenient for V-USB.
.
The target AVR needs a clock of some description. Virgins come with 1MHz RC.
Any mega328 from a hobbyist shop is likely to have the fuses set for a crystal because that is what an Arduino uses.
.
If your Chinese USBASP has got its original Chinese firmware, it sets the SCK frequency automatically. It will just work.
.
If you have German firmware, you need to set SCK manuaĺly.
.
There is NO need for the target to have a specific crystal. Just as long as it has one if the fuses are set for "external crystal".
.
David.

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

Hello,
I've found that I have old firmware on my Usbasp programmer. So I wan to use my second "empty" Atmega8a. But I've made mistake and set fuses first according instructions included in firmware zip file. So fuses should be now:

-U hfuse:w:0xC9:m -U lfuse:w:0xEF:m

which i settings for external crystal. Previously there was program which blink LED. When I connect various crystals led is blinking, but when I connect my Usbasp it stops. When try to read fuses:

 

sudo avrdude -c usbasp -p m8 -U lfuse:r:-:h -U hfuse:r:-:h

it gives me very unpredictable results, most of the time signature is not matching. I've tried various crystals 4.096 MHz, 8.000 MHz, 12MHz, but the result is the same.

 

I'm also able to make my RaspberryPi 2 as clock source and dynamically change sped of LED blinking but I'm not able to communicate correctly using usbasp programmer. Last idea what I have is to set 1MHz from RPi but I'm not sure whether clock signal generated from RPi is stable enought.

Am I doing something wrong? Or am I missing something? How can I reset fuses to be able to comunnicate with my second Atmega8 again?

Thanks.