Using an AT90USB162 I need to switch some I/O ports back and forth between input and output. Section 11.2.3 of the datasheet is called "Switching Between Input and Output" and mentions the intermediate state that occurs when switching from input to output. For example:
"Switching between input with pull-up and output low generates the same problem. The user must use either the tri-state ({DDxn, PORTxn} = 0b00) or the output high state ({DDxn, PORTxn} = 0b11) as an intermediate step."
That makes sense. What I don't understand is why there is no discussion about switching from Output to Input. If the current state is output low ({DDxn, PORTxn} = 0b10) and the target state is input with pull-up ({DDxn, PORTxn} = 0b01), won't a similar intermediate step occur (either output high, or input with no pullup)? Or does this not occur due to the synch latch described in section 11.2.4? It seems to me that the this latch just effects the timing of the PINxn registers states, and wouldn't eliminate an intermediate step.