Quantcast
Channel: fritzing forum - Latest posts
Viewing all articles
Browse latest Browse all 28182

A new part creation HowTo (long! So long it is in 2 posts)

$
0
0

...
So on to pcb

(continued from post above!)

file->open->Valor_pm6078_004_dip24_600mil_a767a3d6da455346efcf8832aa1d3192_2_pcb.svg

This file is somewhat different than the previous ones (because it came from another part). The first item of business is to be able to see the text that is there but currently invisible (as it is white text on a white background) so go to xml editor and expand the + in svgid silkscreen (which is the text). select the first item svg:path id="path3339" and in the right hand window select stroke then change the value from #ffffff (white) to #0000000 (black) which is both the new standard for Fritzing and will make it visible in Inkscape, then click Set to make the change. Next there should be 6 copies of circles (you can change one from #ffffff to #000000 to see it if you like). We don't want these so just hit the delete key to delete it and repeat for the other 5. Once thats done just under the path should be a + svg g id="g3353" which is the group id that contains all the (rather oddly numbered!) pin numbers. click on the + sign at the start of + svg g id="g3353" and it should expand in to a lot of group ids starting with

  • < svg:g id="g3355"

we will leave this one to duplicate for the text we want to add but now delete all the other ids from 3359 to 3471 by selecting them one at a time and pressing the delete key. When finished click on the + sign in front of + #ffffff to #000000 then Set which will reveal a small sideways 9 next to pin 12. We will duplicate, rotate and resize this to create the text we want to add to the silkscreen layer because I have not found a way to add text via Inkscape without duplicating text created by Fritzing that Fritzing will accept. If anyone knows how please post! Now we have a 24 pin out line with 6 extra pads at the top and 2 extra pads on the left side by pins 21 and 19. We want to select them with cntrl-left click one at a time and delete them. Once that is done select the outer rectangle on the silkscreen layer via cntrl-left click and again move the mouse over the arrow on the top line in the middle until it goes white then drag the top line down .1 inch til it is aligned on the major (.1) grid line just above pin 1. At the end the black outline should be just outside all the 24 remaining pins. As you will see the center of the pads is not aligned to the grid, so as with the breadboard we are going to do an edit select all and move it up and right until it is aligned to the grid. In this case we want the center of the pad to be centered on the .1 grid. Use the x y movement arrows on the 2nd top tool bar to get it close to where you think that is (zoom in on a pad to get the .01 grid lines). When you think you have it with the entire drawing selected, click outside the view box to deselect everything then cntrl-left click just one pad. This will create a rectangle with directional arrows around the pad. Check that the x and y arrows are exactly on the .1 grid lines. If they are not then edit select all (as movement now would only move this one pad which is not what we want) and use the tool bar x y markers to move the entire part the correct direction then select the pad again to see if you were right (I find I can get this correct in a try or two). Once we have the pads correctly aligned we again need to anchor the 0 0 point with a rectangle so the resize won't undo what we just did. So with the rectangle tool on the left tool bar create a small rectangle at the 0 0 point (a .001 square is fine as long as the bottom left corner is at position 0 0 on the rulers on the edge of the canvess.)
now click

edit->select all (about the middle of the pull down menu)

file->document properties->Page->Resize page to content

which will expand to show a button marked

Resize page to drawing or selection.

Click on that button to resize the view box.

Now select the rectangle at 0 0 with cntrl-left click and delete it with the delete key as we don't need it any more You should now have a standard 24 pin 600 mill footprint outline with a single horizontal 9 in text on pin 12. As I noted, their pin numbering is odd which we need to correct to match what the breadboard and schematic (and the fpz file) are expecting. In addition we need to delete the connection pins (leaving only unconnected pads) on pins 2 to 11 and 14 to 23. To start cntrl-left click on pin 1 (top left pin) to select it. In xml editor that will highlight . In the right hand panel of xml editor click on id which will bring up a window with connector48pad in it. Change that to

connector0pad

then click Set to make the change

Repeat this with pin 24 (top right pin) setting connector23pad as the id and

Pin 12 (bottom left) as connector11pad and pin 13 (bottom right) as connector12pad

