Circuit for resetting an I2C device - Page 1
Forum section: electronics / projects

author: HwAoRrDk
author_rank: Super Contributor
timestamp: March 04, 2024, 04:43:48 pm
content: 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?

author: Peabody
author_rank: Super Contributor
timestamp: March 04, 2024, 06:43:05 pm
content: How about an ADG849?https://www.analog.com/media/en/technical-documentation/data-sheets/ADG849.pdf

author: selcuk
author_rank: Frequent Contributor
timestamp: March 04, 2024, 07:56:16 pm
content: Do you send 18 bits of clock to the slave and check the SDA line before deciding to turn off its power?

author: HwAoRrDk
author_rank: Super Contributor
timestamp: March 04, 2024, 08:30:23 pm
content: Quote from: Peabody on March 04, 2024, 06:43:05 pmOof, not for the prices they're asking.Quote from: selcuk on March 04, 2024, 07:56:16 pmYeah, I'll be doing that too. But the power switching is the belt-and-braces measure.

author: HwAoRrDk
author_rank: Super Contributor
timestamp: March 04, 2024, 08:43:38 pm
content: I've just had a epiphany. I'm working with 5V, need to switch a non-trivial current, the output should be off when control logic is low (active-low reset), and I need the output to discharge when turned off... Wait, I've used a chip that does all this before!USB load switch ICs to the rescue! They handle 0.5A or more, many are available with an output discharge feature, and the enable pin suits the polarity of my control logic. And, most importantly, they cost about the same as a 74-series mux (i.e. pennies).They also satisfy the other question mark I had with the mux, and that was suitability of control by 3.3V logic levels (my I2C slave device only runs on 5V, but everything else on the board is 3.3V). The mux datasheets typically specified VIH as being 0.7*VCC - and with VCC of 5V, that's 3.5V. So it's questionable whether I could interface with 3.3V.All the USB load switches I've seen have VIH on EN of around 1.5V, which is much more suitable.