I'm putting together a small protoboard project to read a MPU-6050 based gyro using I2C (fast mode).
(I previously was able to do I/O using a Arduino Uno 3 w/ 328p. And taking a break from my power converter project.)
Anyhow, I'm want to know if the internal pull-up can work for this, and if not, how to size the pullup.
The Curiosity Nano board runs the processor at 3.3v. The MPU-6050 is advertised to run at 3.3v and runs w/ fast mode (oh, or standard mode) I2C.
The Nano pull-up resistor (according to the 48-pin datasheet) is ~ 35 kOhm (low 20 kOhm, high 50 kOhm).
The Nano TWI pin capacitance is rated at 20 nF.
The I2C spec indicates that t_rise for fast mode (400 kHz) shall be 20-300 ns, for normal mode (100 kHz) t_rise shall be less than 1000 ns.
Also from the I2C spec, I find Rp min is 0.5 kOhm, and Rp max = t_rise / (0.8473*Cb)
where Rp max is in kOhm, t_rise is in ns and Cb, the total bus capacitance, is in pF.
At best, t_rise = 300 ns and Cb = 20 nF giving 17 kOhm. This is looking bad to me. I'd rather take 100 ns, 100 nF, giving 1.1 kOhm (pulling ~ 3 mA).
Or, for standard mode, t_rise < 1000 ns. If I assume Cb is 100 pF, then I get 11.8 kOhm,
Q1: Is the 100 pF bound on bus capacitance for breadboard w/ 2 in wires valid?
Q2: Is the conclusion that I should use 1 kOhm external pullup valid?
My next step is the software. The AVR 0-series TWI is a bit more complex than the 328p.
The first step I've done is to make a finitie state machine diagram. (I can post if you care.)
And I've started writing code based on my state machine diagram.