Two n-channel MOSFETS as high-side switch? - Page 1
Forum section: electronics / projects

author: grandaspanna
author_rank: Contributor
timestamp: September 12, 2022, 11:22:36 pm
content: I've built a USB type-C board and using an AP33771 PD sink controller chip. I've largely taken their "typical" design that features two n-channel mosfets in back-to-back arrangement:" alt="" class="bbc_img" />I'm measuring close to 20V on the input, which is what I'd expect with the config I've setup, but nothing on the output. There's close to 5V at the gates of each MOSFET. BTW, they are DMN3016 ones.Whilst I work out if I've got a dud part or bad soldering, I actually don't understand how this arrangement is supposed to work. Since the gate will only be driven to 5V, how does it stay switched on?I always thought that you couldn't use n-channel types in high-side configurations?Maybe there's a different type of MOSFET I'm supposed to be using? Or, have they left some details out of their example implementation?

author: tinfever
author_rank: Regular Contributor
timestamp: September 12, 2022, 11:55:36 pm
content: They might be using back-to-back N-channel MOSFETs to block current in both directions? Otherwise, I can't imagine that two NFETs would be cheaper than a single PFET for equivalent performance.But you're right that I think they'd need to bring the gate above the VBUS in order to turn on Q1, and Q2 would have the body diode conducting unless you brought the gate of that above VBUS too. Something is weird here. I wonder if they named is PWR_EN because they are expecting you to use an external driver IC with a charge pump and then just give that the enable signal? But then why would they show that part in their design?I wonder if they have a dev board example with schematic available?Edit: They do have an eval board with schematic published. It looks...normal?https://www.diodes.com/assets/Evaluation-Boards/AP33771-EVB-User-Guide-Rev-1.1.pdfYeah now I'm confused too. I just simulated it with some random NFETs in LTSpice and as expected, the output voltage limits itself to the threshold voltage of the FETs below the gate voltage. If the gate voltage is 5V, and the MOSFET threshold voltage is 2V, then the output under any load will be limited to 3V. Unless the IC has a charge pump inside they aren't telling anyone about, I have no idea how this works. I'm not an expert though so make of that what you will. I'm curious to hear others chime in.Even if it had a charge pump inside, I think those usually have a connection to the shared FET source so they can pump the gate voltage up above the source directly, rather than referencing ground.When they say "NMOS switch" could they possibly mean a load switch IC? That'd be weird too.

author: grandaspanna
author_rank: Contributor
timestamp: September 13, 2022, 12:13:01 am
content: I've gone back over my schematic and I may have made a goof. TBH - the datasheet for the sink controller is relatively scant, but the PWR_EN pin is tagged as "AHV", which implies, but can't see it said explicitly, that it can go over the Vcc domain (5V). It will need to do that to turn on those 'fets!What I think I've done is clamp that signal by trying to monitor it with a microcontroller and forgetting that it's meant to go over (way over in this case) the 5V range.My bad. Will cut some traces tonight and see what happens.Thanks for entertaining my poor judgement :-)

author: julian1
author_rank: Frequent Contributor
timestamp: September 13, 2022, 12:31:22 am
content: Datasheet says, "Supports driver for N-MOS VBUS power switch" which suggests varying voltage. Maybe a builtin PV optocoupler?

author: tinfever
author_rank: Regular Contributor
timestamp: September 13, 2022, 12:35:59 am
content: Quote from: grandaspanna on September 13, 2022, 12:13:01 amI just added an edit to my post with more questions and no answers hahaPlease follow up if it works once you cut that trace! I'm really curious how this thing actually works.

author: grandaspanna
author_rank: Contributor
timestamp: September 13, 2022, 01:01:11 am
content: Yay - it works! I just cut the trace to the microcontroller pin and it now works.Getting a nice 20V at the output section. The PWR_EN pin is outputting 21.7V. So, the uC was simply clamping the signal. I may have fried it - time will tell.My first jump into USB PD and it's working. Very satisfying.

