Esempio n. 1
0
def SC70(profile, num_pins):
    """Construct a land pattern for an SC70 device.
    
    Supports 5, 6 and 8-pin devices, with dimensions from JEDEC
    MO-203.
    """
    A = ipc.Dimension.from_nominal(1.25, 0.15)
    B = ipc.Dimension.from_nominal(2, 0.15)
    L = ipc.Dimension.from_nominal(2.1, 0.3)
    T = ipc.Dimension(0.26, 0.46)
    W = ipc.Dimension(0.15, 0.3)
    if num_pins == 5:
        # MO-203-C variant AA
        return ipc.sot23_5(A, B, L, T, W, 0.65,
                           ipc.LandPatternSize.SOT(profile, A, L, T, 0.65))
    elif num_pins == 6:
        # MO-203-C variant AB
        return ipc.in_line_pin_device(
            A, B, L, B, T, W, 0.65, 3, 0,
            ipc.LandPatternSize.SOT(profile, A, L, T, 0.65))
    elif num_pins == 8:
        # MO-203-C variant BA
        W = ipc.Dimension(0.15, 0.27)
        spec = ipc.LandPatternSize.SOT(profile, A, L, T, 0.5)
        return ipc.in_line_pin_device(A, B, L, B, T, W, 0.5, 4, 0, spec)
    else:
        raise ValueError(
            "No known standard dimensions for SOT23-{0}".format(num_pins))
Esempio n. 2
0
def MELF(profile, polarized):
    A = ipc.Dimension(4.7, 5.2)
    B = ipc.Dimension(2.41, 2.67)
    T = ipc.Dimension(0.46, 0.56)
    return ipc.two_terminal_symmetric_device(
        A=A, B=B, L=A, T=T, W=B,
        spec=ipc.LandPatternSize.MELF(profile),
        polarized=polarized)
Esempio n. 3
0
def soic(profile):
    """PIC12F609 microcontroller"""
    A = ipc.Dimension.from_nominal(3.9, 0.1)
    B = ipc.Dimension.from_nominal(4.9, 0.1)
    L = ipc.Dimension.from_nominal(6.0, 0.1)
    T = ipc.Dimension(0.4, 1.27)
    W = ipc.Dimension(0.31, 0.51)
    return lib.SOIC(profile, A, B, L, T, W, 8)
Esempio n. 4
0
def qfn(profile):
    """MAX3738 laser driver"""
    A = ipc.Dimension(3.9, 4.1)
    T = ipc.Dimension(0.3, 0.5)
    W = ipc.Dimension(0.18, 0.30)
    pitch = 0.5

    return lib.QFN(profile, A, T, W, pitch, 24)
Esempio n. 5
0
def tqfp(profile):
    """STM32F042K6T6 microcontroller"""
    A = ipc.Dimension(6.8, 7.2)
    L = ipc.Dimension(8.8, 9.2)
    T = ipc.Dimension(0.450, 0.750)
    W = ipc.Dimension(0.3, 0.45)
    pitch = 0.8

    return lib.QFP(profile, A, L, T, W, pitch, 32)
Esempio n. 6
0
def ssop(profile):
    """Some MAX-something transceiver"""
    A = ipc.Dimension(5.2, 5.38)
    B = ipc.Dimension(6.07, 6.33)
    L = ipc.Dimension(7.65, 7.90)
    T = ipc.Dimension(0.63, 0.95)
    W = ipc.Dimension(0.25, 0.38)
    pitch = 0.65

    return lib.SOP(profile, A, B, L, T, W, 16, pitch)
Esempio n. 7
0
def SOD(profile, polarized):
    A = ipc.Dimension(2.55, 2.85)
    B = ipc.Dimension(1.4, 1.7)
    L = ipc.Dimension(3.55, 3.85)
    T = ipc.Dimension(0.25, 0.4)
    W = ipc.Dimension.from_nominal(0.55, 0.1)
    return ipc.two_terminal_symmetric_device(
        A=A, B=B, L=L, T=T, W=W,
        spec=ipc.LandPatternSize.SOD(
            profile, A=A, L=L, T=T),
        polarized=polarized)
Esempio n. 8
0
def dfn(profile):
    """PIC12F609"""
    A = ipc.Dimension.from_nominal(3, 0.1)
    T = ipc.Dimension(0.2, 0.55)
    W = ipc.Dimension(0.25, 0.35)
    pitch = 0.65

    return ipc.in_line_pin_device(
        A=A, B=A, LA=A, LB=A, T=T, W=W, pitch=pitch,
        pins_leftright=4, pins_updown=0,
        spec=ipc.LandPatternSize.DFN(profile))
Esempio n. 9
0
def pqfn(profile):
    """QFN with pulled back leads"""
    A = ipc.Dimension(3.9, 4.1)
    L = ipc.Dimension(3.4, 3.6)
    T = ipc.Dimension(0.3, 0.5)
    W = ipc.Dimension(0.18, 0.30)
    pitch = 0.5

    return ipc.in_line_pin_device(
        A=A, B=A, LA=L, LB=L, T=T, W=W, pitch=pitch,
        pins_leftright=5, pins_updown=5,
        spec=ipc.LandPatternSize.QFN(profile))
Esempio n. 10
0
 def testFromNominal(self):
     d1 = ipc.Dimension(1, 4)
     d2 = ipc.Dimension.from_nominal(2, plus=2, minus=1)
     self.assertEqual(d1.min, d2.min)
     self.assertEqual(d1.max, d2.max)
     self.assertEqual(d1.tolerance, d2.tolerance)
     # Nominal is not recorded, so d2.nominal is not the same value
     # we passed in.
     self.assertEqual(d2.nominal, 2.5)
     self.assertEqual(d1.nominal, d2.nominal)
Esempio n. 11
0
 def testSOP(self):
     self._check_fp(
         'TSSOP',
         lib.SOP(ipc.Dimension(4.3, 4.5), ipc.Dimension(2.9, 3.1),
                 ipc.Dimension(6.25, 6.5), ipc.Dimension(0.5, 0.7),
                 ipc.Dimension(0.19, 0.3), 8, 0.65))
Esempio n. 12
0
 def testSOIC(self):
     self._check_fp(
         'SOIC',
         lib.SOIC(ipc.Dimension(3.8, 4), ipc.Dimension(4.8, 5),
                  ipc.Dimension(5.8, 6.2), ipc.Dimension(0.4, 1.27),
                  ipc.Dimension(0.3, 0.5), 8))
Esempio n. 13
0
 def testConstruct(self):
     d = ipc.Dimension(1, 2)
     self.assertEqual(d.min, 1)
     self.assertEqual(d.max, 2)
     self.assertEqual(d.nominal, 1.5)
     self.assertEqual(d.tolerance, 1)
