Uno with servo and software serial possible?

My new project requires an uno to control a servo and talk to (no need to listen from) a serial device. I think both libraries use timers. I looked on the library pages and found no mention of which timer. Before digging into their library codes, can someone tell me which timers they use and whether there will a conflict?

Thank you!

Why would you need software serial instead of using the hardware tx pin?

I haven't tried that combination, but the SoftwareSerial library blocks with interrupts disabled during transmission which I suspect will mess up the servo timing. There's an AltSoftSerial library which does a similar job and is better in some respects (and worse in others) so if you do run into trouble you could try that.

zoomkat:
Why would you need software serial instead of using the hardware tx pin?

The hardware serial is sending data to a PC already. If necessary, I will use the hardware serial and lose data logging functionality. Plus, some rewiring will be needed on a PCB I already have designed, printed and populated.

PeterH:
I haven't tried that combination, but the SoftwareSerial library blocks with interrupts disabled during transmission which I suspect will mess up the servo timing. There's an AltSoftSerial library which does a similar job and is better in some respects (and worse in others) so if you do run into trouble you could try that.

Here is an article I found online:

http://pharos.ece.utexas.edu/wiki/index.php/Resolving_the_Conflict_between_SoftwareSerial_and_Servo_on_the_Traxxas

So you are right, the software serial blocks interrupt. I will have to check busy before sending a byte (more coding).

On another note, what if I detach my servo? The servo is only used occasionally and while arduino is not communicating over software serial. It's used to occasionally lift some weight. It is at 0 degree most time, when it is not lifting weight.

If I detach servo will the servo go back to 0 degree or something worse will happen?

The behaviour could depend on the servo, but servo I've used freeze when they loses the control signal. Note that there may be a slight glitch when you reattach it - even if the signal is still driving the servo to the same position it is at.

I'll do the detach and attach then. The motor is lifting a string loop that is hooked up to a weight. Normally the main string is on a force sensor hook. This motor only needs to lift the weight at the setup stage unless I want to periodically calibrate the force sensor.

Keep in mind that when detaching the servo you are running the servo in a undefined state as servos are not designed to be powered up but with no control pulses being supplied, the manufacture simply does not state it's response to that situation. What the servo does and how much torque it may have in such a case will vary from servo to servo so what may work in your project may not work for someone that is using a different brand/model of servo.

So how frequently does a servo receive control pulse? I could detect the busy and time my serial message to avoid it, which is the better solution. My messages are hopefully short, like 1.02 blah blah.

liudr:
So how frequently does a servo receive control pulse? I could detect the busy and time my serial message to avoid it, which is the better solution. My messages are hopefully short, like 1.02 blah blah.

The servo library updates the 1-2msec pulse around every 20msec to all attached servo instances. That's loosely based on the R/C standard.

So about 17 characters at 9600 baud after each update can be sent before the next update. I can send the numbers in one shot and the rest of the text in two shots. I'll try the attach/detach first to see how well my servo behaves 25 ms without control pulses. Maybe it's ok and I am just worried too much.