Close

2) Making a footprint from scratch

A project log for Fritzing: creating your own part

A 3 minute guide, as well as a "from scratch" guide

AryaArya 12/13/2016 at 02:542 Comments

The footprint I got minified is a good template. I could just put "ATtiny85" into "ic_text"... come to think of it, it's already there. However, let's make it from scratch! There'll be issues like grid sizes and dimensions and it would be unfair not to get those sorted out.


Woke up, continuing work. Does the size even matter? I measured the real Tiny's dimensions and they weren't to scale with the SVG. Let's scale our ATtiny85 in Inkscape to those dimensions and find out:

Well. First of all, I enlarged that footprint but it shrinked. Second thing - Inkscape fucks up the SVG, making it unreadable:

What Inkscape does is effectively un-minifying the XML tree and adding its own tags. Ah well, I guess we could live without the pretty view - the main problem is scaling.

Next attempt - scaling the Tiny, but not the canvas - now preserving the ratio and just scaling up some pixels:

Ahha, so canvas size matters. Scaling the canvas up:

Okay, must have fucked something up while scaling. The important question is - what is defining the size as seen in Fritzing? I'll try to get through XMLs to find out...

No avail. Okay. Delete the "breadboard" XML ID and see if it snaps to grid...

It does. Change the pin IDs...

It still does. Wonderful... Not. Removing two pins from both SVG and .fzp:

Fuck it. Restarting Fritzing (oh god it's slow):

Successfully fucked up. Seems like something was cached. I can even almost figure out the caching process! Now, onto changing the breadboard and pin IDs back - except that I'm removing one pin from SVG and .fzp...

Nop. Still fucked up. Restarting Fritzing and trying again:

Success. However, the part is now colored red and is hard to move. Restoring the "connectors alright version" and restarting Fritzing...

Not red anymore? Maybe connectors have to be numbered right? Removing the Pin number 8 and retrying...

Pin 8 removed, part is red again. Is the .fzp I'm using even right? Returning the pin 8, changing its description, restarting the Fritzing and trying again...

Yeah, description is the old one. Well, to hell with it. I'll stop reverse-engineering things and finally draw a breadboard part:

Canvas set to max dimensions of my ATtiny85.

IC body: drawing a rectangle, Transform->Scale, uncheck "proportional", set dimensions to 0.36x0.23in (as measured by caliper). Align and Distribute-> Align -> center vertically and horizontally. Fill and stroke - fill with solid black and 100% opacity. Drawing a circle where it is on my IC, and I'll make it 1c1c1c grey. It's not pretty, but it sure as hell will work.

Pins are harder - mainly due to alignment issues. Let's divide the 0.36 length into 0.08 segments and center the pins in centers of those segments - that'd be 0.04, 0.12, 0.20 and 0.28. Now how to enter that in Inkscape? Oh, Transform->Move!

Top row vertical coordinate: 0.265in

Bottom row vertical coordinate: 0.000in

Now, pins get IDs from "connector0pin" to "connector7pin" (Object Properties -> ID). Adding "attiny85" text, select all, create group and name it "breadboard". Should be done! I'll just use the "Plain SVG" export option in Inkscape (in "Save As"), could reduce cruft. Let's replace the original SVG with ours and see how it works:

Not too good, but works. Some pin repositioning is required, and I might need to enlarge the components a bit. Let's restart Fritzing and check it works though...

It doesn't actually, but I'm starting to get a hang of it now. The SVG really does determine pin positioning, it's just cached. Tasklist:

  1. Try to make that Tiny a little wider and higher
  2. Place pins on a grid

Solutions:

  1. Canvas is 0.38x0.32in now, IC body is 0.38x0.25, pins realigned
  2. Now I think having 0.08 offsets was stupid. Pins are 0.02, 0.12, 0.22 and 0.32 now (X coordinate for the left bottom corner.)

Saving, reloading Fritzing and trying again:

Success! Except for height, everything is awesome.

Height to 0.34, IC body height to 0.27, restarting, testing...

Full success. Now, onto boiling it down in a separate worklog!

Discussions

deʃhipu wrote 12/13/2016 at 21:43 point

When you are saving your file in Inkscape, you can select either "Plain SVG" or "Inkscape SVG" as the format. One of them shouldn't put trash in the file.

  Are you sure? yes | no

Arya wrote 12/13/2016 at 21:47 point

Yeah, it's mentioned in the middle of this worklog, but I realised I should put that into tutorial pages as well. Thanks!

  Are you sure? yes | no