Electronic – the simplest hot swappable bus protocol

bus

After I figured that I2C bus is hard to be hot swapped unless use other hardware solution such as PCA9511A(very expensive industrial solution), I am planning to use another bus to replace I2C.

The requirement of the ideal bus should be:

  1. require as less as the data lines (\$\le\$ 2 is the best)
  2. MUST capable with hot swap
  3. low manufacture cost (as low as possible)
  4. stable
  5. no specific transmit speed/bandwidth (< 2 kb should be fine)
  6. no specific maximum networked devices (around 5 will be fine)
  7. pure protocol hot swap(I know some USB are using the combination of long&short physical pins on the connector to control the priority of which module is detached first, but unfortunately it is not feasible in our design.. therefore we need a pure protocol contained hot-swap solution)

I hope there exist some protocol that matches my requirements but I am quite hard to find them and don't know hidden issues behind them. I know there are some modules designed products such as blocks can make that, so for any suggestions I am deeply appreciated, thanks…

Kind Regards

Best Answer

I'm pretty sure you can make any bus hot swappable (I'm not aware of any hardware reason that would keep you from making a bus hot swapable). Powering the digital devices on the device is one of the biggest problems. A hot swappable device needs to take in power control as more of a consideration than the bus because it can cause a voltage spike in your system when its plugged in.

The problem is two fold:
1) There needs to be a way to detect that the bus is connected or not and the digital devices that are being swapped need to be powered before you start talking to it. There are connectors that exist that connect the ground first before any other power is applied to the pins. Why? because if you connect the digital lines (like VDD) first then you could have your transistors come up in a funny state (metastability). Especially if you have two different digital rails. This also allows for power caps to charge.

2) There also needs to be a way to detect if the 'bus' is plugged in, either with a switch or connector. Some connectors also come with pins that are as long as the ground so when the connector is plugged in, other digital logic can be alerted that there is a device and the software can talk to it. One thing I've done is put a pull up on the device and when it gets powered up, the microprocessor polls the pin of each device and when it detects the pullup the device gets turned on.

On the flip side, if you unplug it while its on, you need a way to quickly shut off power and digital logic (go to a high Z state on a buffer or microprocessor).

I've made a hot swappable SPI bus before with buffers on each device that wouldn't turn on until the processor enabled them.

You should be able to do this with I2C, if you wanted to do this with one I2C device on the bus and a buffer.

pure protocol hot swap(I know some USB are using the combination of long&short physical pins on the connector to control the priority of which module is detached first, but unfortunately it is not feasible in our design.. therefore we need a pure protocol contained hot-swap solution)

So one thing you will need to be concerned about is power, if you do indeed want a 'hot swappable' bus, you are going to have to control the power.

You could do a cold swapping approach where the software controls the power (via switches) on the outside and does not power up the device until it is fully 'plugged' in.

If you want a fully hotswappable device with power control on the device there exists IC's that do this Then its all software after that.

Most of the time its the software that really keeps you from hot swapping, it faults when it can't find the device after its removed.