Now we want to delete the connectors associated with pins 2 to 11 and 14 to 23. To do that select the pin (pin2 for instance) with cntrl-left click then right click and duplicate. This will create a new xml entry with an id like circle3519 (in my current case) on top of the original pad (connector47pad in my case). In theory (not yet verified by cutting a PCB!) this will create a solder pad on the board without an associated connector that will upset Fritzing. Repeate this til all the pads have an associated circle skipping pads 12 13 and 24 (which we want to have actual connections). Once all the pins are duplicated in xml editor skip connector23pad (as pin 24 that we want to have a connection) and select connector26pad (pin 23) which we don't want. Delete it using the delete key. All that should happen is the select box goes away (as well as the xml entry for connector26pad) the pad should still be there as the circle we duplicated. If the pad disappears, you missed the duplicate so use cntrl-z to undo the delete, select the pad, duplicate it and then delete the connector pad again. Do this until you have only connector23pad, connector12pad, connector11pad, connector0pad, and 22 circle ids. A note about groups here, part of the reason I did this via the duplicate function is that duplicate leaves the new pad in the correct group (copper0 in this case). While it is possible to do this by creating a pad with the circle tool, it will be created in the root group and you need to move it in to the copper 0 group. While cut and paste in Inkscape is supposed to do that I haven't been able to make that work and thus this is easier. That said we are now going to create a rectangle in root that we have to move in to group copper0 as the pad on pin 1 (if you were to look at the pcb for the generic IC that we started from for instance) should have a square around it to mark pin 1. Since this device didn't appear to have a pin 1, it isn't here so we need to add it. Select the zoom tool and zoom in on pin 1 til the pad is quite large. Now select rectangle tool (the square) in the left hand tool bar and click on the upper left corner of pin 1's pad then mouse down to the lower right corner of the pad. A square should form over the pad. As noted because this is a new rectangle it is currently in group root. At the bottom of the Inkscape window with the rectangle selected you will see a message

Rectangle in root. Click selection ...

(Inkscape note: The first time I tried this, the rectangle created but without any of the stroke or color information. I don't know why, and the only solution I could find was to uninstall Inkscape and delete the c:\Users\Owner\AppData\Roaming\Inkscape directory where Inkscape keeps all its user specific data. I think I must have pressed something I shouldn't and Inkscape remembered it. If this happens to you try this ...)

We need to move it from root in to the copper0 group. To do so select the rectangle in xml editor and with it selected click the Indent node button on the tool bar at the top of the xml window (6th icon from the left) twice to move it in two groups. If you then select the rectangle with Cntrl left click in the image at the bottom of the screen you should see "Rectangle in group copper0(root). Rather than root which it was initially. It also changes postion so select it and drag it back over the pad. Go back to select (the arrow on the top of the left hand tool bar) and in xml editor the rectangle you just created should be highlighted. If it has a line like

fill:#4d4d4d;fill-opacity:1;stroke:#333333;stroke-width:0.80000007

then change it to

fill:none;fill-opacity:1;stroke:#f7bd13;stroke-width:0.80000007

and hit set to apply it. If (as is the case for me this time) it doesn't have a line called
fill, then type fill in to the box beside set (where the id is usually) and enter

fill:none;fill-opacity:1;stroke:#f7bd13;stroke-width:0.80000007

That should create a rectangle around the pad on pin 1 possibly with some brown holes showing in the middle. On the image select the rectangle via cntrl left click. Then select the up/down arrow on the bottom edge of the rectangle til it goes white and move the bottom edge of the rectangle (not the whole rectangle only the bottom edge, cntrl-z to the rescue if you move the whole thing!) til the edge of the rectangle just meets the lowest point of the circle on the pad. Then do the other three sides of the rectangle it the same way. That should get rid of all the brown in the rectangle but in my case didn't quite. So back to xml editor with the rectangle selected and change

fill:none;fill-opacity:1;stroke:#f7bd13;stroke-width:0.73637617

to

fill:none;fill-opacity:1;stroke:#f7bd13;stroke-width:0.79637617

