Intro

In my last post I laid out two methods for switching between power rails. Now I evaluate them on Slave Board Rev 0.

Here is a schematic:

Evaluation of Diode-Protected Method

The first attempt sort of worked. About half of the time, to be precise. This is the code:

  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
  while (1)
  {
    HAL_GPIO_WritePin(EN_5V_GPIO_Port, EN_5V_Pin, GPIO_PIN_SET);
    HAL_Delay(100);
    HAL_GPIO_WritePin(EN_9V_GPIO_Port, EN_9V_Pin, GPIO_PIN_RESET);
    HAL_Delay(1000);
    HAL_GPIO_WritePin(EN_9V_GPIO_Port, EN_9V_Pin, GPIO_PIN_SET);
    HAL_Delay(100);
    HAL_GPIO_WritePin(EN_5V_GPIO_Port, EN_5V_Pin, GPIO_PIN_RESET);
    HAL_Delay(1000);
    /* USER CODE END WHILE */

    /* USER CODE BEGIN 3 */
  }

And the voltage on the output:

first-attempt-diode-prot

9V always turns on and off properly, but about half of the time 5V fails to activate.

The first thing that stuck out to me was how gradual the downward slope from 9V is due to the open load. Although connecting a load sharpened the slope, 5V still only activated half the time. That wasn't the problem.

Next, I probed the voltage on the output terminal of the 5V load switch, behind the protective diode D2. It tracked the voltage on the opposite side of the protective diode. I figured that was probably explained by backwards leakage through the protective diode. The things aren't perfect. Then, the hypothesis went,this backwards leakage was triggering a protective function on the load switch. Maybe the backwards leakage could be counteracted with a small pull-down? I rigged one via TP22.

pull-down-rig

Nope. The voltage on the load switch output net was is still tracking the output voltage. That didn't make any sense...

Then, aha! The diode on the 5V switch was installed backwards! And because of how the footprint is, that meant it was just acting as a short circuit. That explained that.

Lesson? I should have verified diode forward voltages with the multimeter after assembling. And not seeing the diode voltage drop between load switch output and and final output should have made me raise an eyebrow when I was doing initial board validation.

Now the mechanism was working as expected.

protective-diode-working

Hooray!

Evaluation of Capacitor-Smoothed Method

I replaced all the diodes with short circuits to begin the evaluation.

diodes-replaced

Here is my rough evaluation procedure:

  1. Run the old diode-protected test code with the period of OR during switching rather than period of no power (that is, SET-RESET order, see previous post explaining the two methods).
  2. Observe overpowering of 5V rail during switching
  3. Run switching test code with period of no power (RESET-SET order)
  4. Observe period of no power during switching
  5. Minimize the no-power period in software
  6. Smooth the no-power period with a capacitor

I hit a stumbling block at step 1. The 5V switch was not turning on half the time after receiving the enable signal. And now even when it did, there was a delay. Just to be sure, I co-plotted 5V_EN signal on the oscilloscope with output voltage and the issue is very apparent:

cap-smoothing-broken-5ven-signal

Again, my hypothesis was that some sort of safety feature was being triggered and preventing the load switch from turning on right away. So I looked at how to read the status pin and saw that I was missing a pull-up on the status pin. I rigged one like this, connecting ST to 3.3V via a THT resistor:

cap-smoothing-st-pull-up

Then... the load switch began working 100% of the time. There was no more failure by the 5V switch to turn on (status pin is on CH1, looks like it's normally low and released high during error):

cap-smoothing-working-no-cap

Hooray! On to step 2, observing overpower applied to 5V rail:

cap-smoothing-overvoltage

Oh dear... CH1 is the 5V power rail and CH0 is 5V_EN. I expected a brief spike on 5V rail during switching which quickly returned to 5V. But it was basically tracking VOUT. I thought perhaps a capacitor internal to the power rail was being charged and for that reason the voltage stayed at 9V after switching. But again, the pulldown did nothing. The voltage on the 5V rail stubbornly remained at 9V so long as 9V was enabled.

It turns out that the load switch I was using does not block current in the reverse direction. When a reverse bias is applied across VBB-OUT on the switch, it behaves like a forward-biased diode. The voltage on VAR_V for example tracks VOUT minus 0.5V. What happens is since the source of the N-MOSFET inside IC is shorted to the body, when a forward bias is applied from source to drain, the P-N junction between body and drain is forward biased, and current flows.

Oh, dear. This means that there is no point in doing the further steps. The Capacitor-Smoothed Method is infeasible with the BV1HD045EFJ-C.

Conclusion

The Diode-Protected Method is the only feasible methods of the two, so it is with this method I will proceed.

Future Work

I found this AN on reverse current protection in load switches from TI which explains the problem I encountered with the Capacitor-Smoothed Method and also describes its solutions. Happily, my Diode-Protected Method corresponds to the Diodes solution described in §3.1. TI's load switches solve the problem too, described in §3.3, but none of them support 20V @ 10A. The last solution with back-to-back N-MOSFETs in §3.2 could work too, and it'd actually give me better efficiency---I'd avoid the voltage drop over the Schottky diode.

The TI way to do the §3.2 solution I believe would be with what they call "Ideal Diode Controllers", particularly the ones with RCP (reverse current protection). The above AN explains RCP vs RPP (Reverse Polarity Protection). RPP sounds prima facie like what I need, but actually it refers to when VIN goes negative relative to ground, rather than relative to VOUT.

The chart is here, but the back-to-back ideal diode controllers on offer actually seem a little overkill. LM7472x-Q1 line has integrated boost converter, requiring an external inductor, is definitely little overkill. The LM748x-Q1 line is a bit simpler.

Although, really what would be best is to simply add another rail for N-MOSFET driving. Then I could generate a high enough voltage on the master board and use an opamp to drive back-to-back NMOS switch. Or a gate driver, which is the same idea.

I really like the idea of a MOSFET-driving rail. Rather than my per-rail per-module cost being $1.30 for BV1HD045EFJ-CE2 + $0.35 for STPS10H60SF = $1.65, it could be $0.44 for STL36DN6F7 + $0.69 for UCC23313 = $1.13. Or if I use an opamp rather than a full-on gate driver, it could get even cheaper, e.g. LM2904BIDR @ $0.17.

Quiescent current could be an issue here, as with 20 modules and 8 rails, you're drawing 160 times the quiescent current. The example gate driver draws 1.2 mA and opamp draws 300 uA, so the opamp seems better. The MAX9938FEUK draws only 1.1uA, but it's $2.09.

The opamps often come in packages which include more than one opamp. So I could save board space and assembly hassle that way.

Another option is using a typical level-shifting circuit with an NMOSFET and a couple pull-ups. I think to get any sort of halfway-decent switching time though, you'd need strong pull-ups that quiescent current would be way too high.

It seems there are some complications to making a bidirectional load switch related to the fact that the net connecting the two FETs is technically floating and the matter of whether you connect the sources or drains.

But that's a problem for another day.

For now, I have a working power multiplexer for which I can begin to write firmware. If I go to this other switching scheme, it won't change much in firmware. Just I'll have to do the SET and RESET in the same instruction and place capacitors on input and output.


Please send comments to blogger-jack@pearson.onl.