Newbie stuck with 3.3V ERC related to power

Note: In my original post I said I was having DRC issues when I should have said ERC - the issues I’m having and the context of this thread is related to ERC rules, not ERC - the rules are during the schematic creation, not during the PCB layout.

This is my first time using KiCad and the only other PCB design experience I have is from a very simple PCB in Eagle many years ago.

I have a USB-C port that provides 5V, ground, and a voltage regulator that outputs 3.3V to the rest of my circuit. I before I added the regulator and just had 5V and GND I had issues with the DRC ERC rules complaining about power without a source or something along those lines, so I of course googled and found that I needed to add a PWR_FLAG to these, as I understand it to tell KiCad DRC ERC checker that “trust me, this power is coming from somewhere else”

When I added the 3.3V regulator, I added a 3.3V power symbol to the output, and this time (as you can see in one of the screenshots below) the DRC ERC rules complained about this. So I added a PWR_FLAG to this as well (even though it doesn’t make sense much sense to me), but this time different error (again, see screenshots below).

I am sure I’m doing something incredibly stupid but am not sure what.

I have googled and read this post for example: ERC error: Input power pin not driven by output power pins - #12 by jmk (which originally lead me to the PWR_FLAG I think to be honest) but again this doesn’t explain to me why I am having this issue with the 3.3V regardless of what I do with the PWR_FLAG. And again, in my head it doesn’t really make sense that I’d have to tell KiCad power is coming from somewhere because there is power (5V) going in. I’m sure it’s not that simple / obvious to KiCad.

Thanks very much for any help with this!

p.s. All the youtube video tutorials I’ve watched of people making this with KiCad, I feel like I never see anybody having to add PWR_FLAGs… am I doing something more fundamentally wrong?

edit: apparently I can’t upload more images as a new user, so here are links to Imgur with the errors:

https://imgur.com/a/eJMz23I

Many KiCad users make little use of ERC . . . DRC YES !! but not so much ERC

Not every power source pin requires a PWR_FLAG. Some exceptions are regulators, batteries, and some USB connectors whose pins are already of type Power Output.

So the simplistic advice just add a PWR_FLAG to the net is not always appropriate. You should understand what the ERC (not DRC, that’s for layout) rule is checking. It’s: every net with a Power Input pin on it should have exactly one Power Output pin on it too.

ERC - sorry :frowning:

So hopefully you’ll allow a dumb / simplistic explanation back of what I think I understand you’re saying:

In my circuit I originally added a +5V “Power Symbol” to a net. This tells KiCad / the ERC rules checker “this is a +5V output pin” - but, presumably because the USB device I added does not have “VBUS” marked as a “power input pin”, the ERC checker complained that there was an Output without and Input (or maybe the other way around). By adding the PWR_FLAG to the net, I’m essentially “balancing” this out, telling ERC “hey I said this is a +5V supply, but that is coming from somewhere else”

Same basic thing happened with the GND.

Assuming this is correct, I still don’t understand what is happening with my +3.3V power symbol. On the regulator, the output pin is labeled “OUT” - maybe this is is what you mean when you say that sometimes “pins are already of type Power Output”, but I don’t know how to check.

Maybe my issue is that I shouldn’t be using the +3.3V Power Symbol at all here, and I should instead just use a “label” and label it 3.3V or whatever. To be honest I don’t really have a good feel for when a label means something to the ERC. I used the +3.3V power symbol because I wanted to represent that fact that for the rest of the circuit this is where the 3.3V is coming from, but again maybe I shouldn’t because the OUTis already saying that.

Pins of type Power output and Output are connected

To put it another way… I’m trying to process this but am still not certain about the correct way forward with the +3.3V in my circuit.

Sorry for being dense and thanks for your time / help!

Have a look at ‘U1’ by highlighting it and selecting ‘Edit’ and see what the pin is assigned as. You could then set it too ‘Passive’ or keep as is and remove the power flag from the 3v3. Your problem lies here somewhere :woozy_face:
:mouse:

Thread title corrected to help future search results, this is ERC, not DRC.

1 Like

You should have posted the message that ERC generated in addition to the markers. It would have told you what ERC discovered.

Here’s the documentation for pin electrical types:

Here’s a schematic where no PWR_FLAG is needed on the output of the LDO regulator because the pin type of pin 2 (VO) is Power Output. If you were to put a PWR_FLAG on this net, ERC would say there are two Power Output pins on the net and that would be a clash. To see the pin type select the pin and the type will be displayed on the bottom properties panel, as you can see.

In fact pin 1 of the USB connecter is also of type Power Output so no PWR_FLAG is needed there too.

Thanks again for your time and the info.

In my case the OUT pin on my LDO regulator is Output - note it is NOT Power Output

On my USB-C connector VBUS is of type Power input, and the GND is also marked as Power input

So I’m not entirely certain what the right thing to do is here. Maybe this pin should be marked as Power Output? Maybe I should ignore this? Just to be clear the ERC fails with or without the PWR_FLAG.

Thanks again!

Problems with the PWR_FLAG symbol are very common. If you don’t see it much in video’s, then this part is probably simply skipped.

I do not know the source of your LD39200 symbol, but it is common that the output of voltage regulators is set to be a power output.

For the rest, I do not like your method of putting the PWR_FLAG symbols tugged away in some corner:
image

My own preference is to put them near the location that is the actual power output, such as for example a connector. This gives the symbol more meaning, as it indicates where power is coming from.

