Maker Pro
Maker Pro

AVR servo control + RS232

R

René

Jan 1, 1970
0
Another question for the distinguished forum:

I need to control two hobby servo motors (0.8-2.2 ms drive, 20 ms
cycle) while reading serial input (TTL RS232) and sending other serial
data.

The Servo signals need a resolution of 256 steps over the 0.8 - 2.2 ms
range, and no interrupt or such should interfere with the PWM output
(unless PWM value is changed).

It seems to me that a Mega 8 should work here (16 bit timer
resolution, 2 output compares; UART, send serial data can be performed
in the "leftover" time in the 20 ms cycle)

....but it would not surprise me at all if a much better solution
exists.

application: 2 servos to pan / tilt a camera, output serial data to
control a CCD camera zoom lens. Incoming data format is different from
the data we need to sent to the camera.

The in / out serial data is proprietary, so "off the shelf" solutions
do not exist - we have to do the decoding ourselves.

Opinions welcome! Again thanks in advance!
 
R

René

Jan 1, 1970
0
I have been out of the AVR area for a bit. But I would get an AVR with
a uart, and use RVKBASIC (download from www.bastoc.com). And that
should do it. I made a small robot (2 futaba servos) and a license
plate (disappear) device with 1 servo.. Each were 5-10 hours projects.

I bought some mega8 uC to play months ago.. Do not recall if they had a
uart, but I would bet they do since I picked them over all the others.

Thanks for all that answered. I guess I basically would need a simple
controller (Tiny 26 grade) but fitted with dual uart / 16bit PWM - and
this combination seems not to exist.
The task seems fairly simple, but the HW requirements make a "heavier"
controller necessary.

I built servo control HW already (simple 3 channel tester with eprom
posiotion memory), using no PWM at all, just time slicing. About any
AVR would do it.
But this probably excludes the use of a SW uart as I cannot handle
incoming data interrupt when the servo pulse is processed.
 
Top