Can anyone just verify quickly for me that this:
cbi(PORTD, 0); cbi(PORTD, 1);
will disable the internal pullups on the AT90USB1286? I'm trying to avoid damaging some 3.3V components that I'm communicating w/over i2c. Thanks in advance.
First of all, the cbi/sbi(PORT,PIN) macros are deprecated. I advice using
The AT90USB128 datasheet states that:
So, if the pins are configured as inputs, your command will disable the internal pull-ups.
Having said that, your setup will most likely not work unless your 3.3V devices are 5V-tolerant. I would recommend using a simple bi-directional level shifter, explained in the popular NXP/Philips appnote found here. It only requires one N-ch FET and two pull-up resistors per bus line.
Alternatively, if you have access to the 3.3V power supply you could use this to power the MCU by cutting the connection between VBUS and UVCC/AVCC/VCC (datasheet Fig. 21-5).