Posts

Showing posts from August, 2016

Clone wars

Image
Cloning Arduino core ... using TIMER0 in Arduino Sometimes you want to use TIMER0 in the Arduino IDE but default inclusion of Arduino libraries means that you can't have control over TIMER0 (it is used by millis() and delay() functions).  In a recent project, I wanted to use all the Atmega328 timers, and for various reasons, still use the Arduino IDE. The solution is simple .  Rather than hacking the core library, we'll clone the Arduino core library, define a board that uses the core library and then hack it to our specifications.  Steps: (1)  Clone the Arduino core Copy the Arduino core (C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores) as "arduinohacked" -  the new core directory mustn't have an underscore in it! (2) Define a new board to use the cloned core library Open "C:\Program Files (x86)\Arduino\hardware\arduino\avr\boards.txt" and put the following text at the bottom.  This will define a new board in the Arduino IDE.  I&#

Flashing SimonK Hex to ESCs

Image
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