Is my Mega broken...?

Hi, I've got an Arduino Mega, and I'm trying to use the http://arduino.cc/playground/Main/I2cScanner from the playground. When scanning, it prints "I2C Scanner" and "Scanning..." over serial, never does anything after that. Through a bit of debugging, it hangs up on Wire.endTransmission(). The Mega has nothing attached to it at all apart from USB. I've run the same code on a Duemilanove with nothing attached and it works fine, scanning through all the addresses.

I've tested the SDA (20) and SCL(21) pins with a scope, and if I set them as outputs and toggle them on and off, they both work fine. When setting pin 20 to input and writing high to it however, it stays low. Any ideas?

The Mega has nothing attached to it at all apart from USB.

You leave the I2C pins floating and expect a result from the scanner? What exactly do you expect as the output?

I2C needs pullup resistors to get a correct result.

When setting pin 20 to input and writing high to it however, it stays low. Any ideas?

Show us the code you use for that and the exact wiring you used (draw a circuit diagram).

pylon: You leave the I2C pins floating and expect a result from the scanner? What exactly do you expect as the output?

I2C needs pullup resistors to get a correct result.

When setting pin 20 to input and writing high to it however, it stays low. Any ideas?

Show us the code you use for that and the exact wiring you used (draw a circuit diagram).

The pins aren't floating. Wire.begin() enables the internal pull up resistors, and with nothing attached the scanner should still work but be unable to find anything. Like I said, with nothing attached to the Duemilanove it works, the same code with nothing attached to the Mega hangs.

The code for the second part is as follows. Rather simple. There is no wiring at all for the code below.

void setup(){
pinMode(20,INPUT);
pinMode(21,INPUT);
digitalWrite(20,HIGH);
digitalWrite(21,HIGH);
}

void loop(){
}

Normally the mega is hooked up to a PCB with two 4.7k pull up resistors, and a SRF02. It works fine with the Duemilanove, but not the Mega using the same wiring.

What's weird is that pin 20 stays low when the internal pullup is on, but when it's set to an output and set high, it does go high. Almost as if the internal pullup is burnt out somehow.

Just for completeness, I've got a new Arduino Mega and the I2C scanner works fine on it with nothing connected. When the pullup resistor is enabled on pin 20, it actually goes to 5v too, most useful... :P Seems the other board's SDA pin is definitely broken.