You can read this, http://playground.arduino.cc/Main/I2CBi-directionalLevelShifterThere are no pull-up resistors for the I2C bus.However, the internal pull-up resistors of the Arduino microcontroller are enabled in the library.They are a lot more than 10k (About 20k...50k, it depends on the microcontroller), but with a slow I2C bus they are (barely) enough to make the I2C work.You can alter the library, or disable them after the Wire.begin() function.
I don't think so.The 20k...50k will be no problem.The 4k7 is the right value, it should work.Perhaps you have a few breakout boards with pull-up resistors on every breakout board, the total pull-up could be below 1k. That would be too low.Perhaps you have long wires, say more than 50cm, and they are close to each other, that could be a problem.Perhaps the decoupling is not good. The I2C device should have 100nF for the supply voltage.Perhaps you use a breadboard. They don't make good contact a lot of times.
That seems all good, except the breadboard.So many people have bad connections with breadboards.What I2C chip are you using ?What is your code ?
What exactly is the problem you are having.Can the arduino "see" the I2C device, try an I2C scanner program to see what addresses it picks up. Often it is the address that you are using that is wrong.
The problem is simply that sometimes the module's output frequency doesn't change.
but sometimes things work.
QuoteThe problem is simply that sometimes the module's output frequency doesn't change.That code will only set the modules output frequency to one value once per run only. Therefore if you run the code again it will not change. Only when you power it down will it change.Quotebut sometimes things work.That points to decoupling problems. Where are the output wires going to? Maybe this is causing interference that is being picked up. I would add extra decoupling capacitors to the supply.
I would check that the pull ups are actually enabled as that could cause those sorts of problems as well.I would use a large capacitor across the supply at the module end. Start with 47uF and work up to 1000uF.The other thing that could cause this is the I2C clock geeing too fast but I don't see how that can be the case.Can you examin the waveforms on a scope?
Welli am running out of ideas. Any chance of posting a photo of your setup?