Skip to content

feat: implement PDIP and SPDIP footprints#509

Open
z5005z-hue wants to merge 1 commit intotscircuit:mainfrom
z5005z-hue:feat/pdip-8
Open

feat: implement PDIP and SPDIP footprints#509
z5005z-hue wants to merge 1 commit intotscircuit:mainfrom
z5005z-hue:feat/pdip-8

Conversation

@z5005z-hue
Copy link

Summary

Implements two new footprint families: PDIP and SPDIP.


PDIP (Plastic Dual In-line Package)

PDIP is the standard plastic through-hole DIP package. It delegates to the existing dip() implementation with canonical dimensions:

  • Pitch: 100mil (2.54mm)
  • Row spacing: 300mil (7.62mm) for ≤28 pins, 600mil (15.24mm) for 40-pin
  • Supports all standard variants: pdip8, pdip14, pdip16, pdip28, pdip40, etc.

Closes #371


SPDIP (Shrink Plastic Dual In-line Package)

SPDIP uses a tighter 70mil pitch — common in PIC microcontrollers and similar ICs:

  • Pitch: 70mil (1.778mm)
  • Row spacing: 600mil (15.24mm)
  • Primary variant: spdip28

Closes #180


Tests

All 6 tests pass, SVG snapshots generated:

✓ pdip8
✓ pdip14
✓ pdip16
✓ pdip8 parameters
✓ spdip28
✓ spdip28 parameters

PDIP (Plastic Dual In-line Package):
- Delegates to existing dip() with standard 300mil (7.62mm) row spacing
- 100mil (2.54mm) pitch
- Auto-selects 600mil width for 40+ pin variants
- Supports: pdip8, pdip14, pdip16, pdip28, pdip40 etc.

SPDIP (Shrink Plastic Dual In-line Package):
- 70mil (1.778mm) pitch (narrower than standard DIP)
- 600mil (15.24mm) row spacing
- Primary target: SPDIP-28 (closes tscircuit#180)

Both footprints added to fn/index.ts for automatic registration.

Closes tscircuit#371 (PDIP-8)
Closes tscircuit#180 (SPDIP-28)
Comment on lines +6 to +45
test("pdip8", () => {
const circuitJson = fp.string("pdip8").circuitJson() as AnyCircuitElement[]
const svgContent = convertCircuitJsonToPcbSvg(circuitJson)
expect(svgContent).toMatchSvgSnapshot(import.meta.path, "pdip8")
})

test("pdip14", () => {
const circuitJson = fp.string("pdip14").circuitJson() as AnyCircuitElement[]
const svgContent = convertCircuitJsonToPcbSvg(circuitJson)
expect(svgContent).toMatchSvgSnapshot(import.meta.path, "pdip14")
})

test("pdip16", () => {
const circuitJson = fp.string("pdip16").circuitJson() as AnyCircuitElement[]
const svgContent = convertCircuitJsonToPcbSvg(circuitJson)
expect(svgContent).toMatchSvgSnapshot(import.meta.path, "pdip16")
})

test("pdip8 parameters", () => {
const json = fp.string("pdip8").json()
expect(json.num_pins).toBe(8)
expect(json.p).toBe(2.54)
expect(json.w).toBe(7.62)
})

// SPDIP tests
test("spdip28", () => {
const circuitJson = fp.string("spdip28").circuitJson() as AnyCircuitElement[]
const svgContent = convertCircuitJsonToPcbSvg(circuitJson)
expect(svgContent).toMatchSvgSnapshot(import.meta.path, "spdip28")
})

test("spdip28 parameters", () => {
const json = fp.string("spdip28").json()
expect(json.num_pins).toBe(28)
// 70mil pitch
expect(json.p).toBeCloseTo(1.778, 2)
// 600mil row spacing
expect(json.w).toBeCloseTo(15.24, 1)
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test file contains 6 test() calls (pdip8, pdip14, pdip16, pdip8 parameters, spdip28, spdip28 parameters), but the rule states that a *.test.ts file may have AT MOST one test(...). After the first test, the user should split into multiple, numbered files. To fix this, split the tests into separate files like pdip1.test.ts, pdip2.test.ts, etc., with each file containing only one test() call.

Suggested change
test("pdip8", () => {
const circuitJson = fp.string("pdip8").circuitJson() as AnyCircuitElement[]
const svgContent = convertCircuitJsonToPcbSvg(circuitJson)
expect(svgContent).toMatchSvgSnapshot(import.meta.path, "pdip8")
})
test("pdip14", () => {
const circuitJson = fp.string("pdip14").circuitJson() as AnyCircuitElement[]
const svgContent = convertCircuitJsonToPcbSvg(circuitJson)
expect(svgContent).toMatchSvgSnapshot(import.meta.path, "pdip14")
})
test("pdip16", () => {
const circuitJson = fp.string("pdip16").circuitJson() as AnyCircuitElement[]
const svgContent = convertCircuitJsonToPcbSvg(circuitJson)
expect(svgContent).toMatchSvgSnapshot(import.meta.path, "pdip16")
})
test("pdip8 parameters", () => {
const json = fp.string("pdip8").json()
expect(json.num_pins).toBe(8)
expect(json.p).toBe(2.54)
expect(json.w).toBe(7.62)
})
// SPDIP tests
test("spdip28", () => {
const circuitJson = fp.string("spdip28").circuitJson() as AnyCircuitElement[]
const svgContent = convertCircuitJsonToPcbSvg(circuitJson)
expect(svgContent).toMatchSvgSnapshot(import.meta.path, "spdip28")
})
test("spdip28 parameters", () => {
const json = fp.string("spdip28").json()
expect(json.num_pins).toBe(28)
// 70mil pitch
expect(json.p).toBeCloseTo(1.778, 2)
// 600mil row spacing
expect(json.w).toBeCloseTo(15.24, 1)
})
test("pdip8", () => {
const circuitJson = fp.string("pdip8").circuitJson() as AnyCircuitElement[]
const svgContent = convertCircuitJsonToPcbSvg(circuitJson)
expect(svgContent).toMatchSvgSnapshot(import.meta.path, "pdip8")
})

Spotted by Graphite Agent (based on custom rule: Custom rule)

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

Copy link
Contributor

@rushabhcodes rushabhcodes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add kicad parity test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement PDIP-8 Implement SPDIP-28

2 participants