From Mikal Hart: "I can officially confirm that NewSoftSerial (and really any software serial library) is incompatible with the new Servo library that ships with Arduino 0017. The problem is that the new Servo library, which is really quite cool, depends on reliable interrupts, where software serial solutions require interrupts to be disabled -- at least for short periods of time. I discovered this issue when I was trying to upgrade my Reverse Geocache box to 0017, and the only workaround I could come up with was to downgrade the Servo library back to 0016."
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1262033431
This could be a problem because I'd like to switch over to NewSoftSerial in future Arduino versions.
Comment #1
Posted on Jan 18, 2010 by Happy BirdHi,
This issue needs to be very clearly documented, since the new Servo library is also incompatible with using delayMicroseconds - a nasty surprise that took quite a few hours for me to figure out. Upgrading to Arduino 0017 totally broke my software.
Access to the hardware PWM output is a must for these cases. I'd rather have both libraries separately, since checking the pin number at runtime would require both libraries to be included in the code, bloating it unnecessarily.
As a workaround I now copied the Servo library from 0013 to a new name within my project. Overall I'd like to see more emphasis in the documentation on what library features are dependent on interrupts being enabled, and what is the effect of using for example delayMicroseconds on them.
Comment #2
Posted on Feb 6, 2010 by Quick CamelThe Issue with delayMicroseconds was fixed in 0018.
Prior to 0018, delayMicroseconds would disable interrupts for the duration of the delay which made it incompatable with any code that relied on interrupts to be serviced promptly.
In 0018, delayMicroseconds no longer disables interrupts.
For those that don’t want to upgrade from 0017 to 0018 and want to use the new servo library, a compatible version of delayMicroseconds can be cut and pasted from 0018 or copied from this thread: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1257266907/3#3
Comment #3
Posted on Jul 30, 2010 by Swift KangarooI also confirm that NewSoftSerial conflicts with Servo library. I have just tested it in a helicopter project...
Status: Accepted
Labels:
Type-Defect
Priority-Medium
Component-Core