Skip to content. | Skip to navigation

Personal tools

DilPackageGenerator – PDK Tool

The DilPackageGenerator.py script is a tool to easily generate the yeast of work of making a new dil package part.

Introduction

The DIL Package generator script is the most complex script in this PDK. It removes almost all of the pain of creating a new a DIL Package IC. … But wait … What’s a DIL Package IC?

dil-package-photo
Dil Package chips

Dil Package IC’s are all chips (IC: integrated circuit) or other parts that come in this shape of a black flat block with pins sticking out from each side. The DIL package has it’s pins lined up on the 0.1” grid (tenth of an inch), so it’s easy to stick them into a breadboard. A lot of IC’s come in a package like this, so you can easily do prototypes. Most of those IC’s are also available as smaller surface mounted (SMT) packages, but they can be much harder to solder by hand and experiment with.

There exist a lot of different IC’s out there. That is exactly the reason why we deliberately didn’t try to put all of these into Fritzing from the start. However, this DIL Package generator tool allows you to create your own IC parts, as you need them, with a minimum of effort.

Usage overview

The tool itself creates a folder with a name you provide; it creates the partdescription.xml file therein; and it also creates all image files necessary. After you created those, you just have to make some changes to the partdescription.xml file to make the new part complete. These are the steps you follow to create and use your new DIL Package IC part.

  1. Define the name (title) of the part and count the number of pins
  2. Go to the directory where you want to create the new part folder in
  3. Run the generator.py script with title and number of pins as arguments
  4. Open the partdescription.xml in the newly created directory.
  5. Modify the relevant sections therein
  6. Save the partdescription.xml file
  7. Move the part folder to your libaries/user folder in your Fritzing distribution
  8. Relaunch Fritzing to see the effect and work with your new part

Usage example

OpAmpExample

To explain the details of this process and of the DIL Package generator tool lets create a little example part. Let’s create a LM741, a fairly standard opAmp, which stands for Operation Amplifier. We’re not going into the details here about what an opAmp is or what you can do with it, there are far better places on the internet for this. We’re just gonna create the Fritzing part of this opAmp.

step 1: Let’s call it ‘opAmp’

We need a name for it, so just let’s call the part opAmp. Maybe this is not the best name imaginable, because there exist a lot of different opAmps. So maybe ‘singleOpAmp’ or ‘opAmp741’ would be better, but for this example, we’ll just stick with ‘opAmp’.

step 2: Count the number of pins

Our opAmp is an 8-pinner (it has 4 pins on each side). Easy.

step 3: Use our tool to generate the part.

Because we want our new part to be loaded in Fritzing, we create the part folder in the libraries/user folder directly. In my case I copied my Fritzing distribution into my /Applications folder. Of course we could also play it safe and create the part somewhere else first and then copy it over to the libraries/user folder later.

Since we’re creating the new opAmp part folder from a different location as where the generator.py tool can be found, we also have to tell the python command where this generator.py script can be found. In this example, let’s assume we just downloaded the PDK to our Desktop, so its path gonna be something like ~/Desktop/FritzingPDK/Tools/DilPackageGenerator/generator.py

Finally let’s decide what text we want to see on our new part. There is not much space on a 8-pinner, so “LM741” seems best.

    % cd /Applications/fritzing-0005/libraries/user
% python ~/Desktop/FritzingPDK/Tools/DilPackageGenerator/generator.py \
> OpAmp 8 "LM741"

This creates a folder named OpAmp in /Applications/fritzing-0005/libraries/user with all the necessary files. Next let’s get the partdescription.xml file in shape.

step 4. Modify the xml

Let’s first make the partdescription.xml a bit more specific to our part. In the xml there are 6 tags that deal with identity.

  • species
  • genus
  • description
  • label
  • reference
  • authors

In the generated xml we get from the generate.py tool, these tags are defined like this:

    <species>OpAmp</species>
<genus>IC.Logic</genus>
<title>OpAmp</title>
<description>Please describe your part here</description>
<label>IC</label>
<reference>http://www.example.com/url_to_online_reference</reference>
<authors>
<author url="http://fritzing.org/author/yourname">Add Your Name Here</author>
</authors>

So let’s change them into something more sensible and specific:

    <species>OpAmp</species>
<genus>IC.Analog</genus>
<title>Operational Amplifier</title>
<description>An op-amp can linearly amplify a signal</description>
<label>OA</label>
<reference>http://en.wikipedia.org/wiki/Op-amp</reference>
<authors>
<author url="http://fritzing.org/author/johndoe">John Doe</author>
</authors>

step 5. Setting the pin names

Finally we want to name the pins correctly, so we can use this useful information apart from just the pin number. For this we need to look into the part’s datasheet. In the datasheet you should be able to find a diagram of the pin layout. This is the one for the OpAmp:

OpAmpDiagram

So we can use the names in there to name the pins in the partdescription.xml. Note how the numbers are counted up in anti-clockwise order.

    <connectors units="tenths">
<nameLayout visible="false" />
<connector id="1" name="Offset Null" type="leg">
<point x="0" y="683" units="himetric"/>
<point x="0" y="3" />
</connector>
<connector id="2" name="Inverting Input" type="leg">
<point x="254" y="683" units="himetric"/>
<point x="1" y="3" />
</connector>
<connector id="3" name="Non-Inverting Input" type="leg">
<point x="508" y="683" units="himetric"/>
<point x="2" y="3" />
</connector>
<connector id="4" name="V+" type="leg">
<point x="762" y="683" units="himetric"/>
<point x="3" y="3" />
</connector>
<connector id="5" name="Offset Null" type="leg">
<point x="762" y="69" units="himetric"/>
<point x="3" y="0" />
</connector>
<connector id="6" name="Output" type="leg">
<point x="508" y="69" units="himetric"/>
<point x="2" y="0" />
</connector>
<connector id="7" name="V-" type="leg">
<point x="254" y="69" units="himetric"/>
<point x="1" y="0" />
</connector>
<connector id="8" name="NC" type="leg">
<point x="0" y="69" units="himetric"/>
<point x="0" y="0" />
</connector>
</connectors>

Save and close the partdescription.xml file.

step 6: Ready

So now the part is ready and you can test in inside Fritzing by relaunching Fritzing.


Full Reference

This script creates Fritzing DIL-Package IC parts. It generates the images and the partdescription.xml file for those parts in a part folder.

Usage:

	python generator.py [-f] TITLE [numberOfPins [ "text on chip" [wideOrNarrow]]]

Arguments:

-f
the flag to overwrite or not.
If a folder with the name TITLE did already exist and the -f flag is not used the script will exit.
TITLE
the title of the IC Package (e.g. 555Timer)
A folder named TITLE will be created and all images and xml will be created therein.
numberOfPins
the number of pins.
Must be an even number, minimal 6. If omitted, 6 will be used as number of pins.
"text on chip"
the text which is printed on the chip
If more than one word is used, it needs to be in quotes. (")
wideOrNarrow
argument indicating is whether to create a wide or narrow package.
Has to be 'wide' or 'narrow'. Narrow means bridging 3 rows. Wide means bridging 6 rows. If omitted 'narrow' will be used. (In fact, narrow is the only one working, yet, sorry)
Document Actions
© 2007- 2008 University of Applied Sciences Potsdam \ Powered by Plone