Floating source on P-Channel - Page 1
Forum section: electronics / beginners

author: advark
author_rank: Contributor
timestamp: July 17, 2019, 02:14:29 am
content: Hi guys,A quick simple question (hopefully) here. I need to drive 8 7-segment displays using a PIC. Obviously, I'm going with a multiplexing approach using a P-Channel MosFET on the common anode of each display and a N-Channel MosFET to drive each segments. I have not yet calculated the refresh rate but it will probably be pretty fast since it's all the PIC is gonna do along with another half dozen of status LEDs (probably gonna need to put a delay between each refresh).Now the question is: Since the P-Channel MosFET is driving the common anode, which drives the LED segments, which in turn "feed" each N-Channel MosFET, what's happening when I turn off the P-Channel? My understanding is that its source pin is now floating. Is it best have a pull-down resistor on anode (or the source pin) or I could just leave it floating (that I will need an explanation). Because the "refresh" rate may be quite high, I'm afraid it may cause ringing. Is it possible to cause ringing in this situation? I'm a bit paranoid with floating pins so I included a pull-down anyway but I'm very curious nature.The more I think about what can happen at the source pin, the more confused I seem to get... (professional enlightenment needed)Thanks

author: DannyTheGhost
author_rank: Contributor
timestamp: July 17, 2019, 04:37:51 am
content: I see you have good understanding how N-channel MOSFETs work, but let me clarify something - on schematics, P-ch and N-ch only differs with where the arrow inside is pointed. So, what you have here is that your source is actually connected to supply rail all the time (through your potentiometer, of course), and you can get rid of that 'pull-down' resistorsEdit: your schematics indicate that you have 5v power source, so it will be no worries of putting pull-up resistors on P-ch gates, and pull-down on N-ch gates. It will get rid of possible accidental MOSFET on-states (without it, if you power down your MCU you can easily open your MOSFETs just by waving your hand right above them)

author: edavid
author_rank: Super Contributor
timestamp: July 17, 2019, 04:49:53 am
content: The P MOSFETs need to have their sources connected to the +5V supply, and drains connected to the display anodes.It doesn't matter if the drains (not sources) float. You don't need the pulldown resistors.You probably don't need the gate resistors either, with small MOSFETs.Your brightness control pot won't work. It's easiest to use PWM to control brightness. Since your average segment current is only 3mA, the displays won't be all that bright anyway.

author: rs20
author_rank: Super Contributor
timestamp: July 17, 2019, 06:09:53 am
content: #1: To answer your question, yes, the drain of the MOSFET becomes floating/open-circuit (except for the body diode clamping to the supply). But since the LEDs aren't inductive loads, who cares? A floating node cannot provide current, current is required for the LEDs to light, ergo, making the node be floating will certainly turn the LEDs off. Instantly. The 10k resistors to ground just waste power.#2: The brightness adjustment pot is a really dodgy idea, as depending on how many segments are on in your current row (which could be anywhere from 0 to, the amount of current flowing through the pot will vary by a factor of 8. This means the drop across in varies by a factor of 8 as well. In summary, any significant resistance on that pot will have a minimal impact on the brightness of a single segment, but a severe impact on the brightness of an all-on display. It would be much preferable to just modify the duty cycle on the driving waveform instead, or have global blanking.#3: The right-hand half of your diagram is horribly upside-down. The supply should always be at the top, ground at the bottom, and data flowing left to right. You've got all of those things backwards, which makes it very hard to read. P-type MOSFETs should always have their source terminals at the top. Put another way, those body diodes inside the MOSFETs should always be pointing upwards (as, generally speaking, they should never be carrying current except for weird spikes etc).

author: advark
author_rank: Contributor
timestamp: July 17, 2019, 11:11:48 pm
content: Thank you all for the insight.I should've mention it but the all gates do have their pull-down/up resistors. They're on another sheet: 10K pull-ups for the P-Channels and 10K pull-down for the N-Channels. I chose 10K because, well, I have plenty of them...The PWM will worth investigating to replace the 1K pot (which value was randomly chosen, for concept purposes). I understand its concept but never implemented it. That'll be for the next lesson...Again, thank you all for the help.

author: edavid
author_rank: Super Contributor
timestamp: July 18, 2019, 12:55:37 am
content: Quote from: advark on July 17, 2019, 11:11:48 pmWhy do you think that you need them?

