Re: Floating inputs on unused GPIO pins

2008-10-28 Thread Laurent Pinchart
Hi Leon,

sorry for the late reply.

On Monday 13 October 2008, Leon Woestenberg wrote:
 Hello Laurent,
 
 On Mon, Oct 13, 2008 at 3:12 PM, Bill Gatliff [EMAIL PROTECTED] wrote:
  At least until someone plugs in that expansion module!
 
 Bill's remark made a neuron connection in my head:
 
 Can you detect if the module is inserted or not? (By reading a known
 state of some pin)?

I can, although it's a bit more complex than that. The module is connected to 
the main board I2C bus so I can detect its presence by checking if chips 
connected to the bus are detected. Using a GPIO would have been much easier, 
but that's life :-)

 You could then configure the pins dynamically in your driver.

That's what I'm doing. As dynamic pin configuration requires board-specific 
knowledge in the device driver I would have liked to avoid that if possible.

Best regards, and thanks for your help.

-- 
Laurent Pinchart
CSE Semaphore Belgium

Chaussee de Bruxelles, 732A
B-1410 Waterloo
Belgium

T +32 (2) 387 42 59
F +32 (2) 387 42 75


signature.asc
Description: This is a digitally signed message part.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

[OT] Re: Floating inputs on unused GPIO pins

2008-10-14 Thread Gabriel Paubert

[Marked off-topic because it is exclusively hardware related]

On Mon, Oct 13, 2008 at 08:12:02AM -0500, Bill Gatliff wrote:
 Laurent Pinchart wrote:
 
  
  There are no internal pull-up or pull-down resistors on the MPC8248 GPIO 
  pins. I know our hardware engineer has a valid point theoretically. Does 
  the point stand practically, or does the MPC8248 
  state-of-the-art(tm)(c)(whatever) technology make floating inputs safe ?
 
 Well, Freescale's own layout recommendations recommend pullups or pulldowns 
 for
 all input pins, but it's isn't clear what motivates that suggestion.
 
 The block diagram, Figure 37-21, is less than helpful.  :)  I recall a doc
 somewhere that showed the input protection circuitry ends up providing a 
 modest
 pullup/down, so the line never truly floats.  

It's most of the time a couple of reverse biased diodes, one pulling to
the ground and the other to the I/O supply for that pin (there may be
several differnt I/O voltages in addition to a core voltage but I
digress). This prevents the input from going outside the ground to I/O
supply range (plus/minus diode threshholds) but can be considered
as essentially free floating inside that range.

