ATMEGA2560 Standalone I2C issue Wire lib

Hi,

i am using an ATMEGA2560 for i2c communication. Burning the bootloader and programming with the arduino IDE worked well.

But now i am in Trouble using i2c communication with the Wire lib:

Using no pullups i get:

SCL constant at 0.7V
SDA at 5V

Using 4.7K Pullups:
SCL constant at 2V
SDA at 5V

I tried to trigger the pins with Digitalwrite(20&21) high&low, which worked well, even in high frequency.

Any suggestions how to solve this problem?

If needed i can provide futher information.

BR
Towo

Hi,

Share your code and give me the description of what you are trying to do. So that it would be easy to help.

i am using the master_write example.

I flashed it to an arduino mega, where it works. SDA and SCL are both at 5V and i can see the Signals(voltage Drops) on my oscilloscope.

Same Programm on the ATMEGA2560 standalone PCB, delivers SCL at 0.7/2V. SCL/SDA are not connected to anything else on the pcb, except the breakout Pins.

towo:
Same Programm on the ATMEGA2560 standalone PCB, delivers SCL at 0.7/2V. SCL/SDA are not connected to anything else on the pcb, except the breakout Pins.

I2C is "Open collector", this means that Master and Slaves only pulls SCL and SDA to ground when communicating, so pull up resistors are required.

Usually if I don't have pullups when I'm doing prototyping I just add something like 0.9" OLED display or other I2C device – they usually have pullups on them (check with multimeter) and run "I2C scanner" script.

Mega2560 has pullup resistors on the board.

Standalone Atmega2560, you need to add them into your design.