Turnigy Usb Linker Driver For Mac

Nov 24, 2019  Turnigy Usb Linker Driver For Mac - mileseverything’s blog; Turnigy USB Linker Compatible AquaStar water cooled Super Brain Fatboy ESC eBay; KKMulticopter Flashtool; Post navigation; Turnigy USB linker teardown - SiLabs C8051F330 MCU; If you have a USBtiny the flashtool newer than 0. Pinout of image 1 is the look onto the pins on the kkboard.

Binary Downloads: http://0x.ca/tgy/downloads/

This tree contains Atmel AVR assembly code for ATmega-based 3-phasesensor-less motor electronic speed control (ESC) boards, originally forTurnigy and similar models. This work is based on Bernhard Konze's'tp-18a' software, which was a port from his earlier personal work to theTowerPro 18A and original (not current!) Turnigy Plush boards. Please seetgy.asm for Bernhard's license.

Patches and comments are always welcome! Let me know how it goes!


  • 16MHz operation on most boards
  • 16-bit output PWM with full clock rate resolution (~18kHz PWM witha POWER_RANGE of 800 steps)
  • 24-bit timing and PWM pulse tracking at full clock rate resolution
  • ICP-based pulse time recording (on supported hardware) for zero PWMinput control jitter
  • Immediate PWM input to PWM output for best possible multicopterresponse (but NOT where soft start or really any significant currentlimiting is needed!)
  • Accepts any PWM update rate (minimum ~5microseconds PWM low time)
  • Optimized interrupt code (very low minimum PWM and reduced fullthrottle bump)
  • Configurable board pin assignments by include file
  • Smooth starting in most cases
  • Forward and reverse commutation supported, including RC-car stylereverse-neutral-forward PWM ranges, with optional braking


See http://wiki.openpilot.org/display/Doc/RapidESC+Database and/orhttps://docs.google.com/spreadsheet/ccc?key=0AhR02IDNb7_MdEhfVjk3MkRHVzhKdjU1YzdBQkZZRlEfor a complete list.
Some board pictures here: http://0x.ca/sim/esc/


  • If it breaks, you get to keep both pieces!
  • Use at your own risk, and always test first without propellers!
  • New Turnigy Plush, Basic, Sentry and Pentium boards (Hobbywing OEM)have all switched to SiLabs C8051F334, d'oh!
  • If your ESC has 6 pads and an AVR, it's probably compatible; the padsare MOSI, MISO, SCLK, GND, VCC, and RESET. If it has 4 pads, it isprobably a newer SiLabs-based one, for which this code will not work.(Except HK_261000001 which has 4 pads but has an AVR.)
  • I build and maintain this in Linux with AVRA (1.3.0 or newer). Patcheswelcome for AVR Studio APS files, etc.
  • The TowerPro/Turnigy Plush type boards typically do not come withexternal oscillators, which means their frequency drifts a bit withtemperature and between boards. Multicopters and RC-car/boatcontrollers (with a neutral deadband) would probably be better on aboard with an external oscillator. The Mystery/BlueSeries boardstypically have them, as well as most higher current boards.
  • This doesn't yet check temperature or battery voltage. This is notdesired on multi-rotor platforms; however, people still want to usethis on planes, cars, boats, etc., so I suppose I'll add it.

Building from Source

AVRA 1.3.0 or newer or avrasm2, part of the AVR Tools, should assemblethis source. AVRA should also build on a Mac. 'make all' will emit a.hex file for every build target; 'make binary_zip' will make a release.zip file. There are some other make targets for programming.

In AVR Studio, the Makefile is not supported, and just loading tgy.asmand attempting to build it will not define the constant indicating theboard type / build target. You must either edit tgy.asm or add an optionfor the assembler command line to define the board symbol, unlessbuilding the default 'tgy' board type. For example, this option shouldemit the bs_nfet target: -D bs_nfet_esc=bs_nfet_escLook near the top of tgy.asm for the includes and board information.


Never just randomly try build targets until one works, especially notwhen directly powered from a LiPo! :P Many boards have inverted FETdrives and different pin assignments. Toggling one wrong pin can frymultiple FETs. Some boards, like the Mystery 20A ESC, may all look thesame on the outside by have different FETs as well. Be careful and checkyour board before flashing.


