ARDUINO ISP

Hello GM to all,
I am trying to download a sketch to a custom board based on ATmega328 on that I provided the 6 pin header for ICSP. To download the sketch I used the Arduino ISP programmer and the standard Arduino IDE, but I am getting the following error message and the process is aborted. Here the error message:

Programmer Type : USBtiny
Description : avrdude: programmer operation not supported
avrdude: Using SCK period of 10 usec
avrdude: error: usbtiny_receive: (expected 4, got -5)
avrdude: AVR device initialized and ready to accept instructions

Reading |
avrdude: error: usbtiny_receive: (expected 4, got -5)
avr_read(): error reading address 0x0000
read operation not supported for memory “signature”
avrdude: error reading signature data for part “ATmega328P”, rc=-2
avrdude: error reading signature data, rc=-1
avrdude: error: usbtiny_transmit:
avrdude done. Thank you.

help needed and very appreciated.
Thanks in advance.

Leo

On tools, programmer, select Arduino as ISP.

This could be connection issues, clocking issues, or power issues.

Are the m328 pre-programmed? Do you have external clocking?

mart256:
On tools, programmer, select Arduino as ISP.

If I read it correctly, I think he is using the ArduinoISP board, not the sketch. He should be selecting 'ArduinoISP' programmer type. Which is based on the USBtiny protocol.

It looks like avrude is correctly detecting his ArduinoISP programmer, otherwise it would show "Could not find USBtiny device."

My custom board has an externat resonator for the clock and I confirm that I am using the microboard ARDUINO ISP Programmer, not the ARDUINO UNO as ISP. It seems to me that the writing is ok and the subsequent reading for the verification is done with errors.

Could it be a problem with memory signature?

When an ISP programmer is unable to read the signature that is usually a connection or clocking issue to the mcu. Can you post a schematic of your custom board?

… to add a piece of more information: Using the programmer ARDUINO ISP, I can burn the the bootloader on to the ATmega328P installed in ARDUINO UNO. So I think that ARDUINO ISP programmer it’s working well in dowloading … not in reading! Attached the schematics of my board ( still in the breadbord so far). I am worried of the resonator that has the two caps of 30pF. Last remark: if I download my sketch with ARDUINO UNO and then put the ATmega328P on the breadboard, all is working fine !

BC Board.pdf (552 KB)

As I can't solve the problem with my ARDUINO ISP, could you suggest a different ISP programmer to be used to download the code to an ATmega328P based board and debug it with ARDUINO IDE 1.6.2 ?
I am a bit disappointed for having spent money for the ARDUINO ISP only for downloading the bootloader onto the ARDUINO UNO !!!

Leorke:
... to add a piece of more information: Using the programmer ARDUINO ISP, I can burn the the bootloader on to the ATmega328P installed in ARDUINO UNO. So I think that ARDUINO ISP programmer it's working well in dowloading ... not in reading! Attached the schematics of my board ( still in the breadbord so far). I am worried of the resonator that has the two caps of 30pF. Last remark: if I download my sketch with ARDUINO UNO and then put the ATmega328P on the breadboard, all is working fine !

If it downloads fine to the Uno it means it also reads well, before it download it reads (unless you want to write anyway).

You should upload an schematic of your setup, I dont think buying another programmer is going to solve the problem.

He did supply a schematic but it looks like it’s for another type mcu attiny28L.

@Leorke this schematic does not show how the ISP is connected to the board? The schematic is not for a mega328P mcu. However, the pinouts are similar in some respect except for a few i/o pins. Also the attiny28L does not support serial ISP programming. It will only support parallel programming. So the attiny28L does not work with the ArduinoISP.

What mcu is on your board? a attiny28L or atmega328p?

Disregard the name TINY 28LP that appear on the schematis. It's a problem with the model. The MCU on the breadboard (not yet on the board so far) is the ATmega328P. The schematic uploaded is reproducing the circuit on the breadboard ( in future in the board if I can use the programmer!).

Make sure your ArduinoISP connections are

6-pin ISP         mega328p
-----------     -------------
pin-1 MISO      pin-18 PB4 MISO
pin-2 Vcc       pin-7  Vcc
pin-3 SCK       pin-19 PB5 SCK
pin-4 MOSI      pin-17 PB3 MOSI
pin-5 RESET     pin-1  PC6 RESET
pin-6 GND       pin-8  GND

One thing to be careful about is the 6-pin ISP header, make sure you have the right orientation for pin numbering. It is very easy to have it reversed on the header.
ArduinoISP_Front.jpg

I checked the connections of the ISP header and ATmega328P and all is correct. I'll try to replace the resonator with a Crystal and two 22pf Caps, even if my bord is working fine with the resonator and the ATmega328P programmed through ARDUINO UNO.