aj0070/scope-frontend
A 4-layer dual-channel oscilloscope analog front end with BNC inputs, relay-selectable AC/DC coupling and attenuation, FET buffers, programmable VGAs, differential ADC drivers, dual 8-bit ADCs with 25 MHz clock, power conversion/LDOs, and control/data headers.
- Version
- 1.0.0
- License
- unset
- Stars
- 0
Use with the tscircuit CLI
tsci is the tscircuit CLI. Install it with npm install -g tscircuit.
tsci clone aj0070/scope-frontend # download the package files into ./scope-frontend
tsci add aj0070/scope-frontend # add it to your project as @tsci/aj0070.scope-frontendIn a cloned or new (tsci init) project: tsci dev starts a local preview, tsci build outputs Circuit JSON, and tsci push publishes to tscircuit.com.
src/adc.tsx
import React from "react"
import { AD9288BSTZ_80 } from "../imports/AD9288BSTZ_80"
import { SiT8008BI_21_33E_25_000000 } from "../imports/SiT8008BI_21_33E_25_000000"
import { THS4522IPWR } from "../imports/THS4522IPWR"
const DATA_A = ["DA0", "DA1", "DA2", "DA3", "DA4", "DA5", "DA6", "DA7"]
const DATA_B = ["DB0", "DB1", "DB2", "DB3", "DB4", "DB5", "DB6", "DB7"]
export function adcParts() {
return (
<>
{/* Single ended to differential converter for both channels */}
<THS4522IPWR name="U5" pcbX={1.5} pcbY={0} schSheetName="ADC" schX={-9} schY={3} />
<trace from="U5.VS1_POS" to="net.P5VA" />
<trace from="U5.VS2_POS" to="net.P5VA" />
<trace from="U5.VS_NEG1" to="net.GND" />
<trace from="U5.VS_NEG2" to="net.GND" />
<trace from="U5.N_PD1" to="net.P5VA" />
<trace from="U5.N_PD2" to="net.P5VA" />
<trace from="U5.VOCM1" to="net.VMID25" />
<trace from="U5.VOCM2" to="net.VMID25" />
{/* channel A diff network, gain 1 */}
<resistor name="R301" resistance="200" footprint="0402" pcbX={-4} pcbY={5} schSheetName="ADC" schX={-14.59} schY={-3} />
<resistor name="R302" resistance="200" footprint="0402" pcbX={-2} pcbY={5} schSheetName="ADC" schX={-12.35} schY={-3} schRotation={270} />
<resistor name="R303" resistance="200" footprint="0402" pcbX={0} pcbY={5} schSheetName="ADC" schX={-10.47} schY={-3} />
<resistor name="R304" resistance="200" footprint="0402" pcbX={2} pcbY={5} schSheetName="ADC" schX={-8.59} schY={-3} />
<trace from="R301.pin1" to="net.CHA_DIF" />
<trace from="R301.pin2" to="U5.VIN1_POS" />
<trace from="R302.pin1" to="U5.VIN1_NEG" />
<trace from="R302.pin2" to="net.GND" />
<trace from="R303.pin1" to="U5.VOUT1_NEG" />
<trace from="R303.pin2" to="U5.VIN1_POS" />
<trace from="R304.pin1" to="U5.VOUT1_POS" />
<trace from="R304.pin2" to="U5.VIN1_NEG" />
{/* channel B diff network, gain 1 */}
<resistor name="R305" resistance="200" footprint="0402" pcbX={-6} pcbY={-5} schSheetName="ADC" schX={-14.59} schY={-6} />
<resistor name="R306" resistance="200" footprint="0402" pcbRotation={180} pcbX={-4} pcbY={-5} schSheetName="ADC" schX={-12.35} schY={-6} schRotation={270} />
<resistor name="R307" resistance="200" footprint="0402" pcbRotation={180} pcbX={-2} pcbY={-5} schSheetName="ADC" schX={-10.47} schY={-6} />
<resistor name="R308" resistance="200" footprint="0402" pcbX={0} pcbY={-5} schSheetName="ADC" schX={-8.59} schY={-6} />
<trace from="U5.VOUT1_POS" to="net.CHA_DIFP" />
<trace from="U5.VOUT1_NEG" to="net.CHA_DIFN" />
<trace from="U5.VOUT2_POS" to="net.CHB_DIFP" />
<trace from="U5.VOUT2_NEG" to="net.CHB_DIFN" />
<trace from="R305.pin1" to="net.CHB_DIF" />
<trace from="R305.pin2" to="U5.VIN2_POS" />
<trace from="R306.pin1" to="U5.VIN2_NEG" />
<trace from="R306.pin2" to="net.GND" />
<trace from="R307.pin1" to="U5.VOUT2_NEG" />
<trace from="R307.pin2" to="U5.VIN2_POS" />
<trace from="R308.pin1" to="U5.VOUT2_POS" />
<trace from="R308.pin2" to="U5.VIN2_NEG" />
<capacitor name="C301" capacitance="100nF" footprint="0402" pcbX={4} pcbY={5} schSheetName="ADC" schX={-8.5} schY={-2} schRotation={270} />
<capacitor name="C302" capacitance="100nF" footprint="0402" pcbRotation={180} pcbX={6} pcbY={5} schSheetName="ADC" schX={-7} schY={-2} schRotation={270} />
<trace from="C301.pin1" to="net.P5VA" />
<trace from="C301.pin2" to="net.GND" />
<trace from="C302.pin1" to="net.P5VA" />
<trace from="C302.pin2" to="net.GND" />
{/* 2.5 V mid rail for the single ended to differential stage */}
<resistor name="R309" resistance="10k" footprint="0402" pcbX={8} pcbY={5} schSheetName="ADC" schX={-7.5} schY={-1} />
<resistor name="R310" resistance="10k" footprint="0402" pcbX={10} pcbY={5} schSheetName="ADC" schX={-6} schY={-1} schRotation={270} />
<capacitor name="C305" capacitance="100nF" footprint="0402" pcbX={12} pcbY={5} schSheetName="ADC" schX={-4.5} schY={-1} schRotation={270} />
<trace from="R309.pin1" to="net.P5VA" />
<trace from="R309.pin2" to="net.VMID25" />
<trace from="R310.pin1" to="net.VMID25" />
<trace from="R310.pin2" to="net.GND" />
<trace from="C305.pin1" to="net.VMID25" />
<trace from="C305.pin2" to="net.GND" />
{/* ADC driver for both channels, gain 1, VCM from the ADC reference */}
<THS4522IPWR name="U6" pcbX={13} pcbY={0} schSheetName="ADC" schX={0} schY={3} />
<trace from="U6.VS1_POS" to="net.P5VA" />
<trace from="U6.VS2_POS" to="net.P5VA" />
<trace from="U6.VS_NEG1" to="net.GND" />
<trace from="U6.VS_NEG2" to="net.GND" />
<trace from="U6.N_PD1" to="net.P5VA" />
<trace from="U6.N_PD2" to="net.P5VA" />
<trace from="U6.VOCM1" to="net.VREF125" />
<trace from="U6.VOCM2" to="net.VREF125" />
<capacitor name="C312" capacitance="100nF" footprint="0402" pcbX={2.8} pcbY={7} schSheetName="ADC" schX={-5.5} schY={-2} schRotation={270} />
<capacitor name="C313" capacitance="100nF" footprint="0402" pcbX={4.9} pcbY={7} schSheetName="ADC" schX={-4} schY={-2} schRotation={270} />
<trace from="C312.pin1" to="net.P5VA" />
<trace from="C312.pin2" to="net.GND" />
<trace from="C313.pin1" to="net.P5VA" />
<trace from="C313.pin2" to="net.GND" />
{/* channel A: AC coupling from VGA, then gain-1 FDA */}
<capacitor name="C310" capacitance="100nF" footprint="0402" pcbX={7.0} pcbY={7} schSheetName="ADC" schX={0.81} schY={-1} schRotation={270} />
<capacitor name="C311" capacitance="100nF" footprint="0402" pcbX={9.1} pcbY={7} schSheetName="ADC" schX={1.69} schY={-3} schRotation={270} />
<trace from="C310.pin1" to="net.VGA_A_OUTP" />
<trace from="C310.pin2" to="net.ADCA_IP" />
<trace from="C311.pin1" to="net.VGA_A_OUTN" />
<trace from="C311.pin2" to="net.ADCA_IN" />
<resistor name="R311" resistance="200" footprint="0402" pcbX={11.2} pcbY={7} schSheetName="ADC" schX={2.29} schY={-1} />
<resistor name="R312" resistance="200" footprint="0402" pcbX={13.3} pcbY={7} schSheetName="ADC" schX={4.05} schY={-1} />
<resistor name="R313" resistance="200" footprint="0402" pcbX={15.4} pcbY={7} schSheetName="ADC" schX={6.91} schY={-1} />
<resistor name="R314" resistance="200" footprint="0402" pcbX={17.5} pcbY={7} schSheetName="ADC" schX={8.55} schY={-1} />
<trace from="R311.pin1" to="net.ADCA_IP" />
<trace from="R311.pin2" to="U6.VIN1_POS" />
<trace from="R312.pin1" to="net.ADCA_IN" />
<trace from="R312.pin2" to="U6.VIN1_NEG" />
<trace from="R313.pin1" to="U6.VOUT1_NEG" />
<trace from="R313.pin2" to="U6.VIN1_POS" />
<trace from="R314.pin1" to="U6.VOUT1_POS" />
<trace from="R314.pin2" to="U6.VIN1_NEG" />
<trace from="U6.VOUT1_POS" to="net.ADCA_P" />
<trace from="U6.VOUT1_NEG" to="net.ADCA_N" />
{/* channel B: AC coupling from VGA, then gain-1 FDA */}
<capacitor name="C314" capacitance="100nF" footprint="0402" pcbX={7.0} pcbY={-7} schSheetName="ADC" schX={0.5} schY={-5} schRotation={270} />
<capacitor name="C315" capacitance="100nF" footprint="0402" pcbX={9.1} pcbY={-7} schSheetName="ADC" schX={1.92} schY={-7} schRotation={270} />
<trace from="C314.pin1" to="net.VGA_B_OUTP" />
<trace from="C314.pin2" to="net.ADCB_IP" />
<trace from="C315.pin1" to="net.VGA_B_OUTN" />
<trace from="C315.pin2" to="net.ADCB_IN" />
<resistor name="R315" resistance="200" footprint="0402" pcbX={11.2} pcbY={-7} schSheetName="ADC" schX={5.9} schY={-5} />
<resistor name="R316" resistance="200" footprint="0402" pcbX={13.3} pcbY={-7} schSheetName="ADC" schX={2.6} schY={-5} />
<resistor name="R317" resistance="200" footprint="0402" pcbRotation={180} pcbX={15.4} pcbY={-7} schSheetName="ADC" schX={8.2} schY={-5} />
<resistor name="R318" resistance="200" footprint="0402" pcbRotation={180} pcbX={17.5} pcbY={-7} schSheetName="ADC" schX={9.87} schY={-5} />
<trace from="R315.pin1" to="net.ADCB_IP" />
<trace from="R315.pin2" to="U6.VIN2_POS" />
<trace from="R316.pin1" to="net.ADCB_IN" />
<trace from="R316.pin2" to="U6.VIN2_NEG" />
<trace from="R317.pin1" to="U6.VOUT2_NEG" />
<trace from="R317.pin2" to="U6.VIN2_POS" />
<trace from="R318.pin1" to="U6.VOUT2_POS" />
<trace from="R318.pin2" to="U6.VIN2_NEG" />
<trace from="U6.VOUT2_POS" to="net.ADCB_P" />
<trace from="U6.VOUT2_NEG" to="net.ADCB_N" />
<capacitor name="C318" capacitance="10uF" footprint="0805" pcbX={14} pcbY={10} schSheetName="ADC" schX={-2.5} schY={-2} schRotation={270} />
<trace from="C318.pin1" to="net.P5VA" />
<trace from="C318.pin2" to="net.GND" />
{/* dual 8-bit ADC */}
<AD9288BSTZ_80
name="U7"
pcbX={22.5}
pcbY={0}
noConnect={["NC1", "NC2", "NC3", "NC4"]}
pinAttributes={{
GND1: { requiresGround: true },
GND2: { requiresGround: true },
GND3: { requiresGround: true },
GND4: { requiresGround: true },
GND5: { requiresGround: true },
GND6: { requiresGround: true },
GND7: { requiresGround: true },
GND8: { requiresGround: true },
VDD1: { requiresPower: true },
VDD2: { requiresPower: true },
VDD3: { requiresPower: true },
VDD4: { requiresPower: true },
VD1: { requiresPower: true },
VD2: { requiresPower: true },
VD3: { requiresPower: true },
VD4: { requiresPower: true },
ENCA: { mustBeConnected: true },
ENCB: { mustBeConnected: true },
REFINA: { mustBeConnected: true },
REFOUT: { mustBeConnected: true },
S1: { mustBeConnected: true },
S2: { mustBeConnected: true },
DFS: { mustBeConnected: true },
} as any}
schSheetName="ADC"
schX={8.96}
schY={3}
schWidth={2.2}
schHeight={5}
/>
<trace from="U7.AINA" to="net.ADCA_P" />
<trace from="U7.N_AINA" to="net.ADCA_N" />
<trace from="U7.AINB" to="net.ADCB_P" />
<trace from="U7.N_AINB" to="net.ADCB_N" />
<trace from="U7.ENCA" to="net.CLK25" />
<trace from="U7.ENCB" to="net.CLK25" />
<trace from="U7.S1" to="net.GND" />
<trace from="U7.S2" to="net.GND" />
<trace from="U7.DFS" to="net.GND" />
<trace from="U7.REFINA" to="net.VREF125" />
<trace from="U7.REFOUT" to="net.VREF125" />
<capacitor name="C320" capacitance="100nF" footprint="0402" pcbX={19} pcbY={9.5} schSheetName="ADC" schX={6.78} schY={0} schRotation={270} />
<trace from="C320.pin1" to="net.VREF125" />
<trace from="C320.pin2" to="net.GND" />
<trace from="U7.GND1" to="net.GND" />
<trace from="U7.GND2" to="net.GND" />
<trace from="U7.GND3" to="net.GND" />
<trace from="U7.GND4" to="net.GND" />
<trace from="U7.GND5" to="net.GND" />
<trace from="U7.GND6" to="net.GND" />
<trace from="U7.GND7" to="net.GND" />
<trace from="U7.GND8" to="net.GND" />
<trace from="U7.VDD1" to="net.P3V3" />
<trace from="U7.VDD2" to="net.P3V3" />
<trace from="U7.VDD3" to="net.P3V3" />
<trace from="U7.VDD4" to="net.P3V3" />
<trace from="U7.VD1" to="net.P3V3" />
<trace from="U7.VD2" to="net.P3V3" />
<trace from="U7.VD3" to="net.P3V3" />
<trace from="U7.VD4" to="net.P3V3" />
<capacitor name="C321" capacitance="100nF" footprint="0402" pcbX={17.5} pcbY={8.5} schSheetName="ADC" schX={11.16} schY={0} schRotation={270} />
<capacitor name="C322" capacitance="100nF" footprint="0402" pcbRotation={180} pcbX={26} pcbY={-8} schSheetName="ADC" schX={12.8} schY={0} schRotation={270} />
<trace from="C321.pin1" to="net.P3V3" />
<trace from="C321.pin2" to="net.GND" />
<trace from="C322.pin1" to="net.P3V3" />
<trace from="C322.pin2" to="net.GND" />
{/* sample clock oscillator */}
<SiT8008BI_21_33E_25_000000 name="X1" pcbX={22.5} pcbY={9} schSheetName="ADC" schX={11.33} schY={-4} />
<trace from="X1.OE" to="net.P3V3" />
<trace from="X1.VDD" to="net.P3V3" />
<trace from="X1.GND" to="net.GND" />
<resistor name="R320" resistance="33" footprint="0402" pcbX={22.5} pcbY={6.5} schSheetName="ADC" schX={13.68} schY={-4} schRotation={270} />
<trace from="X1.OUT" to="R320.pin1" />
<trace from="R320.pin2" to="net.CLK25" />
<capacitor name="C323" capacitance="100nF" footprint="0402" pcbX={19.5} pcbY={10.5} schSheetName="ADC" schX={14.4} schY={0} schRotation={270} />
<trace from="C323.pin1" to="net.P3V3" />
<trace from="C323.pin2" to="net.GND" />
{/* ADC data and clock bus header, 2x10 */}
<pinheader
name="J3"
pinCount={20}
doubleRow
pitch="2.54mm"
footprint="pinrow20_p2.54mm_rows2"
pinLabels={["GND", ...DATA_A, "GND", "P3V3", ...DATA_B, "CLK25"]}
schWidth={0.675}
schSheetName="ADC"
schX={17}
schY={3}
schRotation={90}
pcbX={36}
pcbY={0}
pcbRotation={90}
/>
<trace from="J3.pin1" to="net.GND" />
<trace from="J3.pin10" to="net.GND" />
<trace from="J3.pin11" to="net.P3V3" />
<trace from="J3.pin20" to="net.CLK25" />
<trace name="DA0" from="U7.D0A" to="J3.pin2" />
<trace name="DA1" from="U7.D1A" to="J3.pin3" />
<trace name="DA2" from="U7.D2A" to="J3.pin4" />
<trace name="DA3" from="U7.D3A" to="J3.pin5" />
<trace name="DA4" from="U7.D4A" to="J3.pin6" />
<trace name="DA5" from="U7.D5A" to="J3.pin7" />
<trace name="DA6" from="U7.D6A" to="J3.pin8" />
<trace name="DA7" from="U7.D7A_MSB" to="J3.pin9" />
<trace name="DB0" from="U7.D0B" to="J3.pin12" />
<trace name="DB1" from="U7.D1B" to="J3.pin13" />
<trace name="DB2" from="U7.D2B" to="J3.pin14" />
<trace name="DB3" from="U7.D3B" to="J3.pin15" />
<trace name="DB4" from="U7.D4B" to="J3.pin16" />
<trace name="DB5" from="U7.D5B" to="J3.pin17" />
<trace name="DB6" from="U7.D6B" to="J3.pin18" />
<trace name="DB7" from="U7.MSB_D7B" to="J3.pin19" />
<bus
name="ADC_DATA"
connections={[
"U7.D0A",
"U7.D1A",
"U7.D2A",
"U7.D3A",
"U7.D4A",
"U7.D5A",
"U7.D6A",
"U7.D7A_MSB",
"U7.D0B",
"U7.D1B",
"U7.D2B",
"U7.D3B",
"U7.D4B",
"U7.D5B",
"U7.D6B",
"U7.MSB_D7B",
]}
pcbTraceWidth="0.15mm"
pcbSpacingToOtherSignals="0.2mm"
/>
</>
)
}