Design verification with Electrical Rules Check

Introduction

The Electrical Rules Check (ERC) tool performs an automatic check of your schematic. The ERC checks for any errors in your sheet, such as unconnected pins, unconnected hierarchical symbols, shorted outputs, etc. Naturally, an automatic check is not infallible, and the software that makes it possible to detect all design errors is not yet 100% complete. Such a check is very useful, because it allows you to detect many oversights and small errors.

In fact all detected errors must be checked and then corrected before proceeding as normal. The quality of the ERC is directly related to the care taken in declaring electrical pin properties during symbol library creation. ERC output is reported as errors'' or warnings’’.

ERC dialog

How to use ERC

ERC can be started by clicking on the icon ERC icon.

Warnings are placed on the schematic elements raising an ERC error (pins or labels).

  • In this dialog window, when clicking on an error message you can jump to the corresponding marker in the schematic.

  • In the schematic right-click on a marker to access the corresponding diagnostic message.

You can also delete error markers from the dialog.

Example of ERC

ERC pointers

Here you can see four errors:

  • Two outputs have been erroneously connected together (red arrow).

  • Two inputs have been left unconnected (green arrow).

  • There is an error on an invisible power port, power flag is missing (green arrow on the top).

Displaying diagnostics

By right-clicking on a marker the pop-up menu allows you to access the ERC marker diagnostic window.

ERC pointers info

and when clicking on Marker Error Info you can get a description of the error.

erc_pointers_message_png

Power pins and Power flags

It is common to have an error or a warning on power pins, even though all seems normal. See example above. This happens because, in most designs, the power is provided by connectors that are not power sources (like regulator output, which is declared as Power out).

The ERC thus won’t detect any Power out pin to control this wire and will declare them not driven by a power source.

To avoid this warning you have to place a “PWR_FLAG” on such a power port. Take a look at the following example:

eeschema_power_pins_and_flags_png

The error marker will then disappear.

Most of the time, a PWR_FLAG must be connected to GND, because regulators have outputs declared as power out, but ground pins are never power out (the normal attribute is power in), so grounds never appear connected to a power source without a power flag symbol.

Configuration

The Options panel allows you to configure connectivity rules to define electrical conditions for errors and warnings check.

eeschema_erc_options_png

Rules can be changed by clicking on the desired square of the matrix, causing it to cycle through the choices: normal, warning, error.

ERC report file

An ERC report file can be generated and saved by checking the option Write ERC report. The file extension for ERC report files is .erc. Here is an example ERC report file.

  1. ERC control (4/1/1997-14:16:4)
  2. ***** Sheet 1 (INTERFACE UNIVERSAL)
  3. ERC: Warning Pin input Unconnected @ 8.450, 2.350
  4. ERC: Warning passive Pin Unconnected @ 8.450, 1.950
  5. ERC: Warning: BiDir Pin connected to power Pin (Net 6) @ 10.100, 3.300
  6. ERC: Warning: Power Pin connected to BiDir Pin (Net 6) @ 4.950, 1.400
  7. >> Errors ERC: 4