CC3000 & Servo Library - Unstable output


I'm currently hooking an Arduino Due to the Adafruit CC3000 module and a servo using the Servo library.

I'm noticing significant jitter in the Servo output and feel that it shouldn't be occurring. At first I was powering everything from the USB via the Arduino but obviously that isn't a good idea, so I've used an external 9V supply for the Arduino board and the problem still occurs.

Has anyone had any experience of this or can offer some pointers on where to start debugging the issue?

Thanks very much!

Where is the servo being powered from?

Are you using SoftwareSerial? That causes jitter in servos, particularly at low serial data rates like 9600. At that rate each character takes close to a full millisecond to send or receive and SoftwareSerial disables interrupts for that entire time. That delay in interrupts is the difference between Servo Full Left (1000 microsecond pulse) and Servo Full Right (2000 microsecond pulse). If you can use a much faster data rate that should reduce the jitter. Or use a MEGA or Leonardo and use hardware serial.

First of all. Sorry for my english is not very good.

Hi smnanthny, I have the same problem using cc3000 (aliexpress) and the tipical servo 9g. One option is atach the servo before use this, put a delay 100mls and finaly detach. This solution work fine meantime.

myservo.writeMicroseconds(1500); // set servo to mid-point
delay(100) // wait to move the servo

Other way is don't use the servo library and put directly the code... please see this link. I'm not test that yet.