Standalone atmega8...BIG,BIG Problem

Hy guys, i am new on this forum and i have a problem. I searched the internet for solutions to my problem and seems that i can not find answers or i can't understand them. I made a sketch in IDE and i want to upload that sketch to an stand alone atmega8 on a breadboard. I have an Arduino mega 2560 v3. Please help me solve this annoying thing. I apologize if this subject was discussed over in other forums (i did not find). Thank you and excuse my english.

Thank's for replay but that tutorial make reference to ATmega328p (mine is atmega8) and to a board "Arduino Duemilanove or Nano w/ ATmega328" (mine is ARDUINO MEGA 2560).

You should be able to adapt those instructions easily to the ATmega8 and the Arduino you have.

i tried already but ...nothing, i will try again. thanks

One thing to watch out for is that the SPI pins on the Mega are different from the SPI pins on the UNO.

The pin numbers to use are spelled out at the top of the Examples/ArduinoISP sketch.

When you burn the ArduinoISP sketch into the mega2560 chip, you have to select the
Mega2560 board. Then, when you burn the bootloader into the target board, you have
to select the correct target processor, which will normally be Arduino Uno for the 328
chip, but will have to be something else, as appropriate for your atmega8 chip.

i tryed that........avrdude: Yikes! Invalid device signature.
Double chech connections and try again, or use -F to override this check.

Thank you for reply.

About the pins i used ...pin53 from arduino mega is conected to pin 1 of the atmega8, pin52 to pin 19, pin51 to pin 17, pin50 to pin 18, and 5v to pin 7 and GND to pin 8. There is also a 16M crystal with 2 x 22pF.
And i tried to burn bootloader i selected as target the Arduino NG or older w/ ATmega8.
thanks to all.

use -F to override this check.

You need to get the processor type correct, not try to override it.

About the pins i used ...pin53 from arduino mega is conected to pin 1 of the atmega8, pin52 to pin 19, pin51 to pin 17, pin50 to pin 18, and 5v to pin 7 and GND to pin 8. There is also a 16M crystal with 2 x 22pF.

I would have to look up the correct SPI pins for the Mega board. However, I have a
feeling, as indicated before, that you just don't have the proper bootloader selected
for your chip. That's what "Invalid device signature" indicates to me. Which target board
are you trying to use when burning the bootloader?

im not using any target board. i am using a breadboard with crystal and capacitors on it. Thank you. How do i select the proper bootloader?

Yes, for the 3rd time, you have to find a target board that's in the list and which uses
the same processor [atmega8] that you're using. Then, you'll get the right signature.
So, go look at all the boards in the Board list, and find one that uses your same chip.
The xtal frequency also needs to be the same.

Otherwise, you can go find some 3rd party bootloader, and patch up the boards.txt
file in the IDE to include anew processor variant, but that's really not something you
want to mess with if you don't have to.

And then go re-read what I said in replay #6, about ArduinoISP [mega2560] vs
bootloader [atmega8].

I deed exactly what you sad .There is no reason to be upset. The problem seems to be the atmega8. I tried another one and it works .