Some years after that purchase, I met a guy named Lou from Camera Turret Company. He wanted to build his
own focus and zoom controller, but didn't have the
requisite embedded design or programming skills. At the
time, I had just transitioned from Parallax to EFX-TEK
where I was developing a lot of products using the SX
microcontroller, doing my programming in a mix of SX/B
(BASIC) and SX assembly.
It took a few weeks, but we had a
working prototype. Sadly, that product
never went into production. Still, it did
whet my appetite for LANC. This past
January, Lou called and asked if it would
be possible to do LANC with the
Propeller. Of course!
We pulled it off with the SX, so we
can easily do that with the Propeller. In
fact, we can do a whole lot more than we accomplished
the first time around.
Under the Hood of LANC
LANC (Local Application Control Bus; a.k.a.,
Control-L) has been available for quite a long time;
hence, is very simple. From the hardware point of view,
LANC is an open-collector serial connection that runs at
a very tame 9600 baud. The camcorder transmits an
eight-byte packet to the controller 60 times per second
(NTSC systems). Figure 1 shows the make-up of the
LANC packet. Here's the neat part: The first two bytes of
the packet are always $FF, and the camcorder reads
these back as it's transmitting them. If a connected
controller wants to pass a command to the camcorder, it
simply modifies these bytes.
But how? As I just stated, the connection between
the camcorder and controller is open-collector. What this
means — as in I2C that we covered last time — is the
serial connection is pulled high through a resistor; this
sets the idle state and "1" bit state of the line. If either
side wants to create a "0" bit, it pulls the line low. As in
I2C, neither side can drive the line high; that is always left
to the pull-up. Yes, LANC is just serial data, and pretty
slow at that. We've created software UARTs with the
Propeller many times, so this one won't be a lot of work.
Getting Connected
Figure 2 shows a very simple circuit for connecting
the Propeller (or any other 3.3V micro) to the LANC line.
If it looks familiar, you may remember it from the
Dynamixel project we did last fall. Yes, this is a very
simple bi-directional 3.3V to 5V level shifter; this circuit is
Getting Fancy With LANC
I think most of my regular readers know
that my life is pretty evenly split between
technology and entertainment — though
a good bit of my technology work is for
the entertainment industry. Having been
inspired by the Robert Rodriguez book,
Rebel Without a Crew, I bought my first
serious camcorder (Sony VX-1000) and
learned how to shoot and edit video. One
of the first accessories I purchased was a
zoom and focus controller that plugged
into the LANC (pronounced LAN-see) port
of the camera. Every time I looked at that
little port I thought, "What else could I do
with this?"
■ BY JON MCPHALEN THE SPIN ZONE
Post comments on this article and find any associated
files and/or downloads at www.nutsvolts.com/index.php?/
magazine/article/july2014_SpinZone.
12 July 2014
■ FIGURE 1. LANC packet.