For more information, check out these sites:

See warning above! The safest arrangement is to use a current-limitedbench power supply, set to a low voltage (6V-7V), for both flashing andinitial testing. If the pinout is wrong and causes a short, the currentlimiting causes the input voltage to drop below the brown-out detectionvoltage of the MCU, causing all output pins to go high-impedance inhardware, and an automatic reset when the voltage comes back.

If you do not have a current-limited supply, you can improvise by using 4AA batteries or an old NiCd pack or even a LiPo with a 12V light bulb inseries to act as a current limiter. Be careful when touching the board,since it can be quite easy to turn on a FET gate with just your finger.This should be OK if you have a current-limited supply, since it shouldjust reset.

Even if the board appears to be one tested by others, make sure yourshas the expected FET pin assignments, inversions, and sense lines! Theassignments for each board type can be found in the .inc files, andthe actual pin mappings can be found in the first few pages of ATmega8datasheet. This typically requires a voltmeter and, preferably, anoscilloscope.

When not powered, use a voltmeter to check the path from the MCU pins toeither the FET resistors, transistors, or driver chips, and verify thatthey match the assignments in one of the include files. Then power upthe ESC with the original firmware, and check with an oscilloscope theinversions of the same pins. A voltmeter may be used instead when themotor is stopped. Be careful not to short FET pins together! If allvoltages are low when the motor is off, nothing is inverted, and theINIT_Px values in the .inc file should be 0 for all of the FET bits.

Older and smaller boards typically use P-FETs and N-FETs in the H-bridge;the P-FETs are typically driven by three NPN transistors, while theN-FETs are driven directly at TTL voltages with just a low resistor.Medium-sized and newer boards have moved to all-N-FET designs, butmaintain the NPN transistors, and so have inverted P-FET pins from theMCU. Larger current (>~30A) boards typically have separate FET driverchips, to which the N-FET or P-FET pins may be inverted (but not both,since it would blow up before the MCU initializes).

PWM is usually done on the low side of the H-bridge, where high frequencydriving is easiest. If the average voltage increases at the AVR pin asthrottle increases, and drops to 0V when stopped, the low-side FETs arenot inverted; if average voltage decreases, and rises to 5V when stopped,the low-side FETs are likely inverted. The high side FETs are onlyswitched at every other motor commutation step, and so switch at a lowerfrequency, and should be off 2/3rds of the time. If at 0V when stopped,and less than 2.5V average when running, the P-FETs are not inverted. Ifat 5V when stopped, and more than 2.5V when running, the P-FETs areinverted. In the case of inverted an FET group, they should be listed inthe INIT_Px values (to turn them ON at boot), and the 'on' macros shoulduse clear instead of set instructions. The inverse applies to the 'off'macros.

There are four sense lines. The three output phases go through resistordividers (to bring the voltage down to between 0-5V), and then areconnected to ADC channels which can be accessed by the comparator withthe ADC multiplexer when the ACME (Analog Comparator Multiplexer Enable)bit is enabled. Some boards use all ADC channels while others put one pinon AIN1 so that the ADC can sample voltages on other ADC channels whilethe comparator samples that phase. A 'center tap' is established with aresistor star and connected to AIN0 on all boards, for detecting thezero-crossing from the motor back-EMF for timing. You can check whichpins run to which output phases as they will have the lowest resistancefrom output phase to AVR pin, and all three will have a common resistanceto the AIN0 pin.

Boot Loader

Since the 2012-06-01 release, the pre-built .hex files contain a bootloader that allows for flash and EEPROM reading and writing over the PWMinput wire. The main purpose of this boot loader is to support softwareupdates without having to expose the MCU or ISP pads for SPI programming,assuming this version or newer has previously been flashed.

The boot loader is available on all boards which are wired in way thatpermits two-way communication over the wire. Some ESCs are isolated withan opto-isolator or by components to invert the signal to be compatiblewith ESCs that do have an opto-isolator, such as ESCs that work with thekda.hex target. Such boards will not be able to use this protocol.

