gEDA-dev: footprint cleanup
Dan McMahill
dan at mcmahill.net
Mon Aug 28 17:28:48 EDT 2006
Peter TB Brett wrote:
> On Monday 28 August 2006 12:48, Dan McMahill wrote:
>
>
>>Unless someone knows of a real standard for these through hold
>>footprints I'd suggest we change to:
>>
>>ACYm -> ACYmPdDw{,P} where m = pin pitch, d = pin diameter (not hole
>>size but pin size), w=width (perpendicular to axis), P for polarized.
>>For example ACY400P25D200P (yeah I know, it is _long_) would be a 400
>>mil pin spacing, 25 mil pin diameter, 200 mil wide polarized part.
>>
>>RCYm -> RCYmPdDo{,P} where m = pin pitch, d = pin diameter, o = outer
>>diameter of the part, P for polarized. So a RCY200P25D400P would be a
>>200 mil pin spacing, 25 mil pin diameter, 400 mil component diameter,
>>polarized.
>>
>>BREm -> BREmPdDwXl{,P} where m = pin spacing, d = pin diameter, w =
>>dimension of the part perpendicular to the major axis, l = dimension of
>>part along major axis, P for polarized. BRE200P25D150X300 has 200 mil
>>pin spacing, 25 mil pin diameter, 150 mil x 300 mil package size and is
>>non polarized.
>
>
> Is it possible to just put arbitrary numbers into these? For instance, if I
> try and instantiate a ACY1050 will it complain?
yes and no. Given what I'm hoping to do soon (move the m4 invocation to
compile time instead of run time), "no" is the one you should probably
work with.
> The way the M4 library works isn't really very clearly explained in the
> documentation... or maybe I'm just reading the docs wrong ;)
basically what happens is when you pick a device from the library menu,
the "QueryLibrary.sh" script gets called. A sample is this:
% sh ./QueryLibrary.sh . pcblib template component package
The "." is the path to the m4 library . "pcblib" is the name of the
library. "template" "component" and "package" all are used to build up
the following string which is then expanded by m4:
PKG_package(Description_template, ,`component',
Param1_template, Param2_template)
the "PKG_package" macro contains the definition for the actual
footprint. For example, consider the 7400 TTL library.
About the 2nd line of pcblib.contents has:
7400_dil:N:7400:4 dual-NAND [N 14 300]
The format is
template:package:component:comment
the comment is what shows up in the library menu. When you instantiate
this, what gets expanded is
PKG_N(Description_7400_dil, , `7400', Param1_7400_dil, Param2_7400_dil)
Take a look in TTL_74xx_DIL.m4. There you have
define(`Description_7400_dil', ``4 dual-NAND'')
define(`Param1_7400_dil', 14)
define(`Param2_7400_dil', 300)
define(`PinList_7400_dil',
``1A',`1B',`1Y',`2A',`2B',`2Y',`Gnd',`3Y',`3B',`3A',`4Y',`4B',`4A',`Vcc'')
m4 will take these definitions and produce
PKG_N(`4 dual-NAND', , `7400', `14', `300')
and finally, PKG_N is defined in dil.inc and creates a 14 pin DIP
package with 300 mil spacing between the rows (from the 14 and 300
parameters to PKG_N).
Now, there is actually a litle extra magic related to the
PinList_7400_dil. I haven't read through all that part.
Now the way gsch2pcb does this is you'd set the footprint= attribute to
"N 14 300" (the string in the [] that you see in the library menu).
gsch2pcb then generates
PKG_N(`name', `value', `descr', `14', `300')
and feeds it to m4.
The thing I don't particularly care for is that there is no real reason
that we can't run m4 over all the footprints at compile time or maybe
even at 'make dist' time. The results could be put into a newlib
library and then you don't need m4 at runtime anymore.
-Dan
More information about the geda-dev
mailing list