[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: TQFP footprint questions



On Fri, Oct 17, 2008 at 04:38:58PM -0400, Rob Butts wrote:
> 
>    I'm trying to create a footprint for a Microchip signal controller.
>    I'm having trouble locating the horizontal pins with respect to the
>    vertical pins.

I've attached the script I use to make QFPs using jcl's perl module.
Footprints made with this script have built real boards for 208, 80,
100r (rectangular), 32 (large and small variants).

Even if you don't use the script as a script, the end contains a table
of dimensions culled from a few sources.

-- 
Ben Jackson AD7GD
<ben@xxxxxxx>
http://www.ben.com/
#!/usr/bin/perl

# based on:
# http://www.national.com/ms/LA/LAND_PATTERN_RECOMMENDATIONS-MISC.pdf
# which has some crackheaded stuff, but good ref values
# but values hacked by http://www.necel.com/pkg/en/icpkg/lpattern/fig0008.pdf

use strict;
use warnings;

use Pcb_8;

my $small = $ARGV[0] =~ /s(mall)?/;

my $Pcb = Pcb_8->new(dim=>'mm');
$Pcb->element_set(thickness => 0.254, line_thickness => 0.254, arc_thickness => 0.254);

my @Fields = qw(D Dp Lead L Lp W P A Ap B Bp X Other);

while (<DATA>) {
	s/\#.*//; # Remove comments
	s/^\s*//; # Remove leading spaces
	s/\s*$//; # Revove trailing spaces
	next unless length; # Skip empty lines
	my @values = split;

	# hash for each footprint

	my %f = map { $_ => shift(@values) } @Fields;
	my $suffix = defined $f{Other} ? "r" : "";
	$suffix .= "_S" if $small;
	# pins on "other" side
	$f{Other} = $f{Lead}/4 unless defined $f{Other};
	# pins on "first" side (think rectangular)
	$f{First} = ($f{Lead}-2*$f{Other})/2;

	my ($alpha, $beta2);
	if ($small) {
		$alpha = 0.40;	# away from part
		$beta2 = 0.20;	# soldering helper
	} else {
		$alpha = 0.40;	# away from part
		$beta2 = 0.70;	# soldering helper
	}

	$f{A} = $f{D} + 2 * $alpha;
	$f{Ap} = $f{Dp} + 2 * $alpha;
	$f{B} = $f{L} + 2 * $beta2;
	$f{Bp} = $f{Lp} + 2 * $beta2;
	$f{X} = 0.28 if $f{P} == 0.5; # $f{W} notwithstanding
	$f{X} = 0.38 if $f{P} == 0.65;
	$f{X} = 0.43 if $f{P} == 0.80;

	my $N = $f{Lead};
	my $P = 100 * $f{P};

print "tmp/QFP_P$P"."_N$N$suffix $f{First} / $f{Other}\n";

	$Pcb->element_begin(description => "QFP",
			  output_file => "tmp/QFP_P$P"."_N$N$suffix");

	my %attr = (width => $f{X}, length => ($f{B}-$f{A})/2,
		mask => .0762, clearance => 0.254,
		x => -$f{B}/2 + ($f{B}-$f{A})/4);
	my @rounded = (flags => Pcb_8::PAD_ROUNDED);

	my $pin = 1;
	for (my $i = 1; $i <= $f{Other}; ++$i) {
		$Pcb->element_add_pad_rectangle(@rounded, %attr,
			y => ($i - 0.5 - $f{Other}/2) * $f{P},
			pin_number => $pin,
			name => $pin);
		@rounded=();
		++$pin;
	}

	$pin = $f{Other} + $f{First} + 1;
	$attr{x} = -$attr{x};
	for (my $i = 1; $i <= $f{Other}; ++$i) {
		$Pcb->element_add_pad_rectangle(%attr,
			y => -($i - 0.5 - $f{Other}/2) * $f{P},
			pin_number => $pin,
			name => $pin);
		++$pin;
	}

	$attr{width} = ($f{Bp}-$f{Ap})/2,
	$attr{length} = $f{X};
	$attr{y} = $f{Bp}/2 - ($f{Bp}-$f{Ap})/4;

	$pin = $f{Other} + 1;
	for (my $i = 1; $i <= $f{First}; ++$i) {
		$Pcb->element_add_pad_rectangle(%attr,
			x => ($i - 0.5 - $f{First}/2) * $f{P},
			pin_number => $pin,
			name => $pin);
		++$pin;
	}

	$pin = $f{First} + $f{Other}*2 + 1;
	$attr{y} = -$attr{y};
	for (my $i = 1; $i <= $f{First}; ++$i) {
		$Pcb->element_add_pad_rectangle(%attr,
			x => -($i - 0.5 - $f{First}/2) * $f{P},
			pin_number => $pin,
			name => $pin);
		++$pin;
	}

if (0) {
	my $tx = $f{B} / 2;
	my $ty = $f{Bp} / 2;
	$Pcb->element_add_lines(thickness=> 1, points => [-$tx,-$ty, -$tx,$ty, $tx,$ty, $tx,-$ty, -$tx,-$ty]);

	$tx = $f{A} / 2;
	$ty = $f{Ap} / 2;
	$Pcb->element_add_lines(thickness=> 1, points => [-$tx,-$ty, -$tx,$ty, $tx,$ty, $tx,-$ty, -$tx,-$ty]);
}

	# outside chip body?
	my $sx = $f{D} / 2 + $alpha - 0.127*3;
	my $sy = $f{Dp} / 2 + $alpha - 0.127*3;
	my $bv = ($f{D} - $f{P} * ($f{First} - 1)) / 2;

	$Pcb->element_add_lines(points => [-$sx,-$sy+$bv, -$sx,$sy, $sx,$sy, $sx,-$sy, -$sx+$bv,-$sy, -$sx,-$sy+$bv]);


	$Pcb->element_set_text_xy(x => -$f{B}/2, y => -$f{Bp}/2);

    $Pcb->element_output();


}
__DATA__

#D D' Lead L L' W P A A' B B' X First
#Body Body Count Lead Tip Lead Tip Lead Lead/Pad Inner Pad Inner Pad Outer Pad Outer Pad Land CountFirst
#(mm) (mm) (mm) (mm) (mm) (mm) (mm) (mm) (mm) (mm) (mm)
7 7 32 9.00 9.00 0.45 0.80 7.50 7.50 9.80 9.80 0.45
7 7 40 9.29 9.29 0.26 0.50 7.50 7.50 9.78 9.78 0.30
7 7 48 9.40 9.40 0.27 0.50 6.88 6.90 10.42 10.40 0.32
10 10 44 13.35 13.35 0.45 0.80 10.53 10.53 14.47 14.47 0.55
10 10 52 14.15 14.15 0.38 0.65 9.08 9.08 15.17 15.17 0.43
12 12 64 14.00 14.00 0.38 0.65 11.48 11.48 15.02 15.02 0.43
14 14 80 16.00 16.00 0.38 0.65 13.08 13.08 19.17 19.17 0.43
14 20 80 17.80 23.80 0.35 0.80 13.50 19.50 18.50 24.50 0.40 24
14 14 100 16.00 16.00 0.30 0.50 13.08 13.08 18.47 18.47 0.35
14 20 100 16.00 22.00 0.30 0.65 13.50 19.50 18.50 24.50 0.35 30
20 20 100 22.00 22.00 0.40 0.65 21.28 15.28 25.32 19.32 0.45
24 24 132 24.21 24.21 0.30 0.64 21.67 21.67 25.23 25.23 0.40
28 28 120 32.15 32.15 0.45 0.80 27.88 27.88 33.17 33.17 0.55
28 28 128 31.45 31.45 0.45 0.80 28.03 28.03 32.47 32.47 0.55
28 28 144 32.15 32.15 0.38 0.65 28.03 28.03 33.17 33.17 0.43
28 28 160 32.40 32.40 0.38 0.65 29.48 29.48 33.42 33.42 0.43
28 28 208 30.60 30.60 0.30 0.50 28.08 28.08 31.62 31.62 0.35
32 32 240 34.60 34.60 0.30 0.50 32.50 32.50 35.62 35.62 0.35

_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user