CLK Pin ERC Control

Hello,

I have a suggestion regarding the possible errors that can be checked in ERC for the connection of an MCU/CPU with an oscillator or crystal oscillator.

Step 1: Configure the Electrical Type of the MCU/CPU’s CLK pin in the symbol library as an “Oscillator Pin CLK / CLK Pin Output,” and similarly, configure the electrical type of the oscillator or crystal oscillator pin to be connected to the MCU/CPU as “CLK Pin Input / CLK Pin Output.” If configured as CLK, a frequency range for that pin can be entered. A symbol can be created this way.


image

Step 2: In the schematic, the MCU/CPU is connected to the crystal component at these pins.

Step 3: With ERC, it can be tested whether the MCU/CPU CLK pins are properly connected to the crystal pins as CLK.

Now, you might ask, “What makes this different from other ERC rules?” Well, it allows checking whether the correct frequency crystal is connected between the MCU/CPU. For example, if an MCU is configured to be connected with a crystal between 16 MHz and 25 MHz, it can help prevent errors if a crystal outside this frequency range is connected.

If you ask how important this is, you can find someone as careless as me, who once connected a 32.768 KHz RTC crystal instead of a 32 MHz crystal. :slight_smile:

ERC is a pretty simple tool to check wiring.
Adding this kind of detailed testing would overload it completely. Where would it end? Current through power pins checking?
Write a script, or a plugin if you need it.

If you’d start going on that path, then you can implement hundreds of small rules, which after a time get ever more complicated, until you finally end up with a full blown simulator such as ngSpice.

And for this crystal thing, Does it really matter whether you type the frequency for it in some rule, or in the value of the crystal itself?

One thing that does help is to make a checklist, and go through the checklist before you finalize Gerbers and order PCB’s. You can make it course (verify symbol to footprint pin mapping, run ERC & DRC) to fine (make sure my uC has the right crystal and crystal capacitors).