Electronics > Beginners
Resolved: I2C and the case of the disappearing device...
(1/2) > >>
NivagSwerdna:
... let me tell you a story...

I have a PCB which has two I2C devices on it and some pull up resistors from SCL to VCC and SDA to VCC.  I picked 47k as a value for the pull-ups  :o

Now to test the set-up I have been using an Arduino UNO (effectively a AVR 328P) using the 'Wire' library which uses TWI and turns on the internal pull-ups which are around 20k.

Testing (100kHz) shows that almost always I see the device nearest the UNO; the further device only appears sometimes.

Now I am assuming this is because I was wrong in picking 47k?  But why?
Dabbot:
I don't see why it would be the resistors. Remove them, given the lib is using internal pull-ups? Can you disable the internal pull-ups? Try slower / faster operating frequencies?
hexreader:
I know little about I2C, but 4k7 seems to be the most common value for pull-up. I have seen 10K and 2k2, but never 47K.

47K seems way too high to me.

As to why - no idea. I just copy schematics of professional products that I trust.
rstofer:
47k is way over the top.  There is a specification by NXP that shows how to calculate the resistors but 2.2k isn't too small.  I tend to use something around 4.7k.  Never as high as 10k.

Section 7 here:

https://www.nxp.com/docs/en/user-guide/UM10204.pdf
NivagSwerdna:
Thanks all...

I read the datasheet a bit more carefully  :palm: and found...

" In typical applications, values of 1.8 kΩ to 4.7 kΩ are used, depending on the bus capacitance, I/O voltage, and the desired communication speed. "

Which is consistent with your ideas above... looks like I was an order of magnitude out... I'll tweak it and see what happens.

 8)
Navigation
Message Index
Next page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod