Tri-level Logic input

Hi all, I'm trying to interface with a tri-level logic input (HIGH,Open,LOW), for "Open" mode can I just simply Write a '0' to an input pin to sets the pin in tri-state mode on Arduino side.

No.

There is no such thing as a tri level logic input.

There is such a thing as a tri level logic output however.

So what to you want to connect to what?

Analig input and external resistors divider( 10 kilo Ohms approx).

May be used this divider:
internal PullUp(to +5V) 10 kilo Ohms resistor:

pinMode(14, INPUT); // sets the analog0 pin as input
digitalWrite(14, HIGH); // internal pullup resistor ON

and 10 kilo Ohms resistor to GND.

trembo.
The above is total rubbish and quite incomprehensible with regards to the original question.

Wolfson WM8741(Hardware mode) pin 22-OSR , datasheet stated " "Digital input Tri-Level" with 0, Z, 1 . My question is how to use Arduino to control this input pin .

Thanks !

Ok I will admit that I have never come across the term "Digital input Tri-Level", and I am in good company. If you put that into google the only hit you get is a reference to that data sheet. Therefore I conclude it must be their own propitiatory term. I will do a bit of research and come back to you.

However I must say that trying to bolt this on to an arduino is like trying to fit a jet engine onto a lawn mower.

There is no such thing as a tri level logic input.

Sure there is. For example, I have some cameras that use single wires to control zoom and focus: drive the wire positive, and it pulls zoom/focus one way, drive it negative, and it pulls the other way. If you leave the line undriven, the zoom/focus stays where it is.

I haven't torn into the cameras, but the inputs probably have something like a voltage divider that biases the input to a known state, and a pair of comparators to detect "actively high" and "actively low" (or they might use a power opamp to drive the motor. Someday I may try feeding a camera lower voltages to see whether I can control the speed of the zoom, as well as direction).

I wound up using two digital outputs and a pair of opamps (one for driving positive, one for negative) with series diodes on the outputs so they wouldn't drive the line when they were in the "wrong" state.

The Wolfson chip appears to be doing something similar, but with a 0-Vdd input range: leave the pin open, and it's treated as a third logic level.

You might be able to get the desired effect by configuring the Arduino pin as an input, and doing a digitalWrite(pin_num, 0) to turn off the internal pull-up. But the Wolfson datasheet doesn't specify how much current is needed to drive the inputs, so there's still a small chance that leakage out of the Arduino inputs would be enough to activate them. It might be necessary to insert relays, or something like a CD4066 analog switch, into the path to ensure that the Wolfson inputs are "open".

Yep after a look at the data sheet I would say that is right.
It appears that a high impedance is used say on pin 24 to select 2 wire software, with a logic 1 selecting 3 wire software and a logic zero selecting hardware mode.
However I have never herd it called it this (hence lack of google hits), I have however seen the technique used to select a wide range of addresses for an I2C device with a limited number of pins.
The data sheet says:-

Tri-level pins who require the 'Z' state to be selected should be left floating (open)

However, as these pins are used to set up different modes of operation there is no need to actually control them from the arduino as you will only want it to operate in one mode in any one application so you can just hard wire them (or not).

Ran,
That camera control system, I have always known as push pull control.