(i.e. increase the stroke with by .06 inches or more until no brown is showing but the hole in the middle is still round). We are now finished with the copper layers and can now move on to the silkscreen text. Zoom in on the text "9" we left by pin 12. Cntl-left click to select it, then rotate it by 90 degrees (5th icon in on the second top tool bar) so it is facing the correct direction. Now either select the text tool from the left tool bar or double click on the "9" to get in to text tool and add a "+" before the "9" and a "V" after it to end up with "+9V" beside pin 12. Now select that text and right click then duplicate to duplicate it. Move the duplicate to beside pin 13. Again use text tool from the left tool bar or double click it to get in to text mode and G then backspace and add a space (as Inkscape won't add a blank without a character after it) then forward space and add ND to end up with "+9V GND" beside pin 13. Select the +9V text again, right click and duplicate and move the duplicate up to beside pin 1. Enter text mode and change the text to "+5V". Now select and duplicate the "+5V" text and move the duplicate across to pin 24. Change the text their to "GND" Now select and duplicate the GND text and move it down to the middle of the IC about level with pin 5. Duplicate it three more times and move the duplicates a major grid line below the first text. Now In text mode change the top GND to VALOR, the second GND to PM6078-004 and the third GND to "5V to 9V" and the forth line to "Dc-DC Converter". Then center the text in the IC. Now select the "PM6078-004" text and in xml editor change the style font-size from 2.5 to 4.5 to make the part number text larger. Then again center that text in the IC and we are done. So zoom out til the IC takes up most of the screen (as these settings are what Inkscape will remember for our next edit) and then

file->save as->Valor_pm6078_004_dip24_600mil_09fe41a24b3af2603faaca391ca41c5a_2_pcb

save as type: optimized SVG

save

(check the correct boxes are ticked, which they should be)

OK

replace

then exit Inkscape with close without saving so as to not overwrite the above save.

Now we need to do some manual editing to fix things up. Inkscape when it saves the file adds (if it isn't already there) a px to all the font sizes. Fritzing can't deal with the px after the font size and when parts editor is used on the part sets the fonts to size 0 (very small!) when it saves the part. To avoid that we are going to manually edit the pxs out of all the svg files.

Valor_pm6078_004_dip24_600mil_a767a3d6da455346efcf8832aa1d3192_2_pcb

first search for px and if it follows a number, delete it for example:

height="1.2035738in"
y="0px"
x="0px">

changes to

height="1.2035738in"
y="0"
x="0">

and while we are here lets update the reference file field as well:

c:title> id="defs3839" /> id="desc3664">Arduino-Pro-Mini-v13-a4+5_pcb.svg

to

c:title> id="defs3839" /> id="desc3664">Valor_pm6078_004_dip24_600mil_pcb.svg

then the rest of the pxs such as

       style="font-size:2.5px;font-family:OCRA;fill:#ffffff"

to

       style="font-size:2.5;font-family:OCRA;fill:#ffffff"

etc

then edit ../schematic/Valor_pm6078_004_dip24_600mil_a767a3d6da455346efcf8832aa1d3192_2_schematic.svg

find and remove all instances of px in the font references

<referenceFile>generic_ic_dip_24_schem.svg</referenceFile>

to

<referenceFile>Valor_pm6078_004_dip24_600mil_schem.svg</referenceFile>

then save it

change to ../breadboard/Valor_pm6078_004_dip24_600mil_a767a3d6da455346efcf8832aa1d3192_2_breadboard.svg

and remove all instances of px

then change

<referenceFile>generic_ic_dip_24_600mil_bread.svg</referenceFile>

to

<referenceFile>Valor_pm6078_004_dip24_600mil_bread.svg</referenceFile>

and save. Now lets copy parts editor's example and make the icon svg file the same as
the breadboard svg file so

copy breadboard/Valor_pm6078_004_dip24_600mil_a767a3d6da455346efcf8832aa1d3192_2_breadboard.svg to icon/Valor_pm6078_004_dip24_600mil_a767a3d6da455346efcf8832aa1d3192_2_icon.svg

Now change to Fritzing/My Documents/Fritzing/parts/user and edit

Valor_pm6078_004_dip24_600mil_a767a3d6da455346efcf8832aa1d3192_2.fzp

In here we wish to delete all the pins (2 to 11 and 14 to 23) that we deleted in the svg
files. So find (and repeat)

< /connector>

(above is the end of pin1 connector0pin which we wish to keep, below til pin 12 we wish
to delete starting at the next line).

< connector name="pin2" id="connector1" type="male">
< description>pin 2
< views>
< breadboardView>
< p layer="breadboard" svgId="connector1pin" terminalId="connector1terminal"/>
< /breadboardView>
< schematicView>
< p layer="schematic" svgId="connector1pin" terminalId="connector1terminal"/>
< /schematicView>
< pcbView>
< p layer="copper0" svgId="connector1pin"/>
< p layer="copper1" svgId="connector1pin"/>
< /pcbView>
< /views>
< /connector>

(end of pin2 followed by the start of pin3, delete both of these along with all the
rest).

< connector name="pin3" id="connector2" type="male">
< description>pin 3< /description>
...

At the end of the deletes you should be left with only the 4 pins 1, 12, 13 and 24. So save the file.
At this point it would be a good bet to take a copy of the 4 svg and fzp file to a backup location in case parts editor decides to eat them later. Then at least you can start with the backup files to try and recover from the problem. I tend to do it by copying all of the my docs fritzing and roaming/fritzing directories to a backup directory like so:

F:\Fritzing\My Documents\Fritzing copied to F:\Fritzing_backup\valor_create_backups\my_docs_27sep_Inkscape_edited_prefritz_Fritzing

(remebering I have odd hard links that move my Fritzing directories off the system disk, if you don't this will be c:\Users\user_name\My Documents\Fritzing )

and

F:\Fritzing\AppData\Roaming\Fritzing copied to F:\Fritzing_backup\valor_create_backups\roaming27sep_Inkscape_edited_prefritz_Fritzing

that done, now start Fritzing

drag mine -> valor on to the breadboard and hopefully you will get a correct part.

Check breadboard view has 4 red connection points on the 4 pins, same for schematic view (4 red lines on the pin wires) and pcb view and the orientations to the grid all look correct. If that looks OK, select a 2pin connector (the first icon in core connectors) and drag it on to the breadboard (or one of the other views). In Inspector change its number of pins from the default 2 to 1 to make a single pin connector. Then duplicate it 3 times and move the resulting connectors next to each of the 4 active pins on the Valor. Now connect the connectors to the associated pin on the Valor and check it makes a connection in this view. Once that is done (assuming you started with breadboard) switch to schematic and move the connectors around to the appropriate pins on the Valor and make sure the connector numbers match with the same pin on the Valor. Do the same for PCB. Once all that is successful you have created a new part and tested it. Now we should clean up a bit. In parts bin mine we have a part called "mini" from which we swiped the pcb svg. So select parts bin mine and right click on the mini icon then click on "remove part" and yes to the box that comes up to delete the no longer needed parts (and hopefully its files). However I often find that Fritzing in fact doesn't delete the svg files for mini, and thus I manually delete them to keep the directories clean.

A Fritzing note here: sometimes I find the schematic or PCB views come up with the part rotated by 90 degrees. Apparantly this is a feature (or I think bug :slight_smile: ) in Fritzing rather than something wrong with the part

If this was really a new part (rather than creating one already posted as an exersize) you would want to right click on the part in parts bin mine and select

export part

then change the default title with blanks in it

VALOR PM6078-04 DC-DC Converter.fzpz

to one with underscores (while blanks will work fine as a file name they are a PITA for the
command line!) such as

PM6078-04_DC-DC_Converter.fzpz

and save the file to upload to the parts submit forum at

http://forum.fritzing.org/c/parts-submit

so other folks can benefit from your work. Then exit Fritzing saying no to save sketch and yes to save changes to parts bin. Happy parts creation, hope this helps! Make lots of new parts for me to swipe!

A final note: the forum software appears to object to the <(no space)char. It seems to take it as a formatting command and supresses the text. So if you see sections that look like they should have text but don't please point them out because there may be unescaped (with a space) < s there.
Hope this is useful to someone!

Peter Van Epp


Viewing all articles
Browse latest Browse all 28182

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>