author: advark
author_rank: Contributor
timestamp: July 18, 2019, 01:37:29 am
content: Quote from: edavid on July 18, 2019, 12:55:37 amThe main reason is to make sure they're turned off at power up. Would that be overkill? To be honest, there are still a few things I don't fully understand when it comes to MosFET (gate charges, capacitance, etc). The few little projects I've done, used BJTs exclusively and wanted this project to use exclusively MosFETs.

author: rs20
author_rank: Super Contributor
timestamp: July 18, 2019, 04:10:47 am
content: Quote from: advark on July 18, 2019, 01:37:29 amSome would argue that the Vgs of the capacitor will be zero before the power is turned on, and since the capacitance between G and S is at least somewhat higher than that between G and D, Vgs will reach less than 1/2 of Vd when the whole device is turned on, so the MOSFET won't really be able to turn on (let alone provide the Miller charge required to really turn it on). I feel uneasy about relying on this sort of logic though.The other question to ask, though, is what are the consequences of the worst-case scenario: all the MOSFETs being fully on for a split second. What would happen? Seems to me that the various current limiting resistors your already have in place would prevent anything damaging from happening.So if you want to be absolutely sure that the LEDs don't flicker a bit when the device turns on, add those gate-to-source resistors on all the N fets or all the P fets (there's absolutely no point in doingbothbtw.) But, I'd be tempted to just leave them all out since having the display maybe maybe slightly flicker on powerup seems fine.

author: Peabody
author_rank: Super Contributor
timestamp: July 18, 2019, 11:58:11 pm
content: You may be using all these mosfets for a reason, but it seems you could do away with the segment driver mosfets altogether, and connect the segment lines to the PIC GPIO pins through resistors. While a segment driver is connected to the same segment on all eight digits, only one of the eight will be lit up at a time. A PIC GPIO should be able to drive one segment with no problem, but there might be an issue with the total current through the PIC when all eight segments are turned on on a particular digit. It depends on how much current you need for adequate brightness.

author: rs20
author_rank: Super Contributor
timestamp: July 19, 2019, 02:02:59 am
content: Quote from: Peabody on July 18, 2019, 11:58:11 pmThis is a good point. You can probably do away with all the P fets, although I'd expect you'd want to keep the N fets at the bottom as they have to drive 8 segments simultaneously. But maybe you can get rid of all of it. (Don't forget that each segment is only on for 1/8 of time, so its peak brightness needs to be relatively high.)

author: Peabody
author_rank: Super Contributor
timestamp: July 19, 2019, 02:26:48 pm
content: Quote from: edavid on July 19, 2019, 04:31:29 amIf he really needs 25mA segment current, then the total current would probably be too much. But I would be very surprised if he actually needs anywhere near that. In any case, it would certainly be worth testing with maybe 680R resistors, or even 1K to see if they are bright enough at 1/8 duty cycle. Red also might be more efficient than green, but I'm not sure about that.I did a video on multiplexing by segment, which turns the segments on one at a time, with a refresh period of 2ms, and a 1/7 duty cycle, and I was able to use 2.2K resistors with 5V supply. But I used very high efficiency Vishay individual red digits which specify their mcd ratings at 1mA. I've never seen multi-digit modules with similar efficiencies. But even so, the OP's modules are rated at 25mA absolute maximum constant current per segment, with mcd output specified at 10mA, and my guess is that something closer to 10mA would work fine, perhaps even less, and then you would be within range on total current.And if anyone knows of very high efficiency 2- and 4-digit modules, please post part numbers or links.

author: advark
author_rank: Contributor
timestamp: July 19, 2019, 10:05:04 pm
content: Quote from: Peabody on July 18, 2019, 11:58:11 pmThat is definitely worth trying! I'm using a PIC16F1518. According to the datasheet, the maximum rating for Vss is 350mA and 50mA for the I/O pins. So even if I put 25mA on each segment, which I doubt because it's basically all what the PIC is doing, will put 200mA on Vss. Just need to keep P-Mosfet to feed the anodes since the anodes are driven from a 74138. I'll dig down the PIC datasheet for the consumption of other peripherals (Clock, SPI and 7 status LEDs at 10-15mA) to be sure but that should be enough.

author: Peabody
author_rank: Super Contributor
timestamp: July 19, 2019, 11:09:54 pm
content: The efficiency of the displays and the status LEDs can be important considerations in your design. Some displays provide a lot higher brightness per milliamp, and let you get away with using less current, but are usually more expensive. And if you will have them on all the time, the status LED shouldn't need that much current. You'll just have to experiment with different resistors to see what works.