Default state for unconnected pins and IO pins

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

My microcontroller is supposed to communicate with another controller/FPGA. For that purpose IO pins of two controllers are connected to each other. If no data direction is defined, and the pin state of the opposing controller is unknown, what is a secure state to set for my pins?

I think I once read that connecting a low output to a high output pin will cause a high current and destroy both chips. Is that true?

For pins that are floating/unconected, would I rather set high output or input with pull-up enabled in order to create a defined state for that pin?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Making it an input is safest. A series resistor could be used to prevent damage if the condition you mention occurs.

I usually set unused pins as outputs.

Leon Heller G1HSM

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As far as I am aware, all GPIOs on AVRs default to high impedance inputs which is a fairly safe state(i.e. DDRX = 0). If you want to explicitly set the state of a GPIO to be safe when connected to an unknown line you sould set the data direction to be input. So for say PORTA set DDRA=0.

-Paul

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Set as input, and enable pullups IF it is likely that all connections will be undefined. You can get excessive chip currents with floating inputs. An input with a pullup that is pulled low by and external connection should not cause any problems with external devices since the pullup current is quite low.

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!