author: tinfever
author_rank: Regular Contributor
timestamp: September 13, 2022, 01:15:35 am
content: Quote from: grandaspanna on September 13, 2022, 01:01:11 amAwesome! I wonder if there actually is a charge pump inside? Or maybe they are just pulling the gate up to the input voltage and then accepting that there will always be a few volts dropped across the FETs? If the output voltage is 20V, what is the input voltage, out of curiosity?I think I saw them mention that the IC can compensate for voltage lost over the USB cable. I wonder if they are using the USB PPS to request a somewhat higher voltage and then doing some sort of regulation using the MOSFETs so the output voltage is nice?

author: grandaspanna
author_rank: Contributor
timestamp: September 13, 2022, 01:35:30 am
content: I don't understand the full details of PD implementation, but the most it should be able to get is 20V. I'm measuring 20V at the onboard USB connector.Must be some magic elves inside that add in another 1.7V.

author: grandaspanna
author_rank: Contributor
timestamp: September 13, 2022, 01:39:12 am
content: TBH - I think that the datasheet is not as thorough as I'd like, but the device now seems to work as intended. The only reason I picked this device was that it was the first sink controller I could find that was actually available anywhere.Here's a photo of the business end. No rework celebrations :-)" alt="" class="bbc_img" />

author: nigelwright7557
author_rank: Frequent Contributor
timestamp: September 13, 2022, 01:55:13 am
content: The join of the two mosfets needs to be the referenced to zero volts from the micro.I use a similar circuit for a speaker protector circuit and it works great.The problem is you need two power supplies, one for mosfet circuit and other for micro.I used a dual secondary transformer for my circuit and power micro and mosfets separately.

author: grandaspanna
author_rank: Contributor
timestamp: September 13, 2022, 02:11:03 am
content: The micro is powered by the sink controller - it's got 5V and 3.3V outputs specifically for this purpose. I think I can monitor the PWR_EN signal with a Schottky diode (I often use a BAS70H,115 for similar purposes). Just use a pullup pin on the micro and it seems to work pretty well. When the voltage goes to ground, so does the micro pin (less forward voltage). When it goes up, the diode stops the micro pin from going above Vcc.Actually, I've got that arrangement on four other pins to check that the external devices are plugged in. I have low-side mosfets to switch them, so can peek at the top side of those fets and see if 20V is there.I will have to wait till a bit later, but fingers crossed I haven't fried the micro and can start to test all that.

author: ejeffrey
author_rank: Super Contributor
timestamp: September 13, 2022, 04:48:03 am
content: I believe the back to back FETs are used to prevent current flow in both directions. It's been a while since I looked at this, but I think the issue is that USB type-C specifies a maximum line capacitance or inrush energy during hot plugging. Power supplies and devices often need more capacitance than the limit -- if so they are supposed to disconnect the excess capacitance from the line with a FET until after the connection is made. Since power can come from either direction in USB type-C it needs to be a bidirectional switch.

author: Terry Bites
author_rank: Super Contributor
timestamp: September 13, 2022, 10:59:47 am
content: Yes it is the blocking function of the back to back body diodes that matter here. The maximum bus voltage is limited by the internal charge pump drive voltage.

author: tinfever
author_rank: Regular Contributor
timestamp: September 13, 2022, 07:35:39 pm
content: I looked at the docs a little more and I think there must be a charge pump inside the IC that isn't documented. Otherwise there would be no way to get 20V out on VBUS with 20V input from the power supply/charger. The IC supports both PPS and non-PPS operation so my theory of them using PPS (programmable power supply) functionality to request a higher voltage to compensate for the FET threshold drop wouldn't work.Perhaps the charge pump is what they are referring to with the "OSC" block in the functional block diagram? Or that could just be the oscillator for whatever microcontroller they've hidden inside.