Problems with ATMEGA 328P

Hi everyone, I've bought five ATMEGA 328P with Arduino bootloader on ebay.

I followed this instructions

http://www.instructables.com/id/Bootloading-ATmega328-with-Arduino-Mega2560/

I put the processor on the breadboard with a 16.000 clock oscillator connected to XTAL1 and XTAL2 and the two 22pF capacitor, then I connected RESET, MOSI, MISO and SCK to the arduino MEGA2560 pins and for last 5V and GND. I uploaded ArduinoISP to the Arduino, then I connected a 47 uF Capacitor (not 100 uF) to 5V and RESET on the Arduino board, so I tried to upload a sketch to the ATMEGA with "Sketch>Uploading using programmer", but i have this error:

vrdude: usbdev_open(): did not find any USB device "usb"

If i use "Sketch>Upload" I have this error (but i think that the first way is right, because with this one I upload the Sketch to the board, not to the processor):

Global variables use 167 bytes (2%) of dynamic memory, leaving 8,025 bytes for local variables. Maximum is 8,192 bytes. avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_getsync(): timeout communicating with programmer

So I tried to burn the bootloader, I recharged the ArduinoISP and used Tools>Burn bootloader and here i had the same error:

avrdude: usbdev_open(): did not find any USB device "usb"

Error while burning bootloader.

This report would have more information with "Show verbose output during compilation" enabled in File > Preferences.

The only thing i didn't put on the breadboard is the LED because at the moment I don't have the resistor, but it can't be the problem.

So I downloaded "Arduino sketches master" from here

https://github.com/nickgammon/arduino_sketches

and I uploaded "Atmega board detector" and this is what appears on the serial monitor:

M0gñšËŒ¡aŽ—õÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿšöµãtý

while it should say the conditions of the bootloader and the processor

P.S. I selected Arduino MEGA 2560 for the Boad and the Processor and the Port is COM3, while as Programmer: AVrisp mkII

Thank you very much for your help

Roberto

Why did you select AVRisp mkII when you're using an ArduinoAsISP as your programmer?

You need to select ArduinoAsISP as programmer when using the ArduinoAsISP sketch on an Arduino board to program a device, not some other programmer that you don't own.

You are right, I choose AVRisp because it was the one by default and I didn't think about that. Now this is the error:

avrdude: Error: Could not find USBtiny device (0x2341/0x49)

If I try to burn the bootloader this is the error:

Arduino: 1.6.5 (Windows 7), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

avrdude: Error: Could not find USBtiny device (0x2341/0x49)

Error while burning bootloader.

Obviously the atmega board detector message is more or less the same:

œÙ²1#ðeï9Ð.¦¾ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿˆu9^ÃÙþ

Hi, did you set the baud rate to 115200 in serial monitor while running the atmega board detector?

Paul

You need to select ArduinoAsISP. Not ArduinioISP (which is a different programmer that connects direct to USB)

Thank you very much for your help, now the error is:

Arduino: 1.6.5 (Windows 7), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

Build options changed, rebuilding all

Sketch uses 3,498 bytes (1%) of program storage space. Maximum is 253,952 bytes.

Global variables use 167 bytes (2%) of dynamic memory, leaving 8,025 bytes for local variables. Maximum is 8,192 bytes.

avrdude: Expected signature for ATmega2560 is 1E 98 01

Double check chip, or use -F to override this check.

Wrong microcontroller found. Did you select the right board from the Tools > Board menu?

This report would have more information with "Show verbose output during compilation" enabled in File > Preferences.

It says also "Wrong microcontroller found", as I said i selected Mega 2560 as board and ATmega 2560 as prcessor, is it right? also if I have to upload to a 328p?

The board detector says that I have to double-check the wiring... Icheck it and I think it is all right but i will check it another time.

If you're using ArduinoAsISP (or anything else) to upload to a device, the board you select is the board you are programming, always - not the board you are using as the programmer.

At the end I did it!!! Thank you so much guys!