Re: Output state handling in 8255 driver

On 18/02/05 14:48, David Schleef wrote:
> On Thu, Feb 17, 2005 at 06:35:32PM -0500, Frank Mori Hess wrote:
> 
>>On Monday 14 February 2005 07:36 am, Ian Abbott wrote:
>>
>>>Hi,
>>>
>>>After using comedi_dio_config (INSN_CONFIG) on a DIO subdevice managed
>>>by the 8255 driver, the 8255 chip sets all its output lines to 0 but the
>>>copy of the output state saved by the 8255 driver in the 'state' member
>>>remains unchanged.
>>>
>>>Would it be better if:
>>>
>>>(i) the 8255 driver zeroed its output state when configuring the i/o
>>>directions, or
>>>(ii) the 8255 driver rewrote its current output state to the chip when
>>>the i/o directions have changed?
>>
>>I think the first option is better, since it makes more clear to the user 
>>that something bad has happened.  If the driver rewrites the output state, 
>>it still won't prevent a transient glitch on the output, which could cause 
>>people problems.
> 
> You're supposed to be able to write an output state to a DIO
> device that is configured to input.  When reconfigured for
> output, the driver should change the lines from high-impedance
> to the preset state.

That's what my second option would do, but there would be an unavoidable
glitch on any output channels that were set to 1 before the
reconfiguration.  Well, the driver could avoid writing the 8255 mode if
it hasn't changed and so avoid the glitch in that case.

-- 
-=( Ian Abbott _at_ MEV Ltd.    E-mail: <abbotti_at_mev.co.uk>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-

Received on 2005-02-18Z18:07:11