Hi Seb,

Below some remarks, but first the real issue to handle: how do you get
stable results and deal with interrupts?
I've made quite a few servo controllers with i2c slave and they all
suffer from slightly longer pulses every now and then, due to
interrupts.
Worst case is when you use blocking delays - a delay any time within
the pulse will give a longer pulse. And 10us longer is enough to have
effect on the servo position.
It is bettter to check a timer (we should have a lib for this since it
would complete the set of delays), use a ccp unit to restore the line
(but afaik this will only work on one pin - so not for 8 servo's
without additional hardware) .
What might work (but I have not tried this yet) is to use interrupts
for the servo pulse only and use polling to handle serial and i2c
slave.

And... non-blocking run at a much too low interval (100us minimal) to
give a proper resolution.


2009/2/17 Sebastien Lelong <[email protected]>:
> Looking at the code, I've seen the "isr_counter" pseudo variable. I wonder
> if it would be better to have it named timer0_isr_counter, as there could be
> collision with other potential ISR lib. What's your point on this ?
I never had this collision and it is unlikely since you probably won't
have more then one fixed-interval isr (whose purpose in life is to
increment this counter). So I don't see a reason to change it (but no
reason to stick to it either, appart that maybe we want to provide the
same function from an other timer when 0 is in use)


>   - can at least handle 8 servos. (maybe more ? What it the max ? Using
> *blocking* delays, since signal must be sent every 20ms, and since delays
> can last max 2ms per servo -- or 2.5ms ? --, this gives 20/2 = 10, or 20/2.5
> = 8 servos.
iirc it is up to 2.5 ms, so 8 will be the limit.

>   - can set position between 0 and 255. O means no signals, 255 means max.
> Should a higher resolution be needed ?
No, 255 will do.

>
> Do you think about any other features ?
calibration data per servo - min and max may vary from servo to servo
and when you control many servo's, you want the controller to handle
this corrrection.


> About PWM software, it should be possible to extract pwm_software.jal
> library for this. Can be useful in many, many other projects.
??? I don't understand what you try to tell us.

Joep

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to