Problem with uploading sketch in Atmega328

Hi all!

I'm having the huge problems with uploading sketch to Atmega328 microcontroller. Thing get's worse with nowing that I can't upload the same shetch in ATiny using the same programmer.

I google lot's of other people problem's, but I couldn't find solution to my problem. First I was thoat that is problem in microcontroller, but then I bought the new one and I always got the same answer:

avrdude: warning: cannot set sck period. please check for usbasp firmware update.
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.

I'm connecting programmer using this pinout: http://arduino.cc/forum/index.php/topic,146315.0.html

Also I tried editing the board's text file, and adding this board:
########################################­######################

atmega328bb.name=ATmega328 on a breadboard (8 MHz internal clock)

atmega328bb.upload.protocol=stk500
atmega328bb.upload.maximum_size=30720
atmega328bb.upload.speed=57600

atmega328bb.bootloader.low_fuses=0xE2
atmega328bb.bootloader.high_fuses=0xDA
atmega328bb.bootloader.extended_fuses=0x­05
atmega328bb.bootloader.path=arduino:atme­ga
atmega328bb.bootloader.file=ATmegaBOOT_1­68_atmega328_pro_8MHz.hex
atmega328bb.bootloader.unlock_bits=0x3F
atmega328bb.bootloader.lock_bits=0x0F

atmega328bb.build.mcu=atmega328p
atmega328bb.build.f_cpu=8000000L
atmega328bb.build.core=arduino:arduino
atmega328bb.build.variant=standard

But again the same thing happens!

What I'm doing wrong, does anyone know, because this realy frustrate me!

Thanks!

Has you chip ever been burned with an Arduino bootloader? If so you have to supply a system clock. Does your Bare Bones system have a crystal?

Is your chip an ATmega328 or an ATmega328P. You call it a 328 but in the boards.txt entry you call it a 328p.

Hi!

This is what is written on chip: ATMEGA328P-PU, could problem be there?

I bought the both chips with pre burned bootloader, but as I now, it doesn't matter do I have the bootloader, when I'm programming the chip using the programmer.

I didn't put the resonator, because I added this board which in it's config is set to use it's internal 8 mhz clock!

Thanks!

jocoj100:
I bought the both chips with pre burned bootloader, but as I now, it doesn't matter do I have the bootloader, when I'm programming the chip using the programmer.

You don't need the bootloader when using the ISP, but part of burning the Arduibno bootloader is setting the fuses to work with the Arduino hardware: an external 16 MHz crystal or resonator. The serial (ISP) programming requires a working system clock. You have three choices now:

  1. Supply a crystal or resonator. The frequency isn't very critical. I think anything from 8 to 20 MHz will work.

  2. Supply an external clock on the XTL1 pin. There are versions of ArduinoISP that provide an 8 MHz signal on Pin 9 to use as a system clock for programming.

  3. Use High Voltage Parallel Programming (not In-circuit Serial Programing) to set the fuses to use the internal clock. The Hight Voltage Rescue Shield will do that.

If i figure out welll, then the simplest thing would be to supply the 16MHz crystal, and 2x22pF capacitors, which I'm gona do, because I have that items at home.

I put the resonator, and thing isn't working again, also I tried to change the boards config file, and on board "Uno", I wrote:
uno.build.mcu=atmega328p-pu

And then I get this error:
unknown MCU 'atmega328p-pu' specified
...
BareMinimum.cpp:1: error: MCU 'atmega328p-pu' supported for assembler only

=( =(

Also I intalled the new version of Arduino, and again the same thing happens!

jocoj100:
I put the resonator, and thing isn't working again, also I tried to change the boards config file, and on board "Uno", I wrote:
uno.build.mcu=atmega328p-pu

And then I get this error:
unknown MCU 'atmega328p-pu' specified

The "-PU" part just means "in a plastic DIP package" so avrdude doesn't care about it. Use "atmega328P".

Again same thing happens!