The boot loader uses an implementation of the same wire encoding as theTurnigy USB Linker. This is a simple 9600bps serial to half duplex wireconverter that encodes signals in a way that should make it difficult tostart a motor, even on an ESC not supporting the protocol, regardless ofdata sent. However, it is still possible that this could occur, so followthe same precautions as with normal ISP flashing, below.

If the Turnigy USB Linker is not available, it is possible to use anArduino or MultiWii board as a gateway between (USB and) serial and thewire protocol used by the boot loader. See the ArduinoUSBLinker projectby Chris Osgood: https://github.com/c---/ArduinoUSBLinker

Boot Loader Fuses

Since the 2012-09-30 release, long periods of high PWM input whiledisarmed will cause a jump to the boot loader, if present. Since the2013-04-24 release, this became detangled from the included boot loader(BOOT_JUMP vs BOOT_LOADER), so other boot loaders may be used instead.

As a result of the automatic jumping, it is not necessary to change thefuses to enable the boot loader. It may or may not be desirable to setthe BOOTRST flag depending on intended operation and the hardware in use.

If the hardware does not have any low pass filter or pull-down on the PWMinput, it may easily float high by the time the boot loader checks it,which can prevent normal startup if another input (eg: I2C) is expectedto be used. There should be pull-down or load present on the PWM inputto prevent this if BOOTRST is enabled.

Confusion may also result if the pin floats high with nothing connectedand power is connected to check for starting beeps. Likewise, touchingthe connector or connecting it later may drain the input and cause normalstartup to occur, which may seem like the ESC is resetting while powered.This is not a problem if the PWM input is normally intended to be used.

On the other hand, with BOOTRST not set, it is not possible to recoverfrom an interrupted flash, flash of the wrong board type, or flash ofother software or versions older than 2012-09-30 without connecting tothe ISP pins to do the flashing.

To enable the the boot loader on ATmega8 boards, the low nibble of thehfuse should be set to 'a'. See 'make bootload_usbasp' to do thisautomatically. BOOTRST and BOOTSZ1 should be enabled to set 512 words,start at $0E00.

Flashing and Testing

Sort out how you want to connect an ISP programming device to the chip.Some boards have 6 pads in a row for this purpose. You can either solderwires, or make up some kind of springy-pin connector that touches thepads or chip pins without needing to solder. This is helpful whenflashing more than one board. See here for some ideas and discussion:http://www.rcgroups.com/forums/showthread.php?t=1513678

Sort out which software you will use for flashing. The KKMulticopterFlashtool now supports ESC flashing and is commonly used. You may alsodownload AVR Studio and the AVR Toolchain from www.atmel.com, or try'avrdude' on most OSes. There are plenty of resources on the web for AVRISP programming, and many ways to do it.

Power the ESC from a current-limited supply and try to read the stockfirmware (flash) and EEPROM, to use as a backup. Most are locked andwill still appear to read, but the files will contain just a series ofrepeating/increasing digits. If you do manage to get something, consideryourself lucky!

Write down the stock fuse values, and check that they are sane. Most AVRprogrammers have a menu for this, but with avrdude or uisp, Google 'AVRfuse calculator', select the ATmega8 target, and type in the hex values.If the 'watchdog' fuse is enabled, you will want to disable it for now.The brown-out voltage should be set to 4.0V and enabled (BODEN). Leavethe rest of the fuse values as shipped, and write down the new values.

Flash the desired target .hex file to the AVR, then set the fuses, ifanything needs changing. If you have any errors, check the connectionsto and voltage at the chip. Sometimes, a weak power or signal connectioncan temporarily work and then fail part-way through programming, givingverification errors. This can happen particularly if the target chip ispowered weakly by the programmer itself, which then back-feeds to therest of the circuit and tries to charge the capacitor, etc. Also checkthat the ground pin (black wire) actually connects to a pin marked 'GND',not 'NC' as on some USBasp devices!

Once programming is successful, hook up a small motor without propellerand reset the power. You should hear three increasing beeps. If not, orif you hear only some beeps, the FET pinout may be incorrect or one ormore FETs may be broken. Repetitive clicking can also indicate that thepinout is incorrect and causing continuous brown-out resets.

Now, if you attach a valid PWM servo pulse with low-enough pulse length,you should hear a forth beep indicating that the ESC is armed. If not,try lowering the trim as far as possible. If it still doesn't work, youmay need to raise the STOP_RC_PULS value in the code.

