Author Topic: Mixed 100kHz/400kHz I²C slaves on one bus  (Read 4395 times)

0 Members and 1 Guest are viewing this topic.

Offline leonerdTopic starter

  • Regular Contributor
  • *
  • Posts: 167
  • Country: gb
Mixed 100kHz/400kHz I²C slaves on one bus
« on: October 31, 2016, 09:58:27 pm »
I have several devices sharing an I²C bus, including an OLED display that is 400kHz-capable, and GPIO expander (a PCF8574 connected to my button panel) that isn't, only supporting 100kHz. Will "bad things" happen if I try to send data to the display at 400kHz?

For example, I could send the initial addressing byte at 100kHz so that the PCF knows to ignore it, and now presumably it will just ignore everything on the I²C line until the STOP condition anyway.
 

Offline wraper

  • Supporter
  • ****
  • Posts: 16862
  • Country: lv
Re: Mixed 100kHz/400kHz I²C slaves on one bus
« Reply #1 on: October 31, 2016, 10:04:02 pm »
PCF8574 supports 400 kHz, check the datasheet again.
 

Offline newbrain

  • Super Contributor
  • ***
  • Posts: 1719
  • Country: se
Re: Mixed 100kHz/400kHz I²C slaves on one bus
« Reply #2 on: November 01, 2016, 01:00:31 am »
PCF8574 supports 400 kHz, check the datasheet again.
The newer ones, yes, both from TI and NXP.

If they are older chips (Philips, maybe others?), not so much.
When they started supporting 400kHz, I frankly don't know.

As for mixing I2C speeds on the same bus, I would not advise it. The slower device might get confused by the faster speed.
Nandemo wa shiranai wa yo, shitteru koto dake.
 

Offline wraper

  • Supporter
  • ****
  • Posts: 16862
  • Country: lv
Re: Mixed 100kHz/400kHz I²C slaves on one bus
« Reply #3 on: November 01, 2016, 01:14:38 am »
PCF8574 supports 400 kHz, check the datasheet again.
The newer ones, yes, both from TI and NXP.

If they are older chips (Philips, maybe others?), not so much.
Checked datasheets, Phillips/NXP must be PCA8574 to support 400 kHz. Although newer PCF8574 from NXP might have the very same die inside and just have a different marking. There seems to be no 100 kHz only from TI.
« Last Edit: November 01, 2016, 01:17:55 am by wraper »
 

Offline leonerdTopic starter

  • Regular Contributor
  • *
  • Posts: 167
  • Country: gb
Re: Mixed 100kHz/400kHz I²C slaves on one bus
« Reply #4 on: November 01, 2016, 11:05:20 am »
Yeah; the difference between the NXP and the TI datasheets got me first time. Another difference between those two is that the TI sheet says their A0/A1/A2 lines have pullup resistors, whereas the NXP doesn't, and my chip seems to agree. If I don't tie high -or- low then they float randomly. So I definitely have the NXP version.
 

Offline leonerdTopic starter

  • Regular Contributor
  • *
  • Posts: 167
  • Country: gb
Re: Mixed 100kHz/400kHz I²C slaves on one bus
« Reply #5 on: November 01, 2016, 11:22:41 am »
Well this is odd.

A close look at my chip does reveal the TI logo, not the NXP one. It doesn't have what I can recognise as a date code, but it says in total:

(TI logo) 46AN27M  E4
PCF8574AN

I've tried talking 400kHz to it and it appears to work absolutely fine. But yet, those address lines just float without being tied in either direction.

Either way - I do have everything working reliably at 400kHz as it turns out.
 

Offline Nick Novak

  • Contributor
  • Posts: 24
  • Country: ca
Re: Mixed 100kHz/400kHz I²C slaves on one bus
« Reply #6 on: November 04, 2016, 06:29:35 pm »
It's my understanding that slower devices will hold the clock low for as long as they need.  So you may end up with a 100KHz bus as a result of the slower chip or that slower chip may just decide it can go 400K but I don't think you're going to break the bus.

Nick
 

Offline leonerdTopic starter

  • Regular Contributor
  • *
  • Posts: 167
  • Country: gb
Re: Mixed 100kHz/400kHz I²C slaves on one bus
« Reply #7 on: November 04, 2016, 06:42:09 pm »
It's my understanding that slower devices will hold the clock low for as long as they need.  So you may end up with a 100KHz bus as a result of the slower chip or that slower chip may just decide it can go 400K but I don't think you're going to break the bus.

Nick

Sometimes. Rarely. Some particularly new fancy modern chips that might be on mixed-bus systems do that. But doing that requires adding a pulldown transistor on the SCL line of the chip, whereas most cheaper chips (such as these simple GPIO expanders I'm using) won't have that. They're really readonly on SCL.
 

Offline suicidaleggroll

  • Super Contributor
  • ***
  • Posts: 1453
  • Country: us
Re: Mixed 100kHz/400kHz I²C slaves on one bus
« Reply #8 on: November 04, 2016, 07:09:23 pm »
You could always use a 4:2 rail-to-rail analog mux to split your I2C bus up into slow and fast sides.  Just make sure to choose a mux with reasonable on-state resistance, there are lots of options.
 

Offline leonerdTopic starter

  • Regular Contributor
  • *
  • Posts: 167
  • Country: gb
Re: Mixed 100kHz/400kHz I²C slaves on one bus
« Reply #9 on: May 05, 2017, 12:06:51 pm »
You could always use a 4:2 rail-to-rail analog mux to split your I2C bus up into slow and fast sides.  Just make sure to choose a mux with reasonable on-state resistance, there are lots of options.

Well to be honest, unless there are addressing conflicts, there's no need to isolate the 400kHz-capable slaves from the master when it's talking to the slow ones. So a simpler setup involving a couple of analog switches (e.g. the 74HCT1G66) between the master/fast bus and the slow bus should suffice.
 

Offline AndyC_772

  • Super Contributor
  • ***
  • Posts: 4228
  • Country: gb
  • Professional design engineer
    • Cawte Engineering | Reliable Electronics
Re: Mixed 100kHz/400kHz I²C slaves on one bus
« Reply #10 on: May 05, 2017, 12:33:47 pm »
If nothign else, the slower slaves will need to decode the address phase correctly in order to know they're NOT being accessed. If they see a blur, you can't be sure they won't think they recognise their own address every so often, and start ACKing when you don't want them to.

So, it's another vote here for separating the buses. I suggest an analogue switch IC, or perhaps more easily, just use a couple of GPIO pins on your processor to drive the slower devices on one bus, and keep the display on its own on a second bus.


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf