fix: number sot723 pins to match the datasheet (pins 1↔3 were swapped)#688
Open
chayan-1906 wants to merge 2 commits into
Open
fix: number sot723 pins to match the datasheet (pins 1↔3 were swapped)#688chayan-1906 wants to merge 2 commits into
chayan-1906 wants to merge 2 commits into
Conversation
Pins 1 and 3 were swapped: the lone right pad was numbered 1 and the top-left pad was numbered 3. KiCad's SOT-723 (Toshiba datasheet) and the repo's own sot23/sot323 convention put pin 1 top-left, pin 2 bottom-left and pin 3 alone on the right. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The SVG snapshot and the KiCad parity test only compare copper shapes, so a pin-numbering swap passes both. This asserts the pin-to-position mapping directly so it can't regress invisibly again. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sot723placed its pads at the correct KiCad/Toshiba positions but assigned the pin numbers 1 and 3 to the wrong pads: the lone right pad was numbered 1 and the top-left pad was numbered 3. Every other 3-pin SOT in this repo (sot23,sot23w,sot323) and KiCad's officialSOT-723.kicad_mod(which references the Toshiba datasheet) use the standard arrangement: pin 1 top-left, pin 2 bottom-left, pin 3 alone on the right. A real part placed on this footprint gets cross-wired (e.g. base↔collector on a transistor).This never showed in SVG snapshots or the KiCad parity test because both only compare copper shapes — pin numbers aren't rendered.
Fixes #686
Expected vs actual (default params)
The pad positions, sizes (0.45 × 0.4) and pitch (±0.575) already matched KiCad exactly — this PR only fixes which number each pad carries. Introduced in #404, which fixed the pad positions but kept the old pin→pad assignment.
Changes
src/fn/sot723.ts: two-line swap ingetCcwSot723Coords— pin 1 now takes the top-left spot and pin 3 the lone right spot (the order now actually runs counterclockwise, as the helper's name says)tests/sot723.test.ts: added a pin-to-position assertion so this can't regress invisibly againTesting
main(verified against the unfixed code) and passes with the fixtests/kicad-parity/sot723_kicad_parity.test.tsstill passes with 100% courtyard IoUbun run buildandbun run formatclean🤖 Generated with Claude Code