kicad-schlib
kicad-schlib copied to clipboard
Microcontroller symbol standardization
Microcontroller symbols are to be standardized for clean use in schematics. The following rules are proposed - many of which are a departure from the current status quo.
Pay close attention to pin naming requirements. In most cases I am following the names used in each part's datasheet, but I am deviating from this in specific cases. Reasoning is given in each case. As an additional exception to all datasheet pin naming, overbar should be used for signal inversion in all cases.
- Power pins should be named as they are in the datasheet. For other parts I am still recommending using rewritten, consistent pin names for schematic clarity, but I may revisit this. The goal is to make it easy to search the datasheet/manual for information regarding a rail.
- IO pins should be named after their most generic name, for example
PA14
for port A, pin 14, following the style used in that part's datasheet. Do not include alternate functions in the pin names, with the exception of:- Oscillator pins. Naming: pins meant to drive a crystal should be suffixed with
IN
andOUT
. Datasheet names are often unclear as to which pin should be used when applying an external clock source. - Programming interface, reset, etc. This is the case even when the programming interface is a secondary function of an existing interface (e.g. ATMEGA programmed via SPI, in system programming via UART, etc).
- Interfaces likely to be a central feature of a microcontroller, including USB and Ethernet. These are usually a main reason for selecting the microcontroller and thus almost certain to be used.
- Oscillator pins. Naming: pins meant to drive a crystal should be suffixed with
- IO pins should be grouped by port and sorted by pin number. If a part has more than 40 IO pins, split them off into separate units.
- The following pin types should be moved into a separate section on the symbol, even if also serving the purpose of general IO:
- Programming interface, reset, etc, unless these are likely to be multiplexed with other purposes (e.g. SPI programming on ATMEGA)
- Power supply
- Oscillator pins for parts without strong internal oscillator options. For microcontrollers with sophisticated clock sections with accurate frequency reference, PLL, etc., these pins are often not used for this purpose and would fit better with the general IO pins. For microcontrollers with simplistic clocking (ATMEGA, etc), very little can be done without a crystal and the schematic will be cleaner with it in a better location.
- IO pins should have type "Bidirectional"; this allows them to be connected to pins of any other type, and emits a warning when connecting them directly to a supply rail. This applies even to pins with analog functions, including oscillator pins.
I will follow up with a diagram showing where groups of pins should be placed. Spacing between certain pin types will be standardized, to guarantee sufficient but not excessive room for support components around the IC.
Looks like we are mostly in agreement! I am a bit against renaming programming interface pins as it might be one of the things people would want to grep in the datasheet (even more so than power rails). As i said in the other issue, some pins that have important secondary functions but not so important to warrant moving them to a separate symbol part should have them in the label, an example that comes up is the uarts and USB interfaces used by the DFU programmer, specially if it's the only one in the chip and pins cant be swapped.
I have been naming USB pins already. Usually USB microcontrollers are only used if USB is desired, so it makes sense to label them. I would consider programming UARTs under "programming interface" above.
Updated to comply with your request.
Preferred dimensions for single-unit microcontrollers: