Difference between revisions of "Making Parts for PCB Libraries"
Smaldonado (talk | contribs) (Populated "Finishing a Component") |
Smaldonado (talk | contribs) (→Recompiling and SVN Management: Added recompiling notes) |
||
Line 66: | Line 66: | ||
==Recompiling and SVN Management== | ==Recompiling and SVN Management== | ||
+ | ===Recompiling the Integrated Library=== | ||
+ | Before you can use your new part, you'll need to recompile the SSI library. Lock SSI.LibPkg, then recompile {{altium-shortcut|c|c}}. The compilation process may take some time, and may throw errors at its conclusion. While that clearly means you ''can'' stop if any of those errors are on the part(s) you've added, it's best practice to try and fix them before finishing. A common error is a duplicate pin error, where two pins in a schematic symbol have the same designator. This can be easily corrected by changing one pin's designator. Make sure (if necessary) to change the pin mapping after doing so, by clicking on the paired footprint in the Editor pane to bring back the necessary dialogue. If you compile without errors on any parts you added, congratulations! Your component is now officially part of the SSI library. You'll just need to commit it to the SVN for others to use. | ||
===Commit Files to SVN=== | ===Commit Files to SVN=== | ||
+ | |||
{{altium-stub}} | {{altium-stub}} | ||
[[Category:Altium]] | [[Category:Altium]] |
Revision as of 22:38, 14 June 2016
This article describes how to create a new part in SSI's Altium PCB component libraries. SSI maintains a collection of Altium component libraries, many of them derived from libraries generously donated to SSI by the Stanford Solar Car Project. This is designed to serve as both a reference, and a practical guide for how to turn a component with a datasheet into a schematic symbol with a corresponding PCB footprint.
Introduction
Prior to creating a part, you should have installed and configured Altium and TortoiseSVN. In Altium, open the SSI Library project - SSI.libpkg, in SSI_SVN/libraries/intlib - with File → Open Project f → j
. Your "Projects" pane should now have a large number of .PcbLib and .SchLib files open (see right; open the projects pane with View → Workspace Panels → System → Projects v → w → s → p
if the "Projects" pane is not visible).
Altium has several different noteworthy types of libraries.
- Schematic libraries (.SchLib files) store schematic symbols and the components they correspond with. Schematic libraries contain schematic editor symbols, links to footprints (from PCB libraries; see below), mapping between the pins in the schematic symbol and pads on the footprint, and links to the part supplier (most often, Digi-Key)
- PCB libraries (.PcbLib files) contain the actual PCB layouts for library components. PCB libraries include landing patterns (the actual pad shapes that will appear on the PCB) and 3D models of the associated packages.
- Integrated libraries (.LibPkg files) are Altium projects that combine schematic and PCB libraries.
- Compiled libraries (.IntLib files) are installable files that allow you to use library parts in schematics and PCBs. Every time a part is added to a library, the Integrated library will need to be recompiled before the part can be added to a PCB project.
Locking in SVN
Prior to adding a part to a library, it's important to "lock" the library in SVN so that other people using the library don't create a conflicted copy. Locking does keep other people from making library edits at the same time, so do not lock a library unless you will be immediately editing it, and, even if a symbol or component is not completely done, commit any libraries you've locked before stepping away for an extended period of time (see Recompiling and SVN Management). To lock any library, right click on it in the Projects pane, click "Version Control," and then "Lock" right click → e → l
. If you need to edit a locked library, mouse over the lock symbol in the Projects pane to see who has the lock, then message them in the #altium
Slack channel to ask if they still need the lock. You can override the lock, but doing so creates the risk of a conflict and will result in lost work if the lock is protecting ongoing changes.
Creating a New Schematic Symbol
Drawing a Symbol
To create a new schematic symbol, first find the relevant schematic library. Schematic libraries are sorted by function - i.e. power management integrated circuits (PMIC), diodes, etc. Next, lock the library you'll be working with, and double click the library to open it. If not already visible, open the "SCH Library" pane v → w → c → b
and look at the top field, where there should be a list of symbols. Click "Add" to create a new symbol, giving it a name consistent with the names used in the library (this is poorly standardized, but typically consists of, in all caps, <category_of_component>_<manufacturer_part_number>). Your new part should then become active, bringing up a blank editing window.
Next, you'll draw out the graphics for your symbol. Begin by setting the snap grid of the editor (the grid of points it will allow for drawing) to 10 point spacing, by opening the snap grid settings v → g → s
and entering 10 for the snap grid size. This is not strictly required, and smaller grids can be used to create finer detail in symbols (5 and 2.5 are recommended), but all connection points for the symbol (added later) must be placed on a 10 point grid and thus symbols should be drawn to accommodate that.
For logic gates, transistors, and other components that traditionally have distinct schematic symbols, it is helpful to draw those symbols - you can often copy the graphics from an existing, similar part by simply opening the existing part from the symbols list in the SCH Library pane, selecting all of the symbol in the editing window and copying, then reopening and pasting into your own symbol. You should then delete all of the pins and replace them as described below. If no suitable symbol exists, draw a symbol by placing lines p → l
, referring to existing symbols for guidelines on size and color. Altium's documentation of the line tool is available here.
Integrated circuits are typically represented in schematics simply with rectangles; you can place a rectangle p → r
by specifying two opposite corners. Rectangles are easy to resize; it is recommended that you start with a large rectangle and downsize after placing pins.
Pins
Pins are how your symbol will be connected to wires when used in schematics. Enter the pin placement tool p → p
, but before clicking to place your first pin, bring up the pin placement settings window tab
. If designing a footprint for an IC, enter the pin name for the first pin in "Display Name," and set the "Designator" to the first pin's pin number (typically 1). If placing a pin for a symbol where a name should not appear, uncheck the "Visible" box by Display Name, and set the Designator to the appropriate number. Finally, set "Length" to 20, and exit the "Pin Properties" dialogue. You can now place your pin - make sure you are using a 10 point snap grid, as failing to do so can lead to errors in boards that use your symbol. After clicking to place your pin, you should automatically be able to place another pin, with the designator automatically incremented - enter Pin Properties tab
to set the Display Name (and Designator, if needed), and then place your next pin. Repeat until all pins are placed.
Next, resize rectangles and lines and move pins around until you're satisfied with the look of the symbol. You're done drawing the symbol! Make sure to save the .SchLib you're working on - if you're not going to immediately proceed to Creating a New Footprint and/or Finishing a Component, commit the library you were working on - this will release the lock and allow others to work on the library.
While this is the generic approach for drawing a schematic symbol, Altium also contains tools for automatically drawing certain types of symbols.
Creating a New Footprint
Footprints are the geometries of the actual layers that will be made on a printed circuit board. They correspond to the "packages" components come in - ie. SOIC, SOT-23, and many more - and so are often reusable between different components. While schematic libraries were sorted by function, footprints are sorted by series (QFN, DFN, etc.) and part type. If the package type marked on your component's datasheet doesn't clearly fit a series and isn't a passive (resistor, capacitor, or inductor) and isn't a sensor (appropriate if the symbol was made in sensor.SchLib) or module (i.e. a full microcontroller, like a Teensy board), it probably belongs in the Miscellaneous library.
As before, lock the library your footprint will be added to, then open the library. If not already visible, open the "PCB Library" pane v → w → p → b
.
Drawing a Footprint
The component you created a symbol for above may already have a footprint in a PCB library; search for it before starting work in this section, and if it exists, skip to "Finishing a Component".
If your component is a standard package, there's a good chance you'll be able to generate your footprint using Altium's IPC Compliant Footprint Generator. Open up the tool t → i
, click "next," and search through the default styles listed. If your component is from a supported series, the tool will make your life a lot easier. Select the relevant series, and you will be prompted for a number of dimensions that should be specified on your component's datasheet. Unspecified dimensions - thinks like heel spacing, solder fillet, and courtyard and keepout areas - can typically be left as their default values.
Finishing a Component
Pairing Schematic Symbols and Footprints
After finishing a schematic symbol and footprint, switch to the schematic symbol in the schematic library editor. In the "Editor" pane at the bottom of the screen, click "Add Footprint," then "Browse." From there, find the relevant PCB footprint library in the dropdown, and then the relevant footprint within the library. Double click the footprint to return to the "Add Footprint" dialogue, where the selected footprint's details will now be shown.
Click "Pin Map," and confirm that the pins on the schematic symbol match up appropriately with the pads on the footprint (if pins were given designators that correspond with their pad numbers, this should have happened automatically). If they don't match, edit the fields until they do. Multiple schematic pins can map to the same footprint pad, but not the other way around - for two pads to connect to the same pin, they must be given the same number in the PCB library editor.
Next, click OK. Your schematic symbol is now paired with a footprint! The footprint should now show up in the list of footprints at the bottom of the Editor pane.
Adding Supplier Links
The final step is to add a link to a supplier part, to allow for automated BOM ordering. Open the "Supplier Search" pane v → w → s → u
, and type in either the manufacturer's part number or (better, though less universally applicable) the Digi-Key part number. A number of vendor options should appear if the part is purchasable. Most SSI electronic components are purchased in small quantities from Digi-Key; therefore, look through the list and try to find a "cut tape" (purchasable in single units) version of the part, ideally sold by Digi-Key. Then, right click (see right) and select "Add Supplier Link and Parameters to <SYMBOL_NAME>." When this completes, an entry should appear in the "Supplier" section of the SCH Library pane v → w → c → b
.
You're done creating this component! Save the schematic library, and proceed to the final steps below.
Recompiling and SVN Management
Recompiling the Integrated Library
Before you can use your new part, you'll need to recompile the SSI library. Lock SSI.LibPkg, then recompile c → c
. The compilation process may take some time, and may throw errors at its conclusion. While that clearly means you can stop if any of those errors are on the part(s) you've added, it's best practice to try and fix them before finishing. A common error is a duplicate pin error, where two pins in a schematic symbol have the same designator. This can be easily corrected by changing one pin's designator. Make sure (if necessary) to change the pin mapping after doing so, by clicking on the paired footprint in the Editor pane to bring back the necessary dialogue. If you compile without errors on any parts you added, congratulations! Your component is now officially part of the SSI library. You'll just need to commit it to the SVN for others to use.
Commit Files to SVN
This Altium-related article is a stub. You can help SSI by expanding it.