Hello,
I've just got a Teensy 2.0 and a keypad PCB that outputs I2C. Since I2C only uses 2 pins (SCL1 and SDA1) and of course 5V+ground, I was wondering whether I had to wire (or ground?) all the other Teensy pins also. Or can I leave them unwired?
Thank you in advance.
Arduino/Teensy + I2C
- hasu
- Location: Japan
- Main keyboard: HHKB
- Main mouse: HHKB
- Favorite switch: Topre
- DT Pro Member: -
How to do with unused pins always intrigues me.
To avoid damaging pin what should I do? I'd mean latchup with 'damage' here. Accidental shout circuit with VCC or GND lines causes damage on port, right? Hi-Z seems to be safe option for this purpose to me, though I have almost zero EE knowledge. If I can understand correctly Hi-Z pin draw/drains only very very few current.
EDIT: I'd mean Hi-Z is a safe option if you leave pins open unwired. Externally pulled down/up pins are more safe, right? And then which pin state should I use when pins are pulled up/down externally? Sorry for many many questions
And some document of power saving recommends pins are externally pulled up or down with resistors. I'm not sure how this works. Why does this contribute to power saving? and does AVR internal pullup also works for this purpose?
AVR pin states:
To avoid damaging pin what should I do? I'd mean latchup with 'damage' here. Accidental shout circuit with VCC or GND lines causes damage on port, right? Hi-Z seems to be safe option for this purpose to me, though I have almost zero EE knowledge. If I can understand correctly Hi-Z pin draw/drains only very very few current.
EDIT: I'd mean Hi-Z is a safe option if you leave pins open unwired. Externally pulled down/up pins are more safe, right? And then which pin state should I use when pins are pulled up/down externally? Sorry for many many questions

And some document of power saving recommends pins are externally pulled up or down with resistors. I'm not sure how this works. Why does this contribute to power saving? and does AVR internal pullup also works for this purpose?
AVR pin states:
Code: Select all
DDR PORT State
-------------------------------------------
0 0 Input(Hi-Z)
0 1 Input with pullup
1 0 Output Low
1 1 Output High
- hasu
- Location: Japan
- Main keyboard: HHKB
- Main mouse: HHKB
- Favorite switch: Topre
- DT Pro Member: -
I was too lazy to even see datasheet 
Atmel recomends unused pins should be internal pull-up unless you use external pull-up/down resistors. This seems to be mainly for power saving.
My questions still aren't answered completely. Now, "This also works for avoiding damage of pin like latchup?"
ATmega32u4 datasheet says:

Atmel recomends unused pins should be internal pull-up unless you use external pull-up/down resistors. This seems to be mainly for power saving.
My questions still aren't answered completely. Now, "This also works for avoiding damage of pin like latchup?"
ATmega32u4 datasheet says:
10.2.6 Unconnected Pins
If some pins are unused, it is recommended to ensure that these pins have a defined level. Even
though most of the digital inputs are disabled in the deep sleep modes as described above, float-
ing inputs should be avoided to reduce current consumption in all other modes where the digital
inputs are enabled (Reset, Active mode and Idle mode).
The simplest method to ensure a defined level of an unused pin, is to enable the internal pull-up.
In this case, the pull-up will be disabled during reset. If low power consumption during reset is
important, it is recommended to use an external pull-up or pull-down. Connecting unused pins
directly to VCC or GND is not recommended, since this may cause excessive currents if the pin is
accidentally configured as an output.
- hasu
- Location: Japan
- Main keyboard: HHKB
- Main mouse: HHKB
- Favorite switch: Topre
- DT Pro Member: -
Thanks.
Yeah, latch-up might be misuse in this context and I don't understand it at all, my main concern is how can we avoid destructing open unused I/O ports. I usually left my Teensy pins open and it has no enclosure so completely exposure on my messy desktop.
As you mentioned, Output states will be dangerous for open pins. When I destroyed a port accidentally, state of the port was probably output. I'll keep my open pins Hi-z until I get clear answer or better solution.
Yeah, latch-up might be misuse in this context and I don't understand it at all, my main concern is how can we avoid destructing open unused I/O ports. I usually left my Teensy pins open and it has no enclosure so completely exposure on my messy desktop.
As you mentioned, Output states will be dangerous for open pins. When I destroyed a port accidentally, state of the port was probably output. I'll keep my open pins Hi-z until I get clear answer or better solution.