Presume this also applies to tinyAVR-0/1 ... Two questions:
1) It appears that only TWI0 has alternate IO pins. Is this interpretation correct? In documentation on PORTMUX (megaAVR-0-series Family Data Sheet), only TWI0 seems to have control bits. <ERROR>I had assumed that 4808/9, etc, had more than one TWI interface. Just discovered that there is ONLY one, So, the question is nonsense. Sorry. </ERROR>
2) What are the appropriate settings for the SDA and SCL pins? Do you set both as output? Or does it have to be switched between TWI read and write operations? Is there an outut pin mode that really behaves open-drain? In particular, the Family Data Sheet says:
Peripherals such as USARTs and timers may be connected to I/O pins. Such peripherals will usually have a primary and optionally also alternate I/O pin connection, selectable by PORTMUX. By configuring and enabling such peripherals, the general-purpose I/O pin behavior normally controlled by PORT will be overridden by the peripheral in a peripheral-dependent way. Some peripherals may not override all of the PORT registers, leaving the PORT module to control some aspects of the I/O pin operation. Refer to the description of each peripheral for information on the peripheral override. Any pin in a PORT which is not overridden by a peripheral will continue to operate as a general- purpose I/O pin.
There does not seem to be a statement in the TWI chapter about this.
Thanks for your help!