On a sidenote, davidrsb already changed the title to make the ERC / DRC less confusing, but you are still using DRC a few times in your first post. You can click on the pencil icon to edit your post and fix that.

Yes, indeed. Post the actual error messages if you still have them.

I have never run ERC (fortunately running it is not mandatory).
ERC is a simple circuit checker. You have to have all the time in your head that ERC doesn’t understand electronic. It only checks some rules. For power connection rules probably are:

  • if there is (one or more) power input at net than one power output has to be connected to that net,
  • two or more power outputs at net is an error.

From this it follows that all GND and power symbols (like VCC, +5V and so on) have to be power inputs. All GND pins at schematic are connected together so they can’t be power outputs (the same with VCC, and…).
Imagine you have USB socket GND pin set as power output and then you used many such sockets in your USB hub schematic.

This is wrong. It should either be Power Output and you don’t need a PWR_FLAG, or it should be Passive, and you add a PWR_FLAG.

Did you get it off one of those Internet sites?

1 Like

On a sidenote, davidrsb already changed the title to make the ERC / DRC less confusing, but you are still using DRC a few times in your first post. You can click on the pencil icon to edit your post and fix that.

Thanks for the reminder - I edited my original post and explained my original mistake so hopefully others in the future who read this would understand my mistake. I appreciate this is a resource for others in the future in my same shoes so hopefully my correction / explanation of my original confusion there will be sufficient.

On a sidenote, davidrsb already changed the title to make the ERC / DRC less confusing, but you are still using DRC a few times in your first post. You can click on the pencil icon to edit your post and fix that.

Honestly I really really value this - thank you. I don’t have any idea what reasonable is, I just figure splitting things up like I did maybe made things more readable, but now as I’m understanding these rule checks a bit better I 100% see how it makes sense to label the PWR_FLAG at the location where the power is actually coming in. Realistically I’m guessing anybody looking at my very simple circuit would understand “there is a USB plug, that’s where power comes in”, but of course I’m doing this exercise in the first place to learn. I’ll put the PWR_FLAG(s) “inline” (if that’s a term that makes sense here). Thanks again!

Yes, indeed. Post the actual error messages if you still have them.

Sorry, I did try to and I sort of / kinda actually did in the form of these images - as a new user the forum didn’t allow me to post multiple photos but I did post a link screenshots that showed both errors for both configurations (the +3.3V with and without a PWR_FLAG)… that said maybe I’ve posted enough now the forum will let me get away with this now (posting one of the photos photo again here - apparently as a new user I can only post one photo at a time):

An error occurred: Sorry, new users can only put one embedded media item in a post.

Here the errors are as text though:

In the cast I add a PWR_FLAG to the +3.3V:

Error: Pins of type Power output and Output are connected

In the case that I do NOT add the PWR_FLAG to +3.3V:

Error: Input Power pin not driven by any Output Power pins

In the end, I think I am understanding the problem now, and have (I think?) severely over complicated it in my head. The issue seems to be that the OUT pin on my LDO should be Power Output. Or at least this wouldn’t be an issue if that were so.

Now the correct solution I’m unsure of - I’m guessing either ignoring the ERC rule (which slightly bugs me but I can probably live with it), OR update the LDO “device” schematic to make the pin Power Output or passive. (this is what @retiredfeline has basically said above as well I believe).

Thanks again for your time!

Thanks for the reply once again!

I just posted something similar, but this makes a lot of sense to me now. I was over complicating things in my head. I understand why “Power input” requires a PWR_FLAG, and I understand why if the OUT pin was of type Power output I would not be having an issue.

Did you get it off one of those Internet sites?

I actually don’t remember - it’s likely that I did, but it was some time ago so I don’t remember the exact origin to be honest.

Anyway this leaves me with a final question: I realize practically I could probably ignore this error, but given my current situation how would you recommend I proceed? My instinct, based on your line of questioning, is that I should update the LDO OUT pin to be of type Power output and call it a day?

Thanks again for your time.

Yes do the first. As for the second it depends on what else you need to get done in your day. I’ve often called it a day just after midnight. :rofl:

One more thing, if you update the symbol in the schematic it will only apply to that schematic. To make it apply to all future uses of the symbol you should edit it in your personal library (I’m assuming it’s not a KiCad standard symbol, or that pin type would be a bug which should be reported), then update the schematic symbol from the library.

Yes, that is the normal and logical fix.

You have not shown the complete ERC message, but a power input pin always complains if there is no power output pin on the same net. That is the sole purpose of the power input and power output pin types.

And as retiredfeline already meantioned:

Thanks again for your help - I’ll do as you suggest.

As for the second it depends on what else you need to get done in your day. I’ve often called it a day just after midnight. :rofl:

I’m in Japan so my day is just getting started. Sadly I can’t quite call it a day yet :slight_smile:

Just around midnight is usually also the time that a new day starts.

Just wanted to follow up and say that all I had to do to solve this issue in the end was change the Output pin type for my LDO to Output power (as discussed above).

After doing this, I no longer needed the PWR_FLAG and all ERC rules passed.

I did still need the PWR_FLAG for GND and +5V but this now makes sense to me - those are labeled as Power input, so I needed to explain to the rule checker that there would be power supplied externally to those pins.

Thanks again all!

1 Like

You need not to post anything. Read FAQ:

I take a very relaxed view with DRC / ERC: if I get an error, and I am “happy” with that error, I just accept it as “advice”, then just ignore what the computer says… as in THIS case I actually DO know better than the computer!

It’s exactly what I would do if a junior designer made a comment…