EmbeddedRelated.com
Forums

One line inverted UART (LANC <--> 2148)

Started by Kevin Townsend January 3, 2009
I wanted to connect a 2148 to the LANC port on a Canon/Sony video
camera to control the focus/zoom/etc., which should be fairly easy
since LANC uses a basic inverted 8 byte asynchronous pattern
(http://www.boehmel.de/lanc.htm).

I can read the signals with my logic probe, but reading through the
2148 user manual, I don't see how to use inverted signals with
UART0/1 on the 2148. Is there a specific register that I need to use
to indicate that the bits are inverted (0 = high, 1 = low)?

As well, I'm not really clear how the wiring works, since LANC has an
async one-line interface (http://www.boehmel.de/lanc_kli.gif), but
UART0 and UART1 both have seperate lines for RX and TX. Is it not
possible to use the UART in a one-line setup, and if so how would I
wire the single lead coming from the camera's LANC port?

Sorry if this is all terribly obvious stuff. I have no background
whatsoever in electrical engineering, and am making the remote as a
way to learn a bit more about ARM development.

Kevin.

An Engineer's Guide to the LPC2100 Series

--- In l..., "Kevin Townsend" wrote:
> As well, I'm not really clear how the wiring works, since LANC has an
> async one-line interface (http://www.boehmel.de/lanc_kli.gif), but
> UART0 and UART1 both have seperate lines for RX and TX. Is it not
> possible to use the UART in a one-line setup, and if so how would I
> wire the single lead coming from the camera's LANC port?
>
> Kevin.
>

Hi Keven,

>From the link

" LANC is a bidirektional serial open collector "

Ok, this means that the LANC can only pull the line low.

A pull up resistor pulls the LANC line back high.

Any circuit can pull the line low with a simple transistor circuit.

Google for "open collector circuit" to see how to hook this up.

So the RX input is connected to the LANC port thru a resistor and the
TX line drives a transistor (thru another resistor).

One line, two directions.

don

> Google for "open collector circuit" to see how to hook this up.
>
> So the RX input is connected to the LANC port thru a resistor and the
> TX line drives a transistor (thru another resistor).
>
> One line, two directions.

Don:

Thanks for the reply. I see there are lots of schematics for this, and
I'll try setting one up and see if I can get it working.

Kevin.
Please let me know if you come up with something with this. I tried in
the past to interface with LANC and I found it very difficult. I blame
it on the fact I didn't have any scope to check the timing of my
frames... By the way most implementations I've seen don't use a UART,
they use a GPIO, which is toggled in/out depending if you want to
either listen for or send frames...

Good Luck,
Jean
On 3-Jan-09, at 10:14 PM, Kevin Townsend wrote:

> > Google for "open collector circuit" to see how to hook this up.
> >
> > So the RX input is connected to the LANC port thru a resistor and
> the
> > TX line drives a transistor (thru another resistor).
> >
> > One line, two directions.
>
> Don:
>
> Thanks for the reply. I see there are lots of schematics for this, and
> I'll try setting one up and see if I can get it working.
>
> Kevin.
>


> Please let me know if you come up with something with this. I tried
in
> the past to interface with LANC and I found it very difficult. I
blame
> it on the fact I didn't have any scope to check the timing of my
> frames... By the way most implementations I've seen don't use a
UART,
> they use a GPIO, which is toggled in/out depending if you want to
> either listen for or send frames...

As I understood it, you need to send the commands from the remote
device to the camera in the middle of the second byte (though I
haven't gotten that far yet), meaning at least for the 2nd byte I
would indeed have to use GPIO, wait for the end of the fourth bit,
and toggle the GPIO line on and off manually to recreate the required
bit/byte signals. I think I saw somewhere that there are 107 S
between each bit? In any case, I expect it will be a bit of a
headache to get everything just right, but I'll see if I succeed or
not. I have a basic oscilloscope and a logic probe that should make
debugging a lot easier. (I actually just tried out the logic probe
for the first time with the LANC signals, and it definately makes
life a LOT easier to see the data visually, particularly since I
suspect Canon and Sony cameras might be using different commands for
the zoom speeds, etc. The software for the probe I bought is quite
handy that way, and worth the ~100 I paid for the device:
http://www.saleae.com/logic/ ).

Kevin.