Once armed, the ESC will try to start the motor if the pulse length(throttle) is increased. Try running up the motor slowly, and make sureeverything runs smoothly. If on a variable supply, increase the voltageto the expected running voltage, and try again, with slow and rapidthrottle changes.

Finally, test the ESC in the intended application, with the usual powersource, without anything attached to the motor shaft/bell first. Then,attach the propeller or gear, etc., LOCK IT DOWN so it doesn't hit you inthe face, and try a slow sweep from idle to full throttle. Finally, tryrapid throttle changes from slow to fast. The ESC and motor should runsmoothly, never lose timing, and the ESC should not reset. If using aflight control board, you can sometimes tap the board to make it output asudden throttle increase.

For debugging reset causes, recent code has different beep sequences foreach AVR reset case. See the Troubleshooting section below.

SmartCode VNC Manager Serial Number Keygen for All Versions Find Serial Number notice: SmartCode VNC Manager serial number, SmartCode VNC Manager all version keygen, SmartCode VNC Manager activation key, crack - may give false results or no results in search terms. Found results for Smartcode Vnc Manager 5 crack, serial & keygen. Our results are updated in real-time and rated by our users. SmartCode VNC Manager is designed for effective remote desktop management, system administration and for helpdesk environments. SmartCode VNC Manager offers built-in support for VNC, RDP, Citrix ICA, Microsoft Hyper-V, SCCM Remote Control, RAdmin, SSH, Telnet, Team Viewer, HP Remote Graphics, DameWare Mini Remote, LogMeIn and Windows Remote Assistance. Vnc manager free. SmartCode VNC Manager 6.13.0 Enterprise Edition Keygen can moniter all your remote environments from a single interface. SmartCode VNC Manager help you to take control of any computer running VNC, Remote Desktop Services, Citrix ICA, Microsoft Hyper-V, Microsoft Virtual Server 2005, RAdmin, SSH, Telnet, Team Viewer, HP Remote Graphics, DameWare Mini Remote, Windows Remote Assistance, or LogMein.

Throttle Calibration and Programming

Since the 2012-01-04 release, the input throttle range may be calibrated.This should be used whenever PWM input mode is used, including whereexternal resonators are present, to set the usable throttle range.

The default range is set at the top of tgy.asm (stop at 1060us, fullthrottle at 1860us) and is not changed if no new value is saved to theEEPROM. However, boards without external oscillators (typically thosewhich use tgy.hex) must use the internal RC oscillator on the Atmega8,which may be off by 5% - 10% between each board, and will also drift by10% or more over a 40 degree Celsius temperature range. This can causethrottle differences between boards if not calibrated, and issues armingthe ESC, particularly in cold environments.

Some flight boards may have automatic calibration procedures, or it mayjust be possible to set the min/max motor output to exactly match the ESCdefaults listed above. ESCs with external resonators can use this methodto avoid calibration. With a flight board such as the Naze32 runningbaseflight, the min/max can be set with CLI commands as follows:

set minthrottle=1064

set maxthrottle=1864

Otherwise, to calibrate the ESC, REMOVE ALL PROPELLERS and follow thesteps that may be documented for your flight controller board. KK2 boardshave a two-button procedure that emits calibration pulses automatically.With KK boards, the Yaw pot must be set to the minimum position in orderto enable 'pass through' mode from the RX input to the ESC output. TheESCs are then calibrated to the radio's throttle stick.

Calibration may also be done with a servo tester or with the ESC directlyconnected to an RX channel. The only requirement is that the input pulsehas to be at or above PROGRAM_RC_PULS (default 1460us) to enterprogramming mode. This will differ slightly on boards with no externaloscillator. If calibrating ESCs individually, try to maintain a closetemperature and at least 6-7V input voltage (the ATmega8 oscillatorspeeds up as temperature and Vcc decrease).

With the propellers removed and the source (radio, servo tester, or flightcontrol board) set to full throttle, power up the ESC and wait for asingle beep after the typical rising initialization beeps. This indicatesthe high pulse length has been saved to RAM. Move the stick or knob tothe lowest setting, and wait for two beeps. This indicates that the lowpulse length has been saved to RAM.

