EEVblog Electronics Community Forum

Electronics => Projects, Designs, and Technical Stuff => Topic started by: DrOnline on January 05, 2021, 06:26:22 am

Title: Comments on first KiCAD design - power input circuit for MCU
Post by: DrOnline on January 05, 2021, 06:26:22 am
Hi, I'm new to this forum, and while I did study electronics, I ended up working with software mostly, so I really haven't designed circuits since school.

In order to refresh my knowledge, I'm working on a simple project to make a board, which uses a Nordic nrf52832 chip, and then I will add sensors and some way to program the chip etc etc. I really haven't decided 100%.

What I HAVE decided, is I want to power it by USB, but also have uninterrupted battery backup. Those USB signals I will pass to an FT232 circuit to convert it to UART for the MCU.

Anyway, so I designed this, mostly using the examples provided in the datasheets of the components:

[attachimg=1]

I have multiple questions, hoping for some advice.
Title: Re: Comments on first KiCAD design - power input circuit for MCU
Post by: thinkfat on January 05, 2021, 10:55:46 pm
Hi, I'm new to this forum, and while I did study electronics, I ended up working with software mostly, so I really haven't designed circuits since school.

In order to refresh my knowledge, I'm working on a simple project to make a board, which uses a Nordic nrf52832 chip, and then I will add sensors and some way to program the chip etc etc. I really haven't decided 100%.

What I HAVE decided, is I want to power it by USB, but also have uninterrupted battery backup. Those USB signals I will pass to an FT232 circuit to convert it to UART for the MCU.

Anyway, so I designed this, mostly using the examples provided in the datasheets of the components:

(Attachment Link)

I have multiple questions, hoping for some advice.
  • I was thinking of using a 3V coin battery, CR2477. I will need a battery clip for it. How would I make that in the circuit diagram, specifically? Is what I have done, simply make a power port, enough? What about the negative side of the battery..
  • As you see, I have not enumerated the refdes of the components. Is it normal not to do this until later, and then have the software distribute names? It seems like if I had 1000 caps, it would be a real pain to manage manually
  • Is the ground symbol correct?
  • Is the look of the schematic generally alright? Anything jump out
  • I want to use a tag connect cable to program the chip. So instead of using a female cable to connect to a male header of the board, it will be the other way, using pogo pin programming cable. How do I actually do this on the schematic? Do I make a part for it, even though it will just be pads and holes for the guiding pins? You can google tag programming cable, to see the idea.

For the battery, just use the single-cell battery symbol in the schematic and assign an appropriate footprint. There's likely a Keystone or Renata part you can use.

Let KiCad do the enumeration. It doesn't matter which designation is given, just let KiCAD handle that.

Can't say much about the esthetics of the schematic, I was able to read it, so it cannot be too bad.

Ground symbol -  :-+

For the programming header, you can use a generic connector symbol, just choose one with the same number of contacts. You'll have to create a footprint that matches your cable and assign it to the symbol. Take care of the pin numbering when you do.
Title: Re: Comments on first KiCAD design - power input circuit for MCU
Post by: bson on January 05, 2021, 11:43:36 pm
I don't know how well it will work to feed a 3V coin cell into your 3.3V LDO regulator.  I'd only use the regulator for Vbus (which should probably have a Schottky diode btw), and switch between its output and the coin cell on the output side.  Otherwise as soon as your cell gets down to 3.2-3.3V or so the regulator will drop out.

It's not clear from a quick glance in the datasheet what happens to Vout when EN=L, it just says it "shuts off" - not whether it's pulled low, or whether it goes into a high-Z state.  The block diagram suggests the latter, but I'd breadboard it and verify this behavior.  If so you can just superimpose the battery onto it with the ideal diode (LM6610) in your circuit (which isn't needed before the LDO) when Vusb isn't there.

