RC India

RC Models => Self-designed, DIY and College Projects => Topic started by: Himadri Roy on March 12, 2015, 05:16:40 PM

Title: Flashing ESC with arduino
Post by: Himadri Roy on March 12, 2015, 05:16:40 PM
This tutorial was originally posted By :Oscar Liang
http://blog.oscarliang.net/flash-esc-simonk-firmware-arduino-without-usbasp/ (http://blog.oscarliang.net/flash-esc-simonk-firmware-arduino-without-usbasp/)

I had couple of HK F-30A laying around and decided to flash those with SimonK...but i dint have a USBAsp ( :( my bad!) Buy hey after seeing the pinout of the esc(RST,5V,GND,MOSI,ISO,SCK[all available on Arduino]) i decide to do it with arduino

(http://i1380.photobucket.com/albums/ah197/Himadriroy1997/IMG_20150312_160739_zpsoptr4fs4.jpg) (http://[url=http://s1380.photobucket.com/user/Himadriroy1997/media/IMG_20150312_160739_zpsoptr4fs4.jpg.html)[/url]

Things required: Arduino Uno(i used this only the pins would vary with different boards), DIY wire clamp
1)Cut the shrink wrap like this
(http://i1380.photobucket.com/albums/ah197/Himadriroy1997/IMG_20150312_160951_zpsrxqj06bw.jpg) (http://[url=http://s1380.photobucket.com/user/Himadriroy1997/media/IMG_20150312_160951_zpsrxqj06bw.jpg.html)
(http://i1380.photobucket.com/albums/ah197/Himadriroy1997/IMG_20150312_160710_zpsicxjqupc.jpg) (http://s1380.photobucket.com/user/Himadriroy1997/media/IMG_20150312_160710_zpsicxjqupc.jpg.html)

2)Here's a photo of the DIY wire clamp i made using some clips and coloured wire
(http://i1380.photobucket.com/albums/ah197/Himadriroy1997/IMG_20150312_160650_zpsidvrjpkn.jpg) (http://s1380.photobucket.com/user/Himadriroy1997/media/IMG_20150312_160650_zpsidvrjpkn.jpg.html)
I will let this upto you use your imagination to make this.. ;)
Title: Re: Flashing ESC with arduino
Post by: Himadri Roy on March 12, 2015, 06:32:31 PM
3)Prepare the Arduino..upload Arduino ISP code from examples in Arduino IDE to the board

4)Connect the wire clamp to Arduino

SCK->13
MISO->12
MOSI->11
RESET->10

(http://i1380.photobucket.com/albums/ah197/Himadriroy1997/IMG_20150312_161216_zpsgagc2tai.jpg) (http://s1380.photobucket.com/user/Himadriroy1997/media/IMG_20150312_161216_zpsgagc2tai.jpg.html)


5)Download the following softwares
Flashing tool: KKMulticopter Flashtool(http://lazyzero.de/en/modellbau/kkmulticopterflashtool (http://lazyzero.de/en/modellbau/kkmulticopterflashtool))
SimonK Firmware Download: https://github.com/sim-/tgy/downloads (https://github.com/sim-/tgy/downloads) (just get the latest one)

6)Unzip the flashing tool files into C or D drive in a folder name "flash"
Unzip the Flashing files into C or D drive in a folder name "esc"

7)Connect the clamp to esc
(http://i1380.photobucket.com/albums/ah197/Himadriroy1997/IMG_20150311_153415_zpshs3j3kq0.jpg) (http://s1380.photobucket.com/user/Himadriroy1997/media/IMG_20150311_153415_zpshs3j3kq0.jpg.html)


8)In command prompt write the following code(replace the com value with your Arduino's COM port and the drive with which you're using)

C:\flash\lib\avrdude\windows\avrdude.exe -P COM10 -b 19200 -c arduino -p m8  -v -e -U flash:w:"C:\esc\bs_nfet.hex":i

9)Before hitting enter hold your esc so to prevent any error(don't panic if you get an error. you haven't fried the ESC just redo the connections again)

(http://i1380.photobucket.com/albums/ah197/Himadriroy1997/IMG_20150312_162229_zps2jfxqx1e.jpg) (http://s1380.photobucket.com/user/Himadriroy1997/media/IMG_20150312_162229_zps2jfxqx1e.jpg.html)

10)After few seconds you should get the following output
(http://i1380.photobucket.com/albums/ah197/Himadriroy1997/IMG_20150312_163533_zpstzkfwyid.jpg) (http://s1380.photobucket.com/user/Himadriroy1997/media/IMG_20150312_163533_zpstzkfwyid.jpg.html)
(http://i1380.photobucket.com/albums/ah197/Himadriroy1997/IMG_20150312_163545_zpshhunskwz.jpg) (http://s1380.photobucket.com/user/Himadriroy1997/media/IMG_20150312_163545_zpshhunskwz.jpg.html)

Congratulations you have your SimonK ESC...don't forget to test it..you should notice the quick response and higher resolution of change of speed...
The ESC now runs cooler and huge performance change and no more irritating beeps when the throttle is idle

Don't connect the power line in reverse polarity you will surely burn the MCU
If you get any errors check you connections..
I would recommend scratching the pads lightly to remove the flux(worked for me! ;D)and then flashing
Try to keep your hands steady while flashing!
Any Good Luck flashing ESC!  ;D
Title: Re: Flashing ESC with arduino
Post by: Himadri Roy on March 12, 2015, 06:35:18 PM
This will also work for F-20A ESC
Title: Re: Flashing ESC with arduino
Post by: miginstruments on March 13, 2015, 11:38:05 AM
Hello sir I was trying to upgrade my kk board to the latest firmware using arduino, but dint succeeded. can you help me out in this regard.
Title: Re: Flashing ESC with arduino
Post by: Himadri Roy on March 13, 2015, 11:39:33 AM
Please no 'Sir' formality i'm only 17...what error are you getting? which kk your using kk2.0 or kk2.1?
Title: Re: Flashing ESC with arduino
Post by: miginstruments on March 13, 2015, 11:45:35 AM
don't no what error it is, I did it last month so don't remember what error it was. ll give a try again n let you know.