Flashing SimonK Hex to ESCs


After some experiments applying PWM signals to an ESC controller for the Quadcopter, it rapidly became clear that the response was sluggish.  The "SimonK hex" firmware for ESC controllers appears to be the community's standard for rapidly responding ESCs.  I'm using the "MultiStar LBEC 2A 15A" ESCs from Turnigy.  After slipping off the ESC's cover slip with a razor the chip to flash becomes apparent - Atmel ATMega8A.


This video on Youtube was very useful:

Firstly the correct hex has to be chosen for these specific ESCs from a firmware archive.  These ESC appear to be discontinued on HobbyKing so I had to chose something that appeared very closely related - "kda.hex".

The flashing software, KKMulticopter tool, is a convenient way of doing things (though avrdude from the command line manually is of course possible).  From the KKMulticopter tool, choose

(1) Programmer = USBtiny simple USB programmer (or whatever yours is)
(2) Port = USB
(3) Controller = atmega 8-based brushless ESC + enable Bootloader (8kB flash)
(4) Under "Flashing firmware" tab, select "Repository tab", "all firmware types" and choose firmware "Keda (kda) V2015-04-19 by Simon Kirby" (I simply chose the most up to date one)
(5) Hold programming socket onto chip firmly and hit the go button (green button)

All things being well it should work well. If not, the most likely cause is a poor connection between the chip and the programming socket - make sure you are holding it down firmly, the controller is correctly identified and try again!

Above: I'm showing the white programming socket - it really is the easiest way to reprogram these chips.  The only tricky thing here is that a "Power surge on USB port can be detected" if you don't accurately place the pins - causing some sort of short circuit I imagine - so reset the USB port, plug and re-plug the USB programming and take care to place the programming socket accurately - or place it over the chip and hold in place with blu-tack.

Making a back up of the original firmware

Reading device signature:
avrdude -p m8 -P usb -c usbtiny
To produce:
Device signature = 0x1e9307

Reading hex file:
avrdude -p m8 -c usbtiny -U flash:r:backup.hex:i

Reading bin file:
avrdude -p m8 -c usbtiny -U flash:r:backup.bin:r

And for completion... writing the downloaded hex file to the ESC without using the KKmulticopter tool:
avrdude -p m8 -c usbtiny -U flash:w:backup.hex:i
or for future reference, the raw binary file:
avrdude -p m8 -c usbtiny -U flash:w:backup.bin:r

Final note: The ":i" and ":r" specify the file's format and can be left from the writing step, and avrdude auto-detects the format. "i" is Intel Hex default format (http://www.ladyada.net/learn/avr/avrdude.html)

References:

Flashing Turnigy ESC with Simon K Firmware
Archive of RapidESC database
KKMulticopter tool
Reading and Writing AVR firmware

Comments

Popular posts from this blog

Getting started with the Pro Micro Arduino Board

Arduino and Raspberry Pi serial communciation