Troublesome I2C slave devices - don't you just love 'em? Of course, one strategy to deal with slaves that have locked up and are no longer communicative is - if they don't have a dedicated reset pin - to cycle power to them. I was all ready to slap a P-ch MOSFET on to the VCC line and call it a day, when it occurred to me that this isn't ideal when dealing with devices that have a relatively large amount of decoupling capacitance (which mine does).
Ideally, in order to ensure a full, proper (and timely) cycling of power, you want to ensure the decoupling capacitance on the slave device is discharged fully, right? So it got me thinking that instead of just disconnecting VCC, what if we switch VCC from power to ground? This will quickly discharge the decoupling capacitor(s) and ensure the slave device is fully powered-down.
One way of doing this that came to mind was using a common 74-series 2-to-1 multiplexer to do this switching. I can connect the 'select' input to my reset signal, connect the two inputs to power and ground, and the output to the slave device's VCC, upstream of the decoupling cap(s).
However, one reservation I have about this idea is whether something like a 74LVC1G157 will be able to handle this. The output of the mux will essentially be sourcing the power. In my scenario, the I2C slave device consumes at most 40mA, and it's decoupled with 2.3uF (2.2+0.1). In theory, I can see from datasheets that a '157 is generally rated for 50mA maximum output source/sink, but I'm not sure if it's a good idea to get too near that limit. Especially as, for example the Nexperia datasheet headline is for "±24 mA output drive (VCC = 3.0V)".
Also concerning is the in/out-rush current from charging/discharging the cap(s) when switching. I'm thinking a series current-liming resistor of a couple of ohms is probably a good idea, no?