If RC_PULS_NEUTRAL has been enabled (RC Car-style reverse mode), move thestick/knob to the center, and wait for three beeps. This indicates thatthe neutral pulse length has been saved to RAM.

If the stick is not moved after the final setting, the ESC should nowwrite the RAM settings to EEPROM, and continue startup. The ESC shouldrecognize the same pulse length input as a valid arming pulse, and armand work as usual.

The input PWM pulse is measured in 24-bit space and scaled in 16.16 spaceto fit the number of PWM steps defined by POWER_RANGE - MIN_DUTY. Thereshould be no measurable aliasing or quantization. Alternatively, thevalues may be adjusted in EEPROM directly. While calibrating, margins of1/16th on the low end and 1/32nd on the high end are used to try toavoid problems with arming and reaching full throttle during temperatureextremes. If desired, margins may be adjusted in tgy.asm between rc_prog2and rc_prog5.

There is currently no way to reset (remove) the calibration other than byclearing the EEPROM (or reflashing without EESAVE set). This may beimplemented in the future by some basic stick programming feature.

NOTE: As of 2012-03-15, throttle calibration is disabled when a brown-outreset is detected. I accidentally calibrated an ESC when testing with aNiCd pack. The pack could not supply enough current, resulting in abrown-out reset of all ESCs, excluding the flight controller. I did notlower the throttle in time, resulting in one ESC getting a stable enoughsignal to store a new calibration. When intentionally calibrating, besure that you cleanly connect the power. If you don't hear the risingbeeps, remove the power for a few seconds to allow the capacitors todischarge, then try again.


There are 4 main beep frequencies used at different intervals and lengthsto signal the various operation and fault states. These beep frequenciesare labelled here as f1 through f4, where a higher number indicates ahigher frequency. Repetition indicates longer beeps.

If CHECK_HARDWARE is enabled (default on the Afro and TBS boards), thedrive and sense circuitry will be tested for correct operation at boot.This check will prevent beeping if it would be unsafe to do so (forexample, if beeping would end up completing a short circuit), and so mayprevent further damage in some cases.

Error conditions from CHECK_HARDWARE are flashed through the LED(s), ifpresent, or beeped (if possible) before anything else, in a loopingpattern, for as long as the error condition(s) persist. All conditionscannot be checked on some hardware due to pin routing, but will beindicated by beeping or flashing a particular count followed by a pause.If more than one error condition is present, each error will be reportedin sequence. The error conditions are:

Note that if the ESC resets while the motor is still spinning (such asafter a brief power cut), it is possible that the induced current willcause some transient errors that will clear once the motor stops, andthen operation will continue.

During boot, the MCUCSR register is checked to see the reason for reset.For exact behaviour, see near 'Check reset cause' in tgy.asm. Here are theexpected beep sequences:

f1 f2 f3: Regular startup with nothing special detected

f3 f1: Voltage brown-out bit was set (MCU voltage dropped below 2.7V/4.0V)

f4: External reset (via the reset pin, as in after programming)

looping f1 f1 f3 f3: Watchdog reset (previous execution locked up)

looping beeps (8) of f2 or f4: Unknown (beeps out all MCUCSR bits, LSF)

fast repeating beeps of f4 while idle: Noise on PWM input detected

Once a valid input source is found and receiving idle throttle, f4 f4 f4(a long f4 beep) indicates that the ESC is armed and will start the motorwhen throttle goes non-zero. If you are unable to start the motor and arenot hearing the forth, long beep, try lowering the throttle trim, orraise it all the way to start throttle calibration (above).

If no input command is received for about 1 second, f3 f2 is beeped andthe ESC returns to disarmed state, waiting for a valid arming signal.

If no valid input is received while disarmed and BEACON is enabled, an f3beep will be emitted after about 8 seconds and then every 4 seconds.

The various beep frequencies use different FET combinations (rather thanall FETs at the same time) to try to help diagnose boards with failedFETs or possible incorrect firmware pin configuration (build target). Ifyou hear only one or two of the usual three power-up beeps, and the boardworked previously, it is likely that one of the FETs has burned out. TheESC may still start and run the motor like this, but the motor will soundbad, and power and efficiency will be reduced.