If you add a pulldown to the LM6610 CE# you'll be able to swap the battery while powering from USB, otherwise if you remove the battery it'll float and behavior will be unpredictable.
Title: Re: Comments on first KiCAD design - power input circuit for MCU
Post by: bson on January 06, 2021, 12:02:21 am
Something like this, but with your LDO.
Title: Re: Comments on first KiCAD design - power input circuit for MCU
Post by: Peabody on January 06, 2021, 05:34:18 am
I don't know about KiCAD, so can't help you there.  But I have some comments on the circuit.

First, your mosfet is oriented backward.  The drain has to connect to the battery, and the source to the load.  I know this seems odd, but you have to orient it so the mosfet's body diode will block current from flowing from the USB 5V back into the battery.  The mosfet will conduct equally well in either direction if it's turned on.

Second, I don't see what  you accomplish with the ideal diode.  Why not a regular Schottky?

Using the Schottky, R7 would then connect the gate to ground, and the gate would also connect directly to USB 5V before the Schottky.

I agree that supplying a 3.3V linear regulator from a 3V coin cell could be an issue.  Some regulators would just pass through the input voltage if it's below 3.3V.  You would want to make sure yours does that, or as bson says, bring the battery in after the regulator.  You would then have to make sure too much current doesn't flow back through the regulator when it's unpowered.
Title: Re: Comments on first KiCAD design - power input circuit for MCU
Post by: thinkfat on January 06, 2021, 08:16:13 am
I don't know about KiCAD, so can't help you there.  But I have some comments on the circuit.

First, your mosfet is oriented backward.  The drain has to connect to the battery, and the source to the load.  I know this seems odd, but you have to orient it so the mosfet's body diode will block current from flowing from the USB 5V back into the battery.  The mosfet will conduct equally well in either direction if it's turned on.

Second, I don't see what  you accomplish with the ideal diode.  Why not a regular Schottky?

Using the Schottky, R7 would then connect the gate to ground, and the gate would also connect directly to USB 5V before the Schottky.

I agree that supplying a 3.3V linear regulator from a 3V coin cell could be an issue.  Some regulators would just pass through the input voltage if it's below 3.3V.  You would want to make sure yours does that, or as bson says, bring the battery in after the regulator.  You would then have to make sure too much current doesn't flow back through the regulator when it's unpowered.

The circuit is OK as it is. It's one of the recommended circuits from the datasheet of the LM6610. The MOSFET is p-channel. Hence the orientation source->drain is OK as well.

I'm assuming that "BAT" in the circuit is not the mentioned coin cell but a LiPo or similar battery that would supply the whole device and not just have some backup function?

Why not a regular Schottky - The LM6610 clearly has an advantage over a regular Schottky that it won't have to dissipate a lot of energy as heat, plus it contains the logic for a switch-over between USB and the main battery. Nice integrated solution. But it bears the question why using a solution that can carry much more load than the poor LDO would be able to cope with?
Title: Re: Comments on first KiCAD design - power input circuit for MCU
Post by: Karel on January 06, 2021, 08:37:40 am
There's no ESD protection on the USB connector. You could add something like a USBLC6-2SC6.

https://www.st.com/resource/en/datasheet/usblc6-2.pdf (https://www.st.com/resource/en/datasheet/usblc6-2.pdf)
Title: Re: Comments on first KiCAD design - power input circuit for MCU
Post by: DrOnline on January 06, 2021, 10:32:35 am
Thanks to everyone for your replies.

I'm at work, so I only skimmed, will read in more detail when I get home, but I want to comment on some things:

Yes, I also realized (after drawing and posting here), that I cannot feed 3V into the 3V3 LDO. Apparently it requires 3V3+1V to output 3V3... I wrongly assumed (clever, right?) that it would boost the voltage...So I have to redo that part. I've learned that instead of spending time decorating my schematic too early in the process, making things line up etc, I should have FIRST invested the effort of thinking everything through. Maybe on pen and paper.

I will add bead and fuse to the 5V power, and the TVS diodes for the data lines.

