[Ktechlab-devel] Howto implement a logic bidir pin?

David Saxton david at bluehaze.org
Fri Jan 13 18:35:26 UTC 2006


It sounds like what you're doing should work...

In the PIC component, the bidir pin is implemented as a LogicOut, with high 
impedance when configured as input and low impedance when configured as an 
input.

// Create the logic pin
LogicOut * l = createLogicOut();

// Make it an input
l->setOutputHighConductance( 0.0 );
l->setOutputLowConductance( 0.0 );
bool inputState = l->isHigh();

// Make it in output
l->setOutputHighConductance( 0.01 );
l->setOutputLowConductance( 0.01 );
l->setHigh( outputState );

The above code should work, (but I haven't tested it..)

David Saxton


On Friday 13 January 2006 16:59, Sébastien Dugué wrote:
>   Hi all,
>
>   I'm currently trying to implement a component (logic) with
> bidirectional pins. I made those pins with createLogicOut()
> but I can't seem to be able to drive a level on those pins
> when tied to a PIC.
>
>   I tried messing with setOutputHighConductance() and
> setOutputLowConductance() to revert the pin direction but
> to no avail.
>
>   What's the proper way to implement true bidir pins?
>
>   Thanks, and keep the good work, it's pretty impressive.
>
>   Sébastien.




More information about the Ktechlab-devel mailing list