Esempio n. 14
0
def SOT23(profile, num_pins):
    """Construct a land pattern for a SOT23 device.
    
    Supports 3, 5, 6 and 8-pin devices, with dimensions from JEDEC
    TO-236 and MO-178.
    """
    if num_pins == 3:
        # Dimensions from JEDEC TO-236-A[AB]
        A = ipc.Dimension(1.2, 1.4)
        B = ipc.Dimension(2.8, 3.04)
        L = ipc.Dimension(2.1, 2.64)
        T = ipc.Dimension(0.4, 0.6)
        W = ipc.Dimension(0.3, 0.5)
        return ipc.sot23_3(A, B, L, T, W, 0.95,
                           ipc.LandPatternSize.SOT(profile, A, L, T, 0.95))
    elif num_pins == 5:
        # Dimensions from JEDEC MO-178-C variant AA
        A = ipc.Dimension.from_nominal(1.6, 0.1)
        B = ipc.Dimension.from_nominal(2.9, 0.1)
        L = ipc.Dimension.from_nominal(2.8, 0.2)
        T = ipc.Dimension(0.3, 0.6)
        W = ipc.Dimension(0.3, 0.5)
        return ipc.sot23_5(A, B, L, T, W, 0.95,
                           ipc.LandPatternSize.SOT(profile, A, L, T, 0.95))
    elif num_pins == 6:
        # Dimensions from JEDEC MO-178-C variant AB
        A = ipc.Dimension.from_nominal(1.6, 0.1)
        B = ipc.Dimension.from_nominal(2.9, 0.1)
        L = ipc.Dimension.from_nominal(2.8, 0.2)
        T = ipc.Dimension(0.3, 0.6)
        W = ipc.Dimension(0.3, 0.5)
        return ipc.in_line_pin_device(
            A, B, L, B, T, W, 0.95, 3, 0,
            ipc.LandPatternSize.SOT(profile, A, L, T, 0.95))
    elif num_pins == 8:
        # Dimensions from JEDEC MO-178-C variant BA
        A = ipc.Dimension.from_nominal(1.6, 0.1)
        B = ipc.Dimension.from_nominal(2.9, 0.1)
        L = ipc.Dimension.from_nominal(2.8, 0.2)
        T = ipc.Dimension(0.3, 0.6)
        W = ipc.Dimension(0.22, 0.38)
        # SOT23-8 is almost at the threshold where IPC switches to
        # much smaller side fillets. This causes overlap violations
        # with the Most profile. As such, we force the narrower pitch
        # profile here by using a smaller pitch.
        spec = ipc.LandPatternSize.SOT(profile, A, L, T, 0.6)
        return ipc.in_line_pin_device(A, B, L, B, T, W, 0.65, 4, 0, spec)
    else:
        raise ValueError(
            "No known standard dimensions for SOT23-{0}".format(num_pins))
Esempio n. 15
0
 def testQFP(self):
     self._check_fp(
         'QFP',
         lib.QFP(ipc.Dimension(6.8, 7.2), ipc.Dimension(8.8, 9.2),
                 ipc.Dimension(0.45, 0.75), ipc.Dimension(0.3, 0.45), 0.8,
                 32))
Esempio n. 16
0
 def testQFN(self):
     self._check_fp(
         'QFN',
         lib.QFN(ipc.Dimension(4.9, 5.1), ipc.Dimension(0.3, 0.5),
                 ipc.Dimension(0.18, 0.28), 0.5, 32))
Esempio n. 17
0
        ic.pin(numbers=6 + i,
               name='PWM2_{0}'.format(i + 1),
               type=sch.Pin.Bidirectional)
    ic.pin(numbers=10, name='PWM14', type=sch.Pin.Bidirectional)
    for i in range(4):
        ic.pin(numbers=12 + i,
               name='PWM3_{0}'.format(i + 1),
               type=sch.Pin.Bidirectional)
    for i in range(3):
        ic.pin(numbers=18 + i,
               name='PWM3_{0}'.format(i + 1),
               type=sch.Pin.Bidirectional)
l.devices.append(
    kidraw.Device(schematic=s,
                  footprints=[
                      flib.QFP(A=ipc.Dimension(6.8, 7.2),
                               L=ipc.Dimension(8.8, 9.2),
                               T=ipc.Dimension(0.45, 0.75),
                               W=ipc.Dimension(0.3, 0.45),
                               pitch=0.8,
                               num_pins=32),
                  ]))

s = sch.Schematic(name='AP2120N', description='3.3V linear regulator')
with sch.ICBuilder(s, 3, slot_spacing=50) as ic:
    ic.side(sch.Pin.Left)
    ic.pin(3, name='Vin', type=sch.Pin.Power)
    ic.side(sch.Pin.Down)
    ic.pin(1, name='GND', type=sch.Pin.Power)
    ic.side(sch.Pin.Right)
    ic.pin(2, name='Vout', type=sch.Pin.Power)