Hi,
Just a short story, how I'm re-flashing ESC's
1) After opening ESC, you need to solder wires to the ISP pads.
2) Connect them to the arduino
Code: Select all
10: Reset
11: MOSI
12: MISO
13: SCK
GND: GNG
vcc: +5v
Note, that we are going to power up ESC's MCU from the arduino through USB, so you need to connect ISP +5v to the arduino's vcc pin.
3) In the Arduino IDE open sketch: Examples\ArduinoISP and upload it into aduino.
4) As we are going to use AVRDude as a programmer, we need to disable reset from USB. Some boards have a switch, some does not (Pro Mini, for example). Easiest way to disable reset on boards without switch is to connect resistor 30 ohm between VCC and RST pins.
5) As I said before, we are going to use AVRDude. It is shipped with arduino IDE and located in \hardware\tools\avr\bin. You can set environment variable ARDIDE and you can copy-paste commands. My arduino mapped to com3, you need to change it to your serial port. Next we need to run this:
Code: Select all
"%ARDIDE%\hardware\tools\avr\bin\avrdude.exe" -C "%ARDIDE%\hardware\tools\avr\etc\avrdude.conf" -v -p m8 -P com3 -c avrisp -b 19200
In case everything connected correctly, it should respond:
Code: Select all
avrdude.exe: Version 5.4-arduino, compiled on Oct 11 2007 at 19:12:32
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
System wide configuration file is "H:\Program Files\arduino-0022\hardware\tools\avr\etc\avrdude.conf"
Using Port : com3
Using Programmer : avrisp
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 :
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 4 20 128 0 no 512 0 0 9000 9000 0xff 0xff
flash 33 10 64 0 yes 8192 64 128 4500 4500 0xff 0x00
lfuse 0 0 0 0 no 1 0 0 2000 2000 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 2000 2000 0x00 0x00
lock 0 0 0 0 no 1 0 0 2000 2000 0x00 0x00
calibration 0 0 0 0 no 4 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
Programmer Type : STK500
Description : Atmel AVR ISP
Hardware Version: 2
Firmware Version: 1.18
Topcard : Unknown
Vtarget : 0.0 V
Varef : 0.0 V
Oscillator : Off
SCK period : 0.1 us
avrdude.exe: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.03s
avrdude.exe: Device signature = 0x1e9307
avrdude.exe: safemode: lfuse reads as 2E
avrdude.exe: safemode: hfuse reads as CF
avrdude.exe: safemode: lfuse reads as 2E
avrdude.exe: safemode: hfuse reads as CF
avrdude.exe: safemode: Fuses OK
avrdude.exe done. Thank you.
If something wrong, check your wiring, com port, power, etc..
6) If you want to backup existing firmware, execute the following:
Code: Select all
"%ARDIDE%\hardware\tools\avr\bin\avrdude.exe" -C "%ARDIDE%\hardware\tools\avr\etc\avrdude.conf" -p m8 -P com3 -c avrisp -b 19200 -U flash:r:flash-orig.hex:i -U eeprom:r:eeprom-orig.hex:i
avrdude.exe: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.05s
avrdude.exe: Device signature = 0x1e9307
avrdude.exe: reading flash memory:
Reading | ################################################## | 100% 14.55s
avrdude.exe: writing output file "flash-orig.hex"
avrdude.exe: reading eeprom memory:
Reading | ################################################## | 100% 20.97s
avrdude.exe: writing output file "eeprom-orig.hex"
avrdude.exe: safemode: Fuses OK
avrdude.exe done. Thank you.
7) To flash new firmware:
Code: Select all
"%ARDIDE%\hardware\tools\avr\bin\avrdude.exe" -C "%ARDIDE%\hardware\tools\avr\etc\avrdude.conf" -p m8 -P com3 -c avrisp -b 19200 -U flash:w:Mystery20A_arduino_pwm.hex
avrdude.exe: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.03s
avrdude.exe: Device signature = 0x1e9307
avrdude.exe: NOTE: FLASH memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude.exe: erasing chip
avrdude.exe: reading input file "Mystery20A_arduino_pwm.hex"
avrdude.exe: input file Mystery20A_arduino_pwm.hex auto detected as Intel Hex
avrdude.exe: writing flash (2336 bytes):
Writing | ################################################## | 100% 3.81s
avrdude.exe: 2336 bytes of flash written
avrdude.exe: verifying flash memory against Mystery20A_arduino_pwm.hex:
avrdude.exe: load data flash data from input file Mystery20A_arduino_pwm.hex:
avrdude.exe: input file Mystery20A_arduino_pwm.hex auto detected as Intel Hex
avrdude.exe: input file Mystery20A_arduino_pwm.hex contains 2336 bytes
avrdude.exe: reading on-chip flash data:
Reading | ################################################## | 100% 4.20s
avrdude.exe: verifying ...
avrdude.exe: 2336 bytes of flash verified
avrdude.exe: safemode: Fuses OK
avrdude.exe done. Thank you.
8) Test your ESC with current limiter first. It could be just automotive bulb connected in series.
regards,
ziss_dm