Device signature problems

Hi everyone!

Im having a lot of problems programming the ESCs of my new quadcopter.
I want to flash SimonK on it, and I wanted to do it with my Arduino UNO as ISP.

However, in every application I try (avrdude, ESC flashing tool, KK flashing tool, BLheli suite), I get a signature error... The last one I got was:

So, I already asked for help at the flitetest forum, but they didn't really know how to solve the problem :frowning:

So, is there someone who can help me recognising and solving the problem, before I go buy an usbprogrammer, only to use it once?

Thanks in advance!

What chip is in this ESC that you are trying to flash to? What signature are you getting? What signature do you expect? What board / chip settings do you have in the IDE when you compile / upload?

Getting a signature of 000000 usually means that either the wiring is wrong or the system clock of the target chip is not running.

Note: Clones of the USBasp or USBtiny can be purchased through eBay for under $5. Even if you only use it once it's a good investment.

@Delta_G, everything is in the printscreen.

@johnwasser, I really want to try it with an arduino, since I dont think the connection between the laptop and programmer are the problem, but rather my settings/ connections between the ESC and programmer.

So, first, I tried to upload the ISP program on the arduino with the BLHeliSuite program, as a test. I now found out that my isp shield was causing problems (a 10uF cap between reset and ground). So I now have a correct connection between the arduino and the laptop (which was with the regular usb cable anyway).

Now, when I try to upload the firmware, I get an error message when I use the shield, which has just the normal connections, and a 10uF cap between ground and arduino reset. The error then just reads: unsupported device 0xFFFFFF.

When I connect the wires directly to the arduino (like in the arduino ISP sketch), the following error appears:

Soo... Anybody? :frowning:

UPDATE: forgot to mention: I connected the ESC to the LiPo instead of the arduino, as it seems that the esc is drawing too much power...

Michiel_:
When I connect the wires directly to the arduino (like in the arduino ISP sketch), the following error appears:

What error? Your picture chops off the part of the log that would contain the error message.

Can't you copy and paste text instead of posting pictures of your screen?

johnwasser:
What error? Your picture chops off the part of the log that would contain the error message.

Can't you copy and paste text instead of posting pictures of your screen?

I flipped the screen for a moment, now the error message is complete:

Michiel_:
@Delta_G, everything is in the printscreen.

Can you copy and paste the text instead of doing screenshots? I can't see the screenshots well enough to read them on this device.

Delta_G:
Can you copy and paste the text instead of doing screenshots? I can't see the screenshots well enough to read them on this device.

It's program enabled failed (expected 0x14, got 0x50)
Then it reports that avr is initialized and ready to accept instructions (???)
Then it reports the 000000 device signature.

It looks like you've selected stk500 programmer, rather than ArduinoAsISP - I think that may be your problem. You need to select the programmer that matches the one you're using.

Delta_G:
Can you copy and paste the text instead of doing screenshots? I can't see the screenshots well enough to read them on this device.

My apologies, didn't think of that :slight_smile:

I cant copy paste it, but i'll try to copy it by hand then... :confused:

Avrdude FAILED!

"Version 5.11.1, compiled on Oct 16 2011 at 17:19:54
Copyright (c) 2000 - 2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is "C:\Users\Michiel\Documents\BLHelisuite\Interfaces\AVRDude\avrdude.conf"

Using Port: \.\com7
Using programmer: stk500v1
Overriding Baud Rate: 19200
AVR Part: ATMEGA8
Chip Erase delay: 10000 us
PAGEL: PD7
BS2: PC2
RESET disposition: dedicated
RETRY pulse: SCK
serial program mode: yes
parallel program mode: yes
Timeout: 200
StabDelay: 100
CmdexeDelay: 25
SyncLoops: 32
ByteDelay: 25
PollIndex: 3
PollValue: 0x53
Memory Detail:

-Then there is a whole table with memory details, please let me know if it might be relevant

Programmer Type" STK%))
Description: Atmel STK500 Version 1.x firmware
Hardware version: 2
Firmware Version: 1.19
Topcard: Unknown
Vtarget: 0.0 V
Varef: 0.0V
Oscillator: Off
SCK period: 0.1 us

stk500_program_enable(): protocol error, expect=0x14, resp=0x50
initialization failed, rc=-1
AVR device initialized and ready to accept instructions
Device signature = 0x000000
Yikes! Invalid device signature.
Expected signature for ATMEGA8 is 1E 93 07
stk500_disable():protocol error, expect=0x14, resp=0x51

done. Thank you."

DrAzzy:
It's program enabled failed (expected 0x14, got 0x50)
Then it reports that avr is initialized and ready to accept instructions (???)
Then it reports the 000000 device signature.

It looks like you've selected stk500 programmer, rather than ArduinoAsISP - I think that may be your problem. You need to select the programmer that matches the one you're using.

I really have the Arduino as ISP selected, with the correct baud rate.

Another thing: while retrying, I just got an error the arduino was out of sync. Reconnecting the arduino solved the problem, but still... Im not a pro in programming and electronics, but Im still amazed by the amount of different errors I get for the same problem...

There isn't any real comms going on before it requests that device signature. The fact that it is all 0's makes me wonder if perhaps a data line is loose or the MOSI and MISO pins are crossed.

Delta_G:
There isn't any real comms going on before it requests that device signature. The fact that it is all 0's makes me wonder if perhaps a data line is loose or the MOSI and MISO pins are crossed.

I just double checked, and cant find an error in the wiring... I already programmed a couple of attiny's with the shield, and the wiring I have now.
Nontheless, I tried switching the MOSI and MISO wires. Now, the error pops up quicker, but my noob eye sees one step extra compared to the previous error:

There is no difference up until the SCK period: 0.1 us at the end (only the bytedelay is now 0 instead of 25).

So, it says:

Avrdude FAILED!

"Version 5.11.1, compiled on Oct 16 2011 at 17:19:54
Copyright (c) 2000 - 2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is "C:\Users\Michiel\Documents\BLHelisuite\Interfaces\AVRDude\avrdude.conf"

Using Port: \.\com7
Using programmer: stk500v1
Overriding Baud Rate: 19200
AVR Part: ATMEGA8
Chip Erase delay: 10000 us
PAGEL: PD7
BS2: PC2
RESET disposition: dedicated
RETRY pulse: SCK
serial program mode: yes
parallel program mode: yes
Timeout: 200
StabDelay: 100
CmdexeDelay: 25
SyncLoops: 32
ByteDelay: 0
PollIndex: 3
PollValue: 0x53
Memory Detail:

-memory details, please let me know if it's relevant

Programmer Type: STK500
Description: Atmel STK500 Version 1.x firmware
Hardware version: 2
Firmware Version: 1.19
Topcard: Unknown
Vtarget: 0.0 V
Varef: 0.0V
Oscillator: Off
SCK period: 0.1 us

AVR Device initialized and ready to accept instructions

Reading | ############################################# | 100% 0.06s

Device signature = 0x000000
Yikes! Invalid device signature.
Expected signature for ATMEGA8 is 1E 93 07

done. Thank you."

Something I was thinking about:

The error says the Vtarget and Varef are 0.0V, is that normal? (I checked, and there is 5V going to the chip...
Since I believe the connections are correct (I checked for continuity between the ESC's chip pins and the wires), Im starting to think the power to the esc might be the problem...

Also some side questions, to be sure Im not overlooking something:
-Do I need a 10uF cap between ground and arduino reset? (found out a 10uF is causing sync errors, a 47uF is not)
-Has the ESC MOSI to be connected to arduino MOSI, or MISO? (Like, what comes out the slave, goes in the master) I have it connected to MOSI, but just want to be sure, since the same error appears when switching the wires.

Michiel_:
-Do I need a 10uF cap between ground and arduino reset? (found out a 10uF is causing sync errors, a 47uF is not)

When using ArduinoISP you need some way to keep the pulse on DTR from resetting the Arduino. Usually 1 to 10 uF between Reser (+) and Ground (-) is enough. If you leave it out you would typically get a Signature or Verify error when programming.

Michiel_:
-Has the ESC MOSI to be connected to arduino MOSI, or MISO? (Like, what comes out the slave, goes in the master) I have it connected to MOSI, but just want to be sure, since the same error appears when switching the wires.

MOSI (MasterOut/SlaveIn) connects to MOSI and MISO (MasterIn/SlaveOut) connects to MISO.

johnwasser:
When using ArduinoISP you need some way to keep the pulse on DTR from resetting the Arduino. Usually 1 to 10 uF between Reser (+) and Ground (-) is enough. If you leave it out you would typically get a Signature or Verify error when programming.
MOSI (MasterOut/SlaveIn) connects to MOSI and MISO (MasterIn/SlaveOut) connects to MISO.

Thanks! Unfortunately, the cap doesnt resolve the signature error :frowning:

No one who knows a way to solve it, or a forum where I can ask for help? :frowning:

A signature of 000000 or FFFFFF often indicates a wiring error. Only you can fix your wiring.

Other possibilities:

  1. The system clock of the target processor isn't running or is running too slowly. You can use the Adafruit version of ArduinoISP to provide an 8 MHz clock to the target processor.

  2. The configuration fuses are set to disable Reset or disable Serial Programming. You will have to use High Voltage Parallel Programming to reset the fuses to factory settings.

johnwasser:
A signature of 000000 or FFFFFF often indicates a wiring error. Only you can fix your wiring.

Other possibilities:

  1. The system clock of the target processor isn't running or is running too slowly. You can use the Adafruit version of ArduinoISP to provide an 8 MHz clock to the target processor.

  2. The configuration fuses are set to disable Reset or disable Serial Programming. You will have to use High Voltage Parallel Programming to reset the fuses to factory settings.

I tried different wiring setups, and im 95% sure the wiring is correct...
Now I also tried the adafruit sketch, but to no avail... I would also be surprised that the clock would be that slow, since a quadcopter ESC needs a high refresh rate...

About the fuses... can I find a tutorial on that somewhere? :confused:

Michiel_:
About the fuses... can I find a tutorial on that somewhere? :confused:

You could look at the datasheet for the target processor.
Does your ESC have a ICSP header or are you trying to connect wires or clips to the tiny pins of a surface-mount chip?

johnwasser:
You could look at the datasheet for the target processor.
Does your ESC have a ICSP header or are you trying to connect wires or clips to the tiny pins of a surface-mount chip?

I connect the arduino to the esc according to this pinout:

I checked the pinout of the chip itself, and the pads are connected to the right pin.

Looking for the fuse setting, but to be honest, I've never heard of that before... Im a noob when it comes to electronics, actually...

EDIT: I found the algorithm for programming the ATMega8, but I have no experience in programming a chip apart from the way discussed in this thread...