Thank you for confirming the naming is best let managed by the software, and the look of the ground symbols.

I'm using KiCAD because it is free. I'd love to use Altium, but.. well. it's very expensive. I'm eagerly waiting for KiCAD 6 which should be out early this year.

Let me make some changes and I'll update my thread. Thanks again!
Title: Re: Comments on first KiCAD design - power input circuit for MCU
Post by: Peabody on January 06, 2021, 07:27:12 pm
The circuit is OK as it is. It's one of the recommended circuits from the datasheet of the LM6610. The MOSFET is p-channel. Hence the orientation source->drain is OK as well.

I don't see such a circuit in the datasheet.  Could you refer me to a Figure number?  In any case, here's an app note which uses a Schottky instead of the ideal diode, and it very clearly shows the P-fet with the drain connected to the battery and the source to the load.  I realize that's the opposite of using a P-fet as a switch, but the body diode orientation makes it necessary to prevent the 5V rail from feeding back into the battery when the mosfet is off.

http://ww1.microchip.com/downloads/en/AppNotes/01149c.pdf (http://ww1.microchip.com/downloads/en/AppNotes/01149c.pdf)

Quote
Why not a regular Schottky - The LM6610 clearly has an advantage over a regular Schottky that it won't have to dissipate a lot of energy as heat, plus it contains the logic for a switch-over between USB and the main battery. Nice integrated solution. But it bears the question why using a solution that can carry much more load than the poor LDO would be able to cope with?

But any heat the diode doesn't dissipate will have to be dissipated by the regulator.  Surely the diode is better able to do that.  And as for switching logic, as shown in the datasheet linked above, the Schottky and P-fet combination only needs one pulldown resistor.  So the parts count is no higher.

An ideal diode is great when you need to avoid any voltage drop.  But if you're going to have that drop somewhere no matter what, then I still think the Schottky is a better source.  Instead of dropping 5V to 3.3V, the regulator will drop 4.6V to 3.3V, which dissipates less heat in the regulator.  With a switching regulator it would be different, but this is a linear regulator.

Title: Re: Comments on first KiCAD design - power input circuit for MCU
Post by: thinkfat on January 07, 2021, 10:36:41 am
The circuit is figure 20 in this document: https://www.ti.com/lit/ds/symlink/lm66100.pdf (https://www.ti.com/lit/ds/symlink/lm66100.pdf)
Btw, it's LM66100, not LM6610.

About the mosfet direction - you're correct, my bad. Regarding the power dissipation - true also. What I meant to say is that the circuit is OK in principle, but I didn't realize that there was just a coin cell behind the BAT net.
Title: Re: Comments on first KiCAD design - power input circuit for MCU
Post by: Shadowfire on January 07, 2021, 09:11:17 pm
Here's some more fuel for the fire.
Assume you disconnect the USB power - in this case I assume you want uninterrupted power flow.
The voltage on you bulk 4.7uf capacitor will discharge to feed the LDO until it drops to/below the coin cell battery voltage.
You already know about the dropout voltage requirement, but here's the other thing.
At this point (VBATT=VIN+80mV, or VIN = VBATT-80mV) the LM66100 will cut out, letting VIN float at VBATT-80mV (it will slowly drop off due to Iq.vin of the LM66100). 
This puts Vgs (Vbatt-Vin) of your Pfet at -80mV, which will not turn on your TPS1100.
Thus, the power to your LDO will simply drop out to 0V and stay there until VIN drops to some value where the Pfet can pass enough current to turn it back on.
Also, battery designs can be chock full of gotcha's, especially if you've never done one before.
Edit: Also, (it really depends on the current draw of your application, and the battery discharge curves for the coin cell you are looking at) you can generally expect with a 1mA load, that the cell will drop to 2.7V after around 2/3rd of the normal cell life.  The TPS1100 fet, @ Vgs=-2.7V, could have 850 ohms of resistance, but its passing 1mA, meaning that the actual voltage at the LDO could be as low as 1.85V.