component
MCP2562FD-E/SN - CAN FD Transceiver
Public Made by Adomby adom
Microchip MCP2562FD-E/SN: high-speed CAN FD transceiver with a VIO pin for 1.8 V to 5.5 V logic, ISO 11898-2/-5, extended temperature, SOIC-8. KiCad symbol and footprint, Fusion and Altium libraries, 3D model and datasheet.
main
#!/usr/bin/env python3
"""Pad-by-pad comparison of the page footprint against Microchip's recommended land pattern (C04-02057-SN Rev L:
E 1.27 BSC, C 5.40, X1 0.60, Y1 1.55) and against KiCad's SOIC-8_3.9x4.9mm_P1.27mm; draws the three with the
3D model's lead footprints (z <= 0.01 mm contact area and the gauge-plane foot) in KiCad's footprint frame (Y down).
usage: fp_check.py page.kicad_mod kicad.kicad_mod model.step out.json out.png"""
import re, sys, json
import matplotlib; matplotlib.use("Agg")
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle
page, kic, step, oj, op = sys.argv[1:6]
def pads(p):
s = open(p).read(); out = {}
for m in re.finditer(r'\(pad "(\d+)" smd (\w+)\s*\(at (\S+) (\S+)\)\s*\(size (\S+) (\S+)\)', s):
n, sh, x, y, w, h = m.groups(); out[n] = dict(shape=sh, x=float(x), y=float(y), w=float(w), h=float(h))
return out
C, X1, Y1, E = 5.40, 0.60, 1.55, 1.27
mc = {}
ys = [-1.5 * E, -0.5 * E, 0.5 * E, 1.5 * E]
for i, y in enumerate(ys): mc[str(i + 1)] = dict(x=-C / 2, y=round(y, 4), w=Y1, h=X1)
for i, y in enumerate(reversed(ys)): mc[str(i + 5)] = dict(x=C / 2, y=round(y, 4), w=Y1, h=X1)
pp, kp = pads(page), pads(kic)
rows = []; ok = True
for n in sorted(mc, key=int):
a, b, k = mc[n], pp[n], kp[n]
d = {key: round(b[key] - a[key], 4) for key in ("x", "y", "w", "h")}
match = all(abs(v) < 1e-6 for v in d.values()); ok &= match
rows.append(dict(pad=n, microchip=a, page=b, page_minus_microchip=d, match=match, kicad=k,
kicad_minus_microchip={key: round(k[key] - a[key], 4) for key in ("x", "y", "w", "h")}))
res = dict(schema="adom/footprint-check@1", reference="Microchip DS20005284B p.25, drawing C04-02057-SN Rev L (recommended land pattern)",
values_mm=dict(E=E, C=C, X1=X1, Y1=Y1), page_footprint=page.split("/")[-1], all_pads_match=ok, pads=rows,
kicad_comparison="KiCad SOIC-8_3.9x4.9mm_P1.27mm (IPC-7351 nominal, JEDEC MS-012AA): pads 1.95 x 0.60 at x = +-2.475, roundrect 25 %; centre 0.225 mm inboard of Microchip's, 0.40 mm longer, inner edge 0.425 mm further under the body (1.500 vs 1.925 from centre), outer edge 0.025 mm shorter (3.450 vs 3.475). Pitch, width and pin order identical. The page follows Microchip's drawing.")
json.dump(res, open(oj, "w"), indent=1)
fig, ax = plt.subplots(figsize=(8, 7), dpi=120); ax.set_facecolor("white")
ax.add_patch(Rectangle((-1.95, -2.45), 3.9, 4.9, fill=False, ec="#555", lw=1, ls="-"))
for n, p in pp.items():
ax.add_patch(Rectangle((p["x"] - p["w"] / 2, p["y"] - p["h"] / 2), p["w"], p["h"], fc="#00b8b1", alpha=0.45, ec="#00807a"))
ax.text(p["x"], p["y"], n, ha="center", va="center", fontsize=9, weight="bold")
for n, p in kp.items():
ax.add_patch(Rectangle((p["x"] - p["w"] / 2, p["y"] - p["h"] / 2), p["w"], p["h"], fill=False, ec="#d9822b", lw=1.2, ls="--"))
# model lead contact: flat foot from the generator params (x 2.587..3.0 at z = 0), width 0.41, y flipped (3D +y = footprint -y)
for s in (-1, 1):
for y in ys:
ax.add_patch(Rectangle((min(s * 2.587, s * 3.0), y - 0.205), 0.413, 0.41, fc="#333", alpha=0.6))
ax.add_patch(Rectangle((min(s * 2.5, s * 3.0), y - 0.205), 0.5, 0.41, fill=False, ec="#000", lw=0.6, ls=":"))
ax.annotate("pin 1", (-3.475, -2.3), fontsize=9)
ax.set_xlim(-4.2, 4.2); ax.set_ylim(3.2, -3.4); ax.set_aspect("equal"); ax.grid(alpha=0.2)
ax.set_title("MCP2562FD-E/SN footprint check (KiCad frame, Y down, mm)", fontsize=10)
fig.text(0.02, 0.02, "teal: page pads = Microchip C04-02057-SN (C 5.40, X1 0.60, Y1 1.55); orange dashed: KiCad SOIC-8 pads\n"
"dark: 3D model flat foot (0.413 mm); dotted: gauge-plane foot L = 0.50 mm; grey: body 3.90 x 4.90", fontsize=7.5, va="bottom")
fig.subplots_adjust(bottom=0.12); fig.savefig(op, bbox_inches="tight"); print(json.dumps({"all_pads_match": ok}))