Commit 8443680a authored by Sam Calisch's avatar Sam Calisch
Browse files

added cut files for raytac test

parent d9e79479
...@@ -20,18 +20,33 @@ class TagConnectPDI(Component): ...@@ -20,18 +20,33 @@ class TagConnectPDI(Component):
Via(.1,-.04,_via), Via(.1,-.04,_via),
] ]
class Button(Component):
''' SW262CT-ND
'''
rect = rectangle(-.75/25.4,.75/25.4,-.5/25.4,.5/25.4)
pins = [
Pin(-2/25.4,.8/25.4,rect),
Pin( 2/25.4,.8/25.4,rect),
Pin(-2/25.4,-.8/25.4,rect),
Pin( 2/25.4,-.8/25.4,rect)
]
prefix = 'button'
vias = []
shadow = rectangle(-2.1/25.4,2.1/25.4,-1.4/25.4,1.4/25.4)
class TagConnectSWD(Component): class TagConnectSWD(Component):
''' '''
''' '''
_pad = s2d.circle(0,0,.5*.031) _pad = s2d.circle(0,0,.5*.031)
_via = s2d.circle(0,0,.5*.039) _via = s2d.circle(0,0,.5*.039)
pins = [ pins = [
Pin(-.05,-.025,_pad,'SWDIO',label_size=.015), Pin(-.05,-.025,_pad,'GND',label_size=.012),
Pin( .00,-.025,_pad,'NC',label_size=.015), Pin( .00,-.025,_pad,'NC',label_size=.012),
Pin( .05,-.025,_pad,'SWCLK',label_size=.015), Pin( .05,-.025,_pad,'VCC',label_size=.012),
Pin(-.05,.025,_pad,'VCC',label_size=.015), Pin(-.05,.025,_pad,'RST',label_size=.012),
Pin( .00,.025,_pad,'NC',label_size=.015), Pin( .00,.025,_pad,'SWDCLK',label_size=.012),
Pin( .05,.025,_pad,'GND',label_size=.015) Pin( .05,.025,_pad,'SWDIO',label_size=.012)
] ]
vias = [ vias = [
Via(-.1,0,_via), Via(-.1,0,_via),
...@@ -70,19 +85,29 @@ class Header_FTDI(Component): ...@@ -70,19 +85,29 @@ class Header_FTDI(Component):
''' '''
_pad_header = chamfered_rectangle(-0.06, 0.08,-0.035, 0.035,.007) _pad_header = chamfered_rectangle(-0.06, 0.08,-0.035, 0.035,.007)
pins = [ pins = [
#Pin(0, -0.25, _pad_header, 'RTS'), Pin(0, 0.25, _pad_header, 'RTS'),
Pin(0, -0.15, _pad_header, 'RX'), Pin(0, 0.15, _pad_header, 'RX'),
Pin(0, -0.05, _pad_header, 'TX'), Pin(0, 0.05, _pad_header, 'TX'),
Pin(0, 0.05, _pad_header, 'VCC'), Pin(0, -0.05, _pad_header, 'VCC'),
Pin(0, 0.15, _pad_header, 'CTS'), Pin(0, -0.15, _pad_header, 'CTS'),
Pin(0, 0.25, _pad_header, 'GND') Pin(0, -0.25, _pad_header, 'GND')
] ]
prefix = 'J' prefix = 'J'
vias = [] vias = []
#shadow = s2d.rectangle(-.06,8/25.4,-.3,.3) shadow = s2d.rectangle(-.06,8/25.4,-.3,.3)
shadow = s2d.rectangle(-.06,8/25.4,-.2,.3) #shadow = s2d.rectangle(-.06,8/25.4,-.3,.2)
class Header_Daughter(Component):
''' FTDI cable header
'''
_pad_header = chamfered_rectangle(-0.03, 0.03,-0.015, 0.015,.002)
labels=['SDA','SCL','A4','A5']
pins = [ Pin(0,.05*(i-1.5),_pad_header,l) for i,l in enumerate(labels)]
prefix = 'J'
vias = [Via(p.x,p.y,circle(0,0,.017)) for p in pins]
shadow = s2d.rectangle(-.03,.03,-.1,.1)
def bot_chamfered_rectangle(x0,x1,y0,y1,c): def bot_chamfered_rectangle(x0,x1,y0,y1,c):
r = rectangle(x0,x1,y0,y1) r = rectangle(x0,x1,y0,y1)
c1 = triangle(x0,y0,x0,y0+c,x0+c,y0) c1 = triangle(x0,y0,x0,y0+c,x0+c,y0)
...@@ -114,27 +139,27 @@ class AAA(Component): ...@@ -114,27 +139,27 @@ class AAA(Component):
class MDBT42(Component): class MDBT42(Component):
#Raytach nrf52 module #Raytach nrf52 module
p = .7/25.4 p = .7/25.4
pad_hw = .2/25.4 pad_hw = .15/25.4
pad_hh = .8/25.4 pad_hh = .8/25.4
_padv = rectangle(-pad_hw,pad_hw,-pad_hh,pad_hh) _padv = rectangle(-pad_hw,pad_hw,-pad_hh,pad_hh)
_padh = rectangle(-pad_hh,pad_hh,-pad_hw,pad_hw) _padh = rectangle(-pad_hh,pad_hh,-pad_hw,pad_hw)
_padg = rectangle(-pad_hh,pad_hh,-.3/25.4,.3/25.4) _padg = rectangle(-pad_hh,pad_hh,-.35/25.4,.4/25.4)
c= 4.4/25.4 c= 5/25.4
start_y = 10.3/25.4 start_y = 11.8/25.4
start_x = .55/25.4 start_x = .8/25.4
y_os = .25 y_os = .25
names = [ names = [
'GND1','P23','P22','SWCLK','SWDIO','RESET','P18','P17','P15','P13','P12','P10','P9', 'GND1','SDA','SCL','P27','A4','A5','A6','A7','DEC4','DCC','VDD',
'GND2','VDD','P8','P6','P7','P5','XL1','XL2','P4','P3','P2','GND3', 'GND2','XL1','XL2','P2','P3','P4','P5','P6','P7','P8','P9','P10','GND3',
'DCC','DEC4','P31','P27','P25','P30','P29','P28','P11','P26','P19','GND4' 'P11','P12','P13','P14','P15','P16','P17','P18','P19','P20','RESET','SWDCLK','SWDIO','P22','GND4'
] ]
pins = [Pin(-c,start_y-y_os,_padg,n,label_size=.018) for i,n in enumerate(names[:1])] pins = [Pin(-c,start_y-y_os,_padg,n,label_size=.018) for i,n in enumerate(names[:1])]
pins += [Pin(-c,start_y-.8/25.4-i*p-y_os,_padh,n,label_size=.018) for i,n in enumerate(names[1:13])] pins += [Pin(-c,start_y-3./25.4-i*p-y_os,_padh,n,label_size=.018) for i,n in enumerate(names[1:11])]
pins += [Pin(-c+start_x+i*p,-y_os,_padv,n,label_size=.018,label_rot=-90) for i,n in enumerate(names[13:25])] pins += [Pin(-c+start_x+i*p,-y_os,_padv,n,label_size=.018,label_rot=-90) for i,n in enumerate(names[11:24])]
pins += [Pin(c,start_y-1.5/25.4-i*p-y_os,_padh,n,label_size=.018) for i,n in enumerate(names[25:36][::-1])] pins += [Pin(c,start_y-.9/25.4-i*p-y_os,_padh,n,label_size=.018) for i,n in enumerate(names[24:38][::-1])]
pins += [Pin(c,start_y-y_os,_padg,n,label_size=.018) for i,n in enumerate(names[36:37])] pins += [Pin(c,start_y-y_os,_padg,n,label_size=.018) for i,n in enumerate(names[38:])]
vias = [] vias = []
shadow = rectangle(-c,c,-y_os,start_y+3.5/25.4-y_os) shadow = rectangle(-c,c,-y_os,start_y+4.2/25.4-y_os)
class BT832(Component): class BT832(Component):
...@@ -181,38 +206,46 @@ class Hole(Component): ...@@ -181,38 +206,46 @@ class Hole(Component):
width = 1. width = 1.
height = .83 height = .75
pcb = PCB(0,0,width,height,chamfer_distance=.05) pcb = PCB(0,0,width,height,chamfer_distance=.03)
def connectG(pin,dx,dy,width=.014): def connectG(pin,dx,dy,width=.012):
''' '''
Convenience function for connecting to ground plane 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]) 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): def connectS(pin,dx,dy,width=.012):
pcb.connectD(pin,[pin.x+dx+.0001,pin.y+dy],width=width) pcb.connectD(pin,[pin.x+dx+.0001,pin.y+dy],width=width)
def connectM(pin1,pin2,dx,width=.014): def connectM(pin1,pin2,dx,width=.012):
pcb.connectD(pin1,[pin1.x+dx,pin1.y],pin2,width=width) pcb.connectD(pin1,[pin1.x+dx,pin1.y],pin2,width=width)
ftdi = Header_FTDI(.2,.38,180,'ftdi') ftdi = Header_FTDI(.2,.3,180,'ftdi')
pcb += ftdi pcb += ftdi
reg = Regulator_SOT23(ftdi.x+.13,ftdi.y-.25,180,'3.3v') reg = Regulator_SOT23(ftdi.x+.08,ftdi['GND'].y+.14,0,'3.3v')
pcb += reg pcb += reg
pcb.connectV(reg['GND'],ftdi['GND']) pcb.connectV(ftdi['GND'],[ftdi['GND'].x-.08,ftdi['GND'].y],reg['GND'])
pcb.connectD(ftdi['VCC'],[ftdi['VCC'].x+.03,ftdi['VCC'].y],[reg['IN'].x-.09,reg['IN'].y],reg['IN']) pcb.connectD(ftdi['VCC'],[ftdi['VCC'].x+.045,ftdi['VCC'].y],[ftdi['VCC'].x+.085,reg['IN'].y-.02],reg['IN'])
C_in = C_0805(reg.x-.13,reg.y-.06,180,'Cin\n.1uF',label_size=.02)
pcb += C_in
C_out = C_0805(C_in.x-.09,reg.y-.0,90,'Cout\n.1uF',label_size=.02)
pcb += C_out
pcb.connectH(C_in[0],C_out[1])
pcb.connectH(reg['IN'],C_in[1],width=.02)
pcb.connectH(reg['OUT'],C_out[0],width=.02)
#todo: #todo:
#decoupling caps on regulator
#button reset #button reset
#route analog inputs? #route analog inputs?
mdb = MDBT42(ftdi.x+.55,ftdi.y,-90,'Raytach\nMDBT42Q\nNRF52') mdb = MDBT42(ftdi.x+.57,ftdi.y+.1,-90,'Raytac\nMDBT42Q\nNRF52')
pcb += mdb pcb += mdb
#bt = BT832(1.5,1.2,0,'Fanstel\nBT832\nNRF52') #bt = BT832(1.5,1.2,0,'Fanstel\nBT832\nNRF52')
...@@ -220,48 +253,82 @@ pcb += mdb ...@@ -220,48 +253,82 @@ pcb += mdb
#bc = BC832(.6,1.2,-90,'Fanstel\nBC832\nNRF52') #bc = BC832(.6,1.2,-90,'Fanstel\nBC832\nNRF52')
#pcb += bc #pcb += bc
pcb.connectV(ftdi['TX'],mdb['P6'],width=.014) pcb.connectD(ftdi['TX'],[ftdi['TX'].x+.06,ftdi['TX'].y],mdb['P6'],width=.012)
pcb.connectD(ftdi['RX'],[ftdi['RX'].x+.04,ftdi['RX'].y],mdb['P8'],width=.014) pcb.connectD(ftdi['RX'],[ftdi['RX'].x+.03,ftdi['RX'].y],mdb['P8'],width=.012)
swd = TagConnectSWD(mdb.x+.07,mdb.y+.3,0,'swd') swd = TagConnectSWD(mdb.x+.07,mdb.y-.335,0,'swd')
pcb += swd pcb += swd
pcb.connectD(swd['SWCLK'],mdb['SWCLK'],width=.014) pcb.connectD(swd['RST'],[swd['RST'].x,swd['RST'].y+.02],[mdb['RESET'].x-.02,mdb['RESET'].y-.06],mdb['RESET'],width=.012)
pcb.connectD(swd['SWDIO'],mdb['SWDIO'],width=.014) pcb.connectD(swd['SWDCLK'],[swd['SWDCLK'].x,swd['SWDCLK'].y+.005],mdb['SWDCLK'],width=.012)
pcb.connectD(swd['SWDIO'],[swd['SWDIO'].x,swd['SWDIO'].y+.015],mdb['SWDIO'],width=.012)
pcb.connectD(swd['VCC'],[swd['VCC'].x-.25,swd['VCC'].y+.03],[mdb['VDD'].x-.13,mdb['VDD'].y+.03],mdb['VDD'],width=.014) C2 = C_0805(reg.x+.12,reg.y-.01,0,'C2\n10uF',label_size=.02)
pcb += C2
pcb.connectD(C2[1],reg['GND'])
pcb.connectD(C2[0],[C2[0].x+.01,C2[0].y-.015],mdb['VDD'],width=.012)
pcb.connectD(C2[0],[C2[0].x,C2[0].y+.04],[reg['OUT'].x+.02,reg['OUT'].y+.005],reg['OUT'])
pcb.connectD(mdb['GND3'],[mdb['GND3'].x,mdb['GND3'].y-.03],reg['GND']) pcb.connectD(C2[1],[C2[1].x,C2[1].y-.02],[C2[1].x+.085,C2[1].y-.05],mdb['GND2'],width=.012)
pcb.connectD(reg['OUT'],[ftdi.x-.1,ftdi['GND'].y-.06],[ftdi.x-.12,ftdi['RX'].y+.04],[ftdi.x+.08,ftdi['RX'].y+.06],mdb['VDD'],width=.014)
x1 = Crystal_FC135(mdb.x-.34,mdb.y-.02,90,'X1\n32.768',label_size=.025)
x1 = Crystal_FC135(mdb.x-.352,mdb.y+.085,90,'X1\n32.768',label_size=.025)
pcb += x1 pcb += x1
cx1 = C_0805(x1.x-.08,x1.y,90,'CX1\n22pF',label_size=.02) cx1 = C_0805(x1.x-.045,x1.y+.095,0,'CX1\n22pF',label_size=.02)
cx2 = C_0805(x1.x-.03,x1.y-.1,0,'CX2\n22pF',label_size=.02) cx2 = C_0805(x1.x-.08,x1.y-.0,90,'CX2\n22pF',label_size=.02)
pcb += cx1 pcb += cx1
pcb += cx2 pcb += cx2
pcb.connectD(x1[0],mdb['XL1'],width=.014) pcb.connectV(x1[0],mdb['XL1'],width=.012)
pcb.connectD(x1[1],mdb['XL2'],width=.014) pcb.connectD(x1[1],[x1[1].x+.03,x1[1].y],[mdb['XL2'].x-.055,mdb['XL2'].y-.015],mdb['XL2'],width=.012)
pcb.connectV(cx2[1],cx1[1]) pcb.connectV(cx2[0],cx1[1])
pcb.connectV(x1[0],cx1[0]) pcb.connectV(x1[0],cx1[0])
pcb.connectV(x1[1],cx2[0]) pcb.connectV(x1[1],cx2[1])
pcb.connectV(cx2[1],[mdb['GND3'].x,mdb['GND3'].y-.02],mdb['GND3']) pcb.connectD(reg['GND'],[reg['GND'].x,reg['GND'].y-.02],cx1[1])
L1 = R_0805(mdb.x-.19,mdb.y-.245,0,'L1 10uH',label_size=.02) L1 = R_0805(mdb.x-.1,mdb.y+.29,0,'L1 10uH',label_size=.02)
pcb += L1 pcb += L1
pcb.connectD(L1[1],[L1[1].x,L1[1].y+.02],mdb['DCC'],width=.014) pcb.connectD(L1[1],[L1[1].x+.0,L1[1].y],mdb['DCC'],width=.012)
pcb.connectD(L1[0],mdb['DEC4'],width=.014) pcb.connectD(L1[0],mdb['DEC4'],width=.012)
C1 = R_0805(L1.x,L1.y-.07,0,'C1 1 uF',label_size=.02) C1 = C_0805(L1.x-.105,L1.y-.005,90,'C1 1 uF',label_size=.02)
pcb += C1 pcb += C1
pcb.connectV(L1[0],C1[0]) pcb.connectV(L1[0],[C1[0].x,C1[0].y+.015],C1[0])
pcb.connectD(C1[1],[C1[1].x-.04,C1[1].y+.01],reg['GND']) ##pcb.connectD(C1[1],[C1[1].x-.02,C1[1].y+.01],reg['GND'])
connectG(mdb['GND2'],-.06,.02) connectG(C_in[0],-.025,-.03)
connectG(mdb['GND3'],-.05,-.05) connectG(C2[1],-.02,-.045)
connectG(mdb['GND4'],0,-.08) connectG(C1[1],-0.04,.01)
pcb.connectD(mdb['GND1'],[mdb['GND1'].x+.06,mdb['GND1'].y+.2],[swd['GND'].x+.02,swd['GND'].y+.06],swd['GND'])
connectG(swd['GND'],-0.01,.06)
button = Button(swd.x-.25,swd.y,0,'reset')
pcb += button
pcb.connectD(swd['RST'],[swd['RST'].x-.01,swd['RST'].y+.01],[button[2].x,button[2].y+.02],button[2],width=.012)
pcb.connectD(swd['GND'],[button[4].x,button[4].y-.02],button[4])
pcb.connectH(button[3],button[4])
pcb.connectH(button[1],button[2])
#pcb.connectH(C2[0],[C2[0].x-.015,button[2].y],button[2])
R1 = R_0805(mdb.x-.35,mdb.y-.19,90,'R1\n10k',label_size=.02)
pcb += R1
pcb.connectV(mdb['VDD'],mdb['P9'],width=.012)
pcb.connectD(R1[0],mdb['P9'],width=.012)
pcb.connectD(R1[1],button[1],width=.012)
#grounds
connectG(mdb['GND3'],-.03,-.04)
connectG(mdb['GND1'],-0.04,.03)
connectG(mdb['GND4'],-0.005,-.065)
connectG(button[3],-.05,0)
#header
h1 = Header_Daughter(mdb.x+.07,mdb.y+.32,90,'h1')
pcb += h1
pcb.connectD(mdb['A5'],[mdb['A5'].x,mdb['A5'].y+.08],h1['A5'],width=.012)
pcb.connectD(mdb['A4'],[mdb['A4'].x,mdb['A4'].y+.06],h1['A4'],width=.012)
pcb.connectD(mdb['SCL'],[mdb['SCL'].x,mdb['SCL'].y+.06],h1['SCL'],width=.012)
pcb.connectD(mdb['SDA'],[mdb['SDA'].x,mdb['SDA'].y+.04],h1['SDA'],width=.012)
cad.shapes = pcb.layout() cad.shapes = pcb.layout()
#cad.shape = pcb.traces+(pcb.cutout-pcb.cutout) #cad.shape = pcb.traces+(pcb.cutout-pcb.cutout)
......
Supports Markdown
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