Pages: 1 [2]   Go Down
Author Topic: Can the Servo lib be made to control more than 12 servos per timer? Maybe!  (Read 1460 times)
0 Members and 1 Guest are viewing this topic.
nr Bundaberg, Australia
Offline Offline
Tesla Member
Karma: 129
Posts: 8601
Scattered showers my arse -- Noah, 2348BC.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks Duane, I'm thinking of doing a servo controller (maybe even 32 channel) in the next few months so the above will be useful.

I've seen controllers with 1uS resolution and wondered if that was really necessary, seems like it wouldn't do any harm.


Rob Gray aka the GRAYnomad

Dubai, UAE
Offline Offline
Edison Member
Karma: 22
Posts: 1675
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


My libraries get upto 20 servos by having two banks of ten, one on OCR1A and the other on OCR1B. I had considered interlacing the two banks on a single compare register but could not come up with a satisfactory way of handling the case where two or more servos need to toggle within a few us of each other.

This is a real problem because you either need to write a more complex isr which blocks for longer, or you risk situations where the timer will advance past the next output compare value before you are able to set it and you loose the frame. Splitting two banks of servos over the two output compare registers solves this quickly and easily at a hardware level.

Duane B


Pages: 1 [2]   Go Up
Jump to: