Commit 3759f957 authored by Sam Calisch's avatar Sam Calisch

made logger board

parent 00276ec6
from koko.lib.pcb import *
from koko.lib.sam import *
class TagConnectPDI(Component):
'''
'''
_pad = s2d.circle(0,0,.5*.031)
_via = s2d.circle(0,0,.5*.039)
pins = [
Pin(-.05,-.025,_pad,'CLK',label_size=.02),
Pin( .00,-.025,_pad,'NC',label_size=.02),
Pin( .05,-.025,_pad,'DAT',label_size=.02),
Pin(-.05,.025,_pad,'VCC',label_size=.02),
Pin( .00,.025,_pad,'NC',label_size=.02),
Pin( .05,.025,_pad,'GND',label_size=.02)
]
vias = [
Via(-.1,0,_via),
Via(.1,0.04,_via),
Via(.1,-.04,_via),
]
class feather(Component):
_pad = rectangle(-.05,.05,-.03,.03)
names = [
'RST','3V3','VREFA','GND','A0','A1','A2','A3','A4','A5','SCK','MOSI','MISO','RXD0','TXD0','GND2',
'SDA','SCL','5','6','9','10','11','12','13','VBUS','EN','VBAT'
]
os=.02
pins = [Pin(-.4-os*(-1)**i,.75-.1*i,_pad,names[i]) for i in range(16)]
pins += [Pin(.4-os*(-1)**i,-.75+.1*i,_pad,names[16+i]) for i in range(12)]
shadow = filleted_rectangle(-.45,.45,-1,1,.08)
vias = [
Via(-.35, .9,circle(0,0,.05)),
Via( .35, .9,circle(0,0,.05)),
Via(-.35,-.9,circle(0,0,.05)),
Via( .35,-.9,circle(0,0,.05))
]
def bot_chamfered_rectangle(x0,x1,y0,y1,c):
r = rectangle(x0,x1,y0,y1)
c1 = triangle(x0,y0,x0,y0+c,x0+c,y0)
c2 = triangle(x1,y1, x1, y1-c, x1-c, y1)
c3 = triangle(x0,y1, x0+c, y1, x0, y1-c)
c4 = triangle(x1,y0, x1-c, y0, x1, y0+c)
return r-c2-c3
class cap_UWT(Component):
'''UWT series aluminum smd cap
http://nichicon-us.com/english/products/pdfs/e-uwt.pdf
'''
_d = 8 #mm, diameter
_h = 10.5 #mm, height
_a = 2.9/25.4
_e = 3.1/25.4
_h = 1./25.4 + 2/25.4
_pad = rectangle(-_h/2,_h/2,-_a/2-.03,_a/2+.03)
pins = [Pin(0,-(_e+_a)/2-.01,_pad,'-',label_size=.08),Pin(0,(_e+_a)/2+.01,_pad,'+',label_size=.08)]
vias = []
shadow = bot_chamfered_rectangle(-4/25.4,4/25.4,-4/25.4,4/25.4,1/25.4)
class CR20XX(Component):
#coin cell battery, e.g. 2032
pins = [
Pin(0,0,circle(0,0,5./25.4),'-')
]
shadow = circle(0,0,10./25.4)
vias = []
class AAA(Component):
#AAA battery smd holder
pad = chamfered_rectangle(-.125,.125,-.12,.12,.05)
pins = [
Pin(1.21-.125,0,pad,'+',label_size=.08),
Pin(-1.21+.125,0,pad,'-',label_size=.08),
]
shadow = rectangle(-1.07,1.07,-.25,.25)
vias = [
Via(-1.21+.25,.209,circle(0,0,.039))
]
class ATxmegaE5(Component):
_padh = chamfered_rectangle(-.025,.025,-.007,.007,.002)
_padv = chamfered_rectangle(-.007,.007,-.025,.025,.002)
c=.18
d = 0.8/25.4
names = [
'1 GND','PA4','PA3','PA2','PA1','PA0','PDI/DATA','RST/CLK',
'PC7','PC6','PC5','PC4','PC3','PC2','PC1','PC0',
'VCC','GND','PR1','PR0','PD7','PD6','PD5','PD4',
'PD3','PD2','PD1','PD0','PA7','PA6','PA5','AVCC'
]
pins = [Pin(-c,(3.5-i)*d,_padh,n,label_size=.025) for i,n in enumerate(names[:8])]
pins += [Pin((-3.5+i)*d,-c,_padv,n,label_size=.025,label_rot=-90) for i,n in enumerate(names[8:16])]
pins += [Pin(c,(-3.5+i)*d,_padh,n,label_size=.025) for i,n in enumerate(names[16:24])]
pins += [Pin((3.5-i)*d,c,_padv,n,label_size=.025,label_rot=-90) for i,n in enumerate(names[24:])]
vias = []
shadow = rectangle(-c+d,c-d,-c+d,c-d)
class ATxmega16A4U(Component):
_padh = chamfered_rectangle(-.024,.024,-.007,.007,.003)
_padv = chamfered_rectangle(-.007,.007,-.024,.024,.003)
c= 11/25.4/2.
d = 0.8/25.4
names = [
'PA5','PA6','PA7','PB0','PB1','PB2','PB3','GND','VCC','PC0','PC1',
'PC2','PC3','PC4','PC5','PC6','PC7','GND2','VCC2','PD0','PD1','PD2',
'PD3','PD4','PD5','PD6','PD7','PE0','PE1','GND3','VCC3','PE2','PE3',
'PDI/DATA','RST/CLK','PR0','PR1','GND4','AVCC','PA0','PA1','PA2','PA3','PA4'
]
n_side = 11
pins = [Pin(-c,(5-i)*d,_padh,n,label_size=.025) for i,n in enumerate(names[:n_side])]
pins += [Pin((-5+i)*d,-c,_padv,n,label_size=.025,label_rot=-90) for i,n in enumerate(names[n_side:2*n_side])]
pins += [Pin(c,(-5+i)*d,_padh,n,label_size=.025) for i,n in enumerate(names[2*n_side:3*n_side])]
pins += [Pin((5-i)*d,c,_padv,n,label_size=.025,label_rot=-90) for i,n in enumerate(names[3*n_side:])]
vias = []
shadow = rectangle(-c+d,c-d,-c+d,c-d)
class ADXL372Z_EVAL(Component):
names = ['VS','VIO','GND','INT2','INT1','CS','MISO','MOSI','SCLK','GND2']
w = .3
pad = rectangle(-.05,.05,-.025,.025)
pins = [Pin(-.5*w, .2-.1*i,pad,names[i]) for i in range(5)]
pins += [Pin(.5*w,-.2+.1*i,pad,names[i+5]) for i in range(5)]
vias = [
Via(7.5/25.4,7.5/25.4,circle(0,0,.055)),
Via(-7.5/25.4,7.5/25.4,circle(0,0,.055)),
Via(7.5/25.4,-7.5/25.4,circle(0,0,.055)),
Via(-7.5/25.4,-7.5/25.4,circle(0,0,.055))
]
vias = [Via(p.x,p.y,circle(0,0,.017)) for p in pins]
shadow = filleted_rectangle(-.405,.405,-.405,.405,.05)
class micro_sd_card(Component):
#molex WM12834CT-ND
names = ['X','CS','DI','VDD','CLK','VSS','DO','X']
pad = rectangle(-.62/25.4,.62/25.4,-.4/25.4,.4/25.4)
pitch = 1.1/25.4
pins = [ Pin(.62/25.4, 4.82/25.4+pitch*i, pad,names[i],label_size=.02) for i in range(8) ]
pins += [
Pin( 1.24/25.4,.48/25.4,rectangle(-1.25/25.4,1.25/25.4,-.48/25.4,.48/25.4)),
Pin( 1.1/25.4,14.84/25.4,rectangle(-1.1/25.4,1.1/25.4,-.6/25.4,.6/25.4)),
Pin(12.58/25.4,.58/25.4, rectangle(-1.1/25.4,1.1/25.4,-.58/25.4,.58/25.4)),
Pin(13.95/25.4-.62/25.4,4.88/25.4,rectangle(-.55/25.4,.55/25.4,-.75/25.4,.75/25.4)),
Pin(13.95/25.4-.62/25.4,12.66/25.4,rectangle(-.55/25.4,.55/25.4,-.75/25.4,.75/25.4))
]
vias = []
w = 13.95/25.4; h = 15.44/25.4
shadow = rectangle(-1.25/25.4, w, 0., h)
pins = [Pin(p.x-.5*w,p.y-.5*h,p.shape,p.name) for p in pins]
shadow = move(shadow,-.5*w,-.5*h)
class Hole(Component):
pins = [Pin(0,0,circle(0,0,0.01))]
vias = [Via(0,0,circle(0,0,.5*2.1/25.4))]
tap = circle(0,0,.5*1.9/25.5)
width = 1.5
height = 1.
pcb = PCB(0,0,width,height,chamfer_distance=.05)
board = circle(0,0,1.5)
holes = circle(0,1.5-.25,2.1/25.4)
holes += rotate(holes,90) + rotate(holes,180) + rotate(holes,-90)
holes = rotate(holes,45)
pcb.custom_cutout = board-holes
pcb.custom_cutout = filleted_rectangle(-1.2,.8,-.48,.48,.1)
def connectG(pin,dx,dy,width=.014):
'''
Convenience function for connecting to ground plane
'''
pcb.connectD(pin,[pin.x+dx,pin.y+dy],[pin.x+dx-.0001,pin.y+dy],width=width,sides=[0,1,1])
def connectS(pin,dx,dy,width=.014):
pcb.connectD(pin,[pin.x+dx+.0001,pin.y+dy],width=width)
def connectM(pin1,pin2,dx,width=.014):
pcb.connectD(pin1,[pin1.x+dx,pin1.y],pin2,width=width)
#pcb.custom_cutout = chamfered_rectangle(0,width,.5*height-.25,.5*height+.25,.05)
#pcb.custom_cutout += chamfered_rectangle(0,.6*width,0,height,.12)
f = feather(-.2,0,90,'feather')
pcb += f
#ADXL372
adxl = ADXL372Z_EVAL(0,0,0,'adxl372')
#pcb.custom_cutout = adxl.shadow
pcb += adxl
pcb.connectD(adxl['MISO'],[adxl['MISO'].x-.05,adxl['MISO'].y+.0],[f['MISO'].x-.19,f['MISO'].y+.18],[f['MISO'].x-.03,f['MISO'].y+.14],f['MISO'])
pcb.connectD(adxl['MOSI'],[adxl['MOSI'].x-.05,adxl['MOSI'].y],[f['MOSI'].x-.16,f['MOSI'].y+.15],f['MOSI'])
pcb.connectD(adxl['SCLK'],[adxl['SCLK'].x-.05,adxl['SCLK'].y],[f['SCK'].x-.11,f['SCK'].y+.17],f['SCK'])
pcb.connectD(adxl['GND'],[adxl['GND'].x+.05,adxl['GND'].y],adxl['GND2'],width=.03)
pcb.connectD(f['GND'],[f['GND'].x,f['GND'].y+.05],adxl['GND'],width=.03)
pcb.connectD(f['3V3'],[f['3V3'].x,f['3V3'].y+.05],adxl['VIO'],width=.03)
pcb.connectV(adxl['VIO'],adxl['VS'],width=.03)
pcb.connectD(f['A1'],[f['A1'].x,f['A1'].y+.05],adxl['INT2'])
pcb.connectD(adxl['INT1'],[adxl['INT1'].x,adxl['INT1'].y-.05],[f['A5'].x-.02,f['A5'].y],f['A5'])
pcb.connectD(f['6'],[f['6'].x,f['6'].y-.08],[adxl['CS'].x+.1,adxl['CS'].y+.05],adxl['CS'])
cad.shapes = pcb.layout()
#cad.shape = pcb.traces+(pcb.cutout-pcb.cutout)
#cad.shape = pcb.cutout+(pcb.traces-pcb.traces)
#cad.shape = pcb.custom_layers['wj']['layer']
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment