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?
@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?
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...
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.
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
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
A signature of 000000 or FFFFFF often indicates a wiring error. Only you can fix your wiring.
Other possibilities:
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.
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:
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.
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?
Michiel_:
About the fuses... can I find a tutorial on that somewhere?
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: