# How to use Turnigy MultiStar ESC with generic microcontroller? [duplicate]

I just got the Turnigy Multistar 20 Amp Multi-rotor Brushless ESC 2-4S.

I have a motor and a battery hooked up to the ESC. On the three pin connector, I attached the brown ground wire to a ground pin, and yellow signal wire to a PWM-capable IO pin. I'm trying to figure out how to send motor signals to the ESC, with no luck. I know that I need to send PWM output through the yellow signal wire, but I don't know the frequency or high time of the PWM signal. Also, I've read that certain ESC's have an arming procedure, and I'm not sure how that works.

How do I control my ESC from a generic output pin hooked up to a microcontroller?

## marked as duplicate by Vladimir Cravero, Daniel Grillo, Scott Seidman, Blup1980, Chetan BhargavaAug 1 '14 at 0:36

• You may want to build a pulse generator firmware driven by a potentiometer or something for testing/calibration, since these are designed with the idea that the user has transmitter sticks and trims to manipulate, sometimes in quiet complicated multi-step sequences. – Chris Stratton Jul 30 '14 at 22:02
• I forgot to ask this, but what's the community opinion on self-answered questions? On Stack Overflow, they're technically encouraged but for some reason people tend to frown upon them. I just did this, and thought it would be really useful for other people. – Anubian Noob Jul 30 '14 at 22:19
• It's not clear that there's much to this that hasn't been covered here several times before, so if it's a problem you had already resolved rather than an outstanding one needing assistance, I'm not such a fan for that reason. – Chris Stratton Jul 31 '14 at 1:02
• Well that's the point of answering your own question, right? So you can help other people that have the same issues as you? – Anubian Noob Jul 31 '14 at 1:08
• The problem is that what makes your question unique from existing ones is largely irrelevant. The next person with a similar problem may have a different brand esc and not recognize yours as relevant any more than you recognized the existing coverage of pwm-driven RC gadgets as relevant. – Chris Stratton Jul 31 '14 at 1:24

The PWM output on the signal wire usually uses a 50hz signal with 1-2ms high time. The arming procedure consists of a signal of the lowest power for a short period of time, followed by a beep from the ESC.

Using Propeller GCC and the simpletools library that comes with it, it would looks something like this:

// Arming:
pwm_start(20000);
pwm_set(4, 0, 1000);
waitcnt(CNT + CLKFREQ); // Wait 1 second.

// Spin at low speed.
pwm_start(20000);
pwm_set(4, 0, 1100);
waitcnt(CNT + CLKFREQ);

// Spin at high speed.
pwm_start(20000);
pwm_set(4, 0, 2000);
waitcnt(CNT + CLKFREQ);


If you want to make it a little easier, you can write a utility method:

// Speed should be between 0 and 1.
void motorSpin(double speed)
{
pwm_set(4, 0, 1100 + 900*speed);
}


Good luck!