TWI/I2C Stability / Exception handling

Hey

Just wondering if there is any way to do some sort of checks to see if a device is present before doing some sort of transaction on that device...
What I am finding is, if I dont have a device connected that should be, the code basically hangs. Is there something that can be done to prevent this?

Also I am finding that the arduino will hang at random and I havent found out why yet. I have made a custom board, I have decoupling caps, I have 1.3K pullup resistors on the SDA and SCL lines at the microcontroller too.
I have a couple of boards which all talk over I2C - I assume I only need pullups at the master?

Thanks

Find a thread where a member has inserted a time-out in the I2C code two weeks ago... You need that.

1.3k resistors - this is funny value - how comes? 4.7 k should suffice even with 3 or more devices on the bus. Best have the resistors at the end of the bus.

Thanks
I read somewhere that 1K minimum, 1.5K is ideal. I had some 1.3k's so just used them.

I will try to find that post - thanks.

Here it is
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1283887406

And 1.3k will do no harm - I just wondered...

Yep thanks - found it too.
I have modified my files and see how it goes.

Also found part of my stability issues were with exceptions running on one of the slaves, and not making the variables in question volatile. That coupled with the TWI timeout (or lack of it) caused the master to lock up when the slave locked up due to a memory issue.

Hopefully that is sorted now.

Cheers
James