The input may well end up floating at mid-level turning on both
transistors of the input gate (actually if the diodes are well matched,
it will, but don't try to measure it with a voltmeter).

 But it's a very high-impedance path, 

True and that's why it cannot be depended upon. The DC voltage
(not taking into account pickup to which it will be very sensitive)
and the impedance will depend on several internal (diode characteristics
and matching), ambient (temperature) and external factors (resistive pick
up through sub pA level surface currents from neighboring pins/tracks). 
Especially the effective impedance of the diode drops very rapidly with 
temperature (or if you prefer their leakage current increases with increasing 
temperature). This makes the circuit much more sensitive to AC pickup at
very low temperatures.

In this case the only sane solution is, unfortunately, adding external pullup
and or pulldown resistors. The resistor value can be high (47k to 1M) to limit
current waste when the signal does not have the default value. If you
expect most of your signals to be low most of the time, use pull-down
resistors, else use pull-ups (or select on a signal by signal basis if 
you can afford it, but this rule does not apply to the GPIO pin used
as a presence detect if there is one). 

Regards,
Gabriel
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: Floating inputs on unused GPIO pins

2008-10-13 Thread Geert Uytterhoeven
On Mon, 13 Oct 2008, Laurent Pinchart wrote:
 our hardware engineer asked me to make sure all unused GPIO pins are 
 configured as outputs to avoid floating inputs. He got theory on his side 
 (floating inputs can lead to higher current consumption, metastability or 
 even permanent damage), but I'd like to ask the list for practical feedback.
 
 I haven't been able to find any mention of floating input protection in the 
 MPC8248 documents. Has anyone here experienced issues with floating inputs in 
 real-life designs ? Do you setup your board with all unused GPIO pins 
 configured as outputs ?

I always thought configurable GPIO pins default to _inputs_ after power-on, so
it's safe to tie them to VCC through a pull-up resistor?
For CMOS, you can tie them to VDD or GND without a resistor.

With kind regards,

Geert Uytterhoeven
Software Architect

Sony Techsoft Centre Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium

Phone:+32 (0)2 700 8453
Fax:  +32 (0)2 700 8622
E-mail:   [EMAIL PROTECTED]
Internet: http://www.sony-europe.com/

A division of Sony Europe (Belgium) N.V.
VAT BE 0413.825.160 · RPR Brussels
Fortis · BIC GEBABEBB · IBAN BE41293037680010___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: Floating inputs on unused GPIO pins

2008-10-13 Thread Bill Gatliff
Laurent Pinchart wrote:

 
 There are no internal pull-up or pull-down resistors on the MPC8248 GPIO 
 pins. I know our hardware engineer has a valid point theoretically. Does the 
 point stand practically, or does the MPC8248 
 state-of-the-art(tm)(c)(whatever) technology make floating inputs safe ?

Well, Freescale's own layout recommendations recommend pullups or pulldowns for
all input pins, but it's isn't clear what motivates that suggestion.

The block diagram, Figure 37-21, is less than helpful.  :)  I recall a doc
somewhere that showed the input protection circuitry ends up providing a modest
pullup/down, so the line never truly floats.  But it's a very high-impedance
path, and I can't seem to find the doc anyway so it could be for a completely
different chip altogether.

The part isn't going to blow up if you leave inputs unconnected, at least if you
avoid high-EMI/RFI environments.  But I can imagine the possibility of increased
power consumption if I try hard enough.  I would think that the magnitude would
be completely swamped by the consumption of the rest of the chip, however...

The technical answer might not be the best political one, at least not without
Freescale-branded docs to back you up.  I say, write the code and make everyone
else happy.  :)

At least until someone plugs in that expansion module!


b.g.
-- 
Bill Gatliff
[EMAIL PROTECTED]
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Floating inputs on unused GPIO pins

2008-10-13 Thread Laurent Pinchart
Hi everybody,

our hardware engineer asked me to make sure all unused GPIO pins are configured 
as outputs to avoid floating inputs. He got theory on his side (floating inputs 
can lead to higher current consumption, metastability or even permanent 
damage), but I'd like to ask the list for practical feedback.

I haven't been able to find any mention of floating input protection in the 
MPC8248 documents. Has anyone here experienced issues with floating inputs in 
real-life designs ? Do you setup your board with all unused GPIO pins 
configured as outputs ?

Best regards,

-- 
Laurent Pinchart
CSE Semaphore Belgium

Chaussee de Bruxelles, 732A
B-1410 Waterloo
Belgium

T +32 (2) 387 42 59
F +32 (2) 387 42 75


signature.asc
Description: This is a digitally signed message part.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: Floating inputs on unused GPIO pins

2008-10-13 Thread Laurent Pinchart
Hi Leon,

On Monday 13 October 2008, Leon Woestenberg wrote:
 Hello Laurent,
 
 On Mon, Oct 13, 2008 at 11:56 AM, Laurent Pinchart
 [EMAIL PROTECTED] wrote:
  our hardware engineer asked me to make sure all unused GPIO pins are
  configured as outputs to avoid floating inputs. He got theory on his side
  (floating inputs can lead to higher current consumption, metastability or
  even permanent damage), but I'd like to ask the list for practical
  feedback.
 
 Ideally, configure them as inputs or tri-state (both mean high
 impedance), and do use pull-down or -up resistors.

As I explained in my mail to Geert, that's not really an option. The GPIO pins 
are connected to an optional expansion module. When the module is plugged in 
the pins have dedicated functions. When the module is not present they are by 
default floating inputs. That's the case our hardware engineer is concerned 
about.

 Now, the answer might be different when your pins are not connected.
 Check on the processor if internal pull resistors are present. If so,
 use as input. If not, then your h/w engineer *may* have a point, not
 sure on that though.

