Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/fn/sot723.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ export const getCcwSot723Coords = (parameters: {
const { pn, w, h, pl, p } = parameters

if (pn === 1) {
return { x: p, y: 0 }
return { x: -p, y: 0.4 }
}
if (pn === 2) {
return { x: -p, y: -0.4 }
}
return { x: -p, y: 0.4 }
return { x: p, y: 0 }
}

export const sot723WithoutParsing = (
Expand Down
16 changes: 16 additions & 0 deletions tests/sot723.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,19 @@ test("sot723", () => {
const svgContent = convertCircuitJsonToPcbSvg(soup)
expect(svgContent).toMatchSvgSnapshot(import.meta.path, "sot723")
})

test("sot723 numbers pins like the datasheet: 1 top-left, 2 bottom-left, 3 right", () => {
const circuitJson = fp.string("sot723").circuitJson() as any[]
const pad = (pin: string) =>
circuitJson.find(
(el) => el.type === "pcb_smtpad" && el.port_hints?.[0] === pin,
)
// KiCad SOT-723 (Toshiba datasheet): pins 1 and 2 stack on the left
// (1 on top), pin 3 sits alone on the right, like sot23/sot323
expect(pad("1").x).toBeCloseTo(-0.575)
expect(pad("1").y).toBeCloseTo(0.4)
expect(pad("2").x).toBeCloseTo(-0.575)
expect(pad("2").y).toBeCloseTo(-0.4)
expect(pad("3").x).toBeCloseTo(0.575)
expect(pad("3").y).toBeCloseTo(0)
})
Loading