There are no internal pull-up or pull-down resistors on the MPC8248 GPIO pins. 
I know our hardware engineer has a valid point theoretically. Does the point 
stand practically, or does the MPC8248 state-of-the-art(tm)(c)(whatever) 
technology make floating inputs safe ?

-- 
Laurent Pinchart
CSE Semaphore Belgium

Chaussee de Bruxelles, 732A
B-1410 Waterloo
Belgium

T +32 (2) 387 42 59
F +32 (2) 387 42 75


signature.asc
Description: This is a digitally signed message part.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: Floating inputs on unused GPIO pins

2008-10-13 Thread Leon Woestenberg
Hello Laurent,

On Mon, Oct 13, 2008 at 11:56 AM, Laurent Pinchart
[EMAIL PROTECTED] wrote:
 our hardware engineer asked me to make sure all unused GPIO pins are 
 configured as outputs to avoid floating inputs. He got theory on his side 
 (floating inputs can lead to higher current consumption, metastability or 
 even permanent damage), but I'd like to ask the list for practical feedback.

Ideally, configure them as inputs or tri-state (both mean high
impedance), and do use pull-down or -up resistors.

Now, the answer might be different when your pins are not connected.
Check on the processor if internal pull resistors are present. If so,
use as input. If not, then your h/w engineer *may* have a point, not
sure on that though.

Regards,
-- 
Leon
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: Floating inputs on unused GPIO pins

2008-10-13 Thread Laurent Pinchart
Hi Geert,

On Monday 13 October 2008, Geert Uytterhoeven wrote:
 On Mon, 13 Oct 2008, Laurent Pinchart wrote:
  our hardware engineer asked me to make sure all unused GPIO pins are
  configured as outputs to avoid floating inputs. He got theory on his side
  (floating inputs can lead to higher current consumption, metastability or
  even permanent damage), but I'd like to ask the list for practical
  feedback.
  
  I haven't been able to find any mention of floating input protection in
  the MPC8248 documents. Has anyone here experienced issues with floating
  inputs in real-life designs ? Do you setup your board with all unused GPIO
  pins configured as outputs ?   
 
 I always thought configurable GPIO pins default to _inputs_ after power-on,
 so it's safe to tie them to VCC through a pull-up resistor?
 For CMOS, you can tie them to VDD or GND without a resistor.

That's not really an option. The GPIO pins are connected to an optional 
expansion module. When the module is plugged in the pins have dedicated 
functions. When the module is not present they are by default floating inputs. 
That's the case our hardware engineer is concerned about.

Best regards,

-- 
Laurent Pinchart
CSE Semaphore Belgium

Chaussee de Bruxelles, 732A
B-1410 Waterloo
Belgium

T +32 (2) 387 42 59
F +32 (2) 387 42 75


signature.asc
Description: This is a digitally signed message part.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: Floating inputs on unused GPIO pins

2008-10-13 Thread Leon Woestenberg
Hello Laurent,

On Mon, Oct 13, 2008 at 3:12 PM, Bill Gatliff [EMAIL PROTECTED] wrote:
 At least until someone plugs in that expansion module!

Bill's remark made a neuron connection in my head:

Can you detect if the module is inserted or not? (By reading a known
state of some pin)?

You could then configure the pins dynamically in your driver.

Regards,
-- 
Leon
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: Floating inputs on unused GPIO pins

2008-10-13 Thread Leon Woestenberg
Hi Laurent,

On Mon, Oct 13, 2008 at 1:04 PM, Laurent Pinchart
[EMAIL PROTECTED] wrote:
 There are no internal pull-up or pull-down resistors on the MPC8248 GPIO 
 pins. I know our hardware engineer has a valid point theoretically. Does the 
 point stand practically, or does the MPC8248 
 state-of-the-art(tm)(c)(whatever) technology make floating inputs safe ?

Ask Freescale?

Regards,
-- 
Leon
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev