├── fpga ├── ecp5_clock.py ├── ice40_clock.py ├── ice40breakout.pcf ├── fifo.v ├── ecp5evn.lpf ├── pwm.v ├── counter_pipelined.v ├── icestick.pcf ├── Makefile ├── glitcher.v ├── top.v └── uart.v ├── pcb └── pmod2 │ ├── pmod2.bck │ ├── pmod2.dcm │ ├── test2 │ ├── pmod2-test2.zip │ ├── pmod2-NPTH.drl │ ├── pmod2-Edge.Cuts.gbr │ ├── pmod2-B.SilkS.gbr │ ├── pmod2-PTH.drl │ ├── pmod2-B.Paste.gbr │ └── pmod2-B.Mask.gbr │ ├── sym-lib-table │ ├── pmod1.bck │ ├── pmod1.dcm │ ├── pmod2.pro │ ├── pmod2.lib │ ├── pmod1.lib │ ├── pmod2-cache.lib │ ├── pmod2.bak │ └── pmod2.sch ├── images ├── pcb_rev2.jpeg ├── example_setup.jpeg └── controller_demo.jpeg ├── scripts ├── Utils │ ├── __init__.py │ ├── FiCsv.py │ └── Utils.py ├── Drivers │ ├── __init__.py │ ├── DPS5005.py │ ├── FindSerial.py │ ├── HorrorScope.py │ ├── IceGlitcher.py │ └── Picoscope3000a.py ├── test-gpio.py ├── test-pwm.py ├── IceGlitcherNano.py └── notebook-nano.ipynb ├── TOE └── arduino-nano │ ├── build.sh │ └── main.c └── README.md /fpga/ecp5_clock.py: -------------------------------------------------------------------------------- 1 | ctx.addClock("clk_fast", 250) 2 | ctx.addClock("clk", 12) 3 | -------------------------------------------------------------------------------- /fpga/ice40_clock.py: -------------------------------------------------------------------------------- 1 | ctx.addClock("clk_fast",175) 2 | ctx.addClock("clk", 12) 3 | -------------------------------------------------------------------------------- /pcb/pmod2/pmod2.bck: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /pcb/pmod2/pmod2.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /images/pcb_rev2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noopwafel/iceglitch/HEAD/images/pcb_rev2.jpeg -------------------------------------------------------------------------------- /images/example_setup.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noopwafel/iceglitch/HEAD/images/example_setup.jpeg -------------------------------------------------------------------------------- /images/controller_demo.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noopwafel/iceglitch/HEAD/images/controller_demo.jpeg -------------------------------------------------------------------------------- /pcb/pmod2/test2/pmod2-test2.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noopwafel/iceglitch/HEAD/pcb/pmod2/test2/pmod2-test2.zip -------------------------------------------------------------------------------- /pcb/pmod2/sym-lib-table: -------------------------------------------------------------------------------- 1 | (sym_lib_table 2 | (lib (name pmod1)(type Legacy)(uri ${KIPRJMOD}/pmod1.lib)(options "")(descr "")) 3 | ) 4 | -------------------------------------------------------------------------------- /scripts/Utils/__init__.py: -------------------------------------------------------------------------------- 1 | from Utils.Utils import hex_ascii, run_command, random_in_poly 2 | from Utils.FiCsv import FiCsvWriter, FiCsvReader 3 | -------------------------------------------------------------------------------- /pcb/pmod2/pmod1.bck: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | $CMP TS5A63157 4 | D sot-23-6 switch 5 | K Analog Switch 6 | $ENDCMP 7 | # 8 | #End Doc Library 9 | -------------------------------------------------------------------------------- /pcb/pmod2/test2/pmod2-NPTH.drl: -------------------------------------------------------------------------------- 1 | M48 2 | ;DRILL file {KiCad 5.0.0+dfsg1-2} date Mon Dec 9 14:25:03 2019 3 | ;FORMAT={-:-/ absolute / inch / decimal} 4 | FMAT,2 5 | INCH,TZ 6 | % 7 | G90 8 | G05 9 | M72 10 | T0 11 | M30 12 | -------------------------------------------------------------------------------- /TOE/arduino-nano/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | avr-gcc -Wall -Wpedantic -Wextra -g -O3 -mmcu=atmega328p --std=gnu99 -flto -o main.bin *.c 5 | avr-size -C main.bin 6 | avr-objcopy -j .text -j .data -O ihex main.bin main.hex 7 | 8 | avrdude -p m328p -cavrispmkii -U flash:w:main.hex:i -P usb 9 | -------------------------------------------------------------------------------- /fpga/ice40breakout.pcf: -------------------------------------------------------------------------------- 1 | set_io clk J3 2 | 3 | set_io LED1 B5 4 | set_io LED2 B4 5 | set_io LED3 A2 6 | set_io LED4 A1 7 | set_io LED5 C5 8 | 9 | set_io RSTn C16 -pullup yes 10 | 11 | set_io RX B10 12 | set_io TX B12 13 | 14 | set_io trigger_in H16 15 | set_io switch_out D16 16 | 17 | 18 | set_io PWM1 B15 19 | set_io PWM2 D15 20 | -------------------------------------------------------------------------------- /scripts/Drivers/__init__.py: -------------------------------------------------------------------------------- 1 | '''Drivers for various hardware devices, and some hardware helper classes ''' 2 | import sys 3 | import os 4 | sys.path.append(os.path.dirname(os.path.abspath(__file__))) 5 | #from Drivers.DPS5005 import DPS5005 6 | from Drivers.FindSerial import FindSerial 7 | from Drivers.HorrorScope import HorrorScope 8 | from Drivers.IceGlitcher import IceGlitcher 9 | 10 | -------------------------------------------------------------------------------- /pcb/pmod2/pmod1.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | $CMP AP2210N-4.0 4 | D 300mA low dropout linear regulator, shutdown pin, 2.5V-6V input voltage, 1.2V fixed positive output, SOT-23-3 package 5 | K linear regulator ldo fixed positive 6 | F https://www.diodes.com/assets/Datasheets/AP2127.pdf 7 | $ENDCMP 8 | # 9 | $CMP TS5A63157 10 | D sot-23-6 switch 11 | K Analog Switch 12 | $ENDCMP 13 | # 14 | #End Doc Library 15 | -------------------------------------------------------------------------------- /fpga/fifo.v: -------------------------------------------------------------------------------- 1 | `default_nettype none 2 | 3 | module fifo ( 4 | input clk, 5 | input [7:0] in, 6 | output reg [7:0] out, 7 | output reg available, 8 | input add, 9 | input get, 10 | ); 11 | 12 | reg [2:0] writeIdx; 13 | reg [2:0] readIdx; 14 | 15 | reg [7:0] buff [7:0]; 16 | 17 | 18 | always @(posedge clk) begin 19 | //Always write registers, to from the regs, whether they are valid is 20 | //decided by the read/write Idx's 21 | buff[writeIdx] <= in; 22 | out <= buff[readIdx]; 23 | 24 | // 25 | available <= writeIdx != readIdx; 26 | 27 | writeIdx <= writeIdx + add; 28 | readIdx <= readIdx + get; 29 | end 30 | 31 | endmodule 32 | -------------------------------------------------------------------------------- /scripts/test-gpio.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | ''' 3 | Simple script to play around with the PWM channels on the IceGlitcher. 4 | There are 2 running modes, saw-tooth and set 5 | set example: 6 | ./test-pwm.py 3.3 7 | saw-tooth example: 8 | ./test-pwm.py 9 | ''' 10 | 11 | import os 12 | import sys 13 | import time 14 | import serial 15 | from Drivers import FindSerial, IceGlitcher 16 | 17 | 18 | glitcher = IceGlitcher(FindSerial().get_path({'PRODUCT':'403/6010/700', 'DEVPATH':'1\.1$'})) 19 | 20 | if len(sys.argv) > 1: 21 | value = int(sys.argv[1]) 22 | print("Setting gpios to", value) 23 | glitcher.set_gpio(value) 24 | sys.exit(0) 25 | 26 | while True: 27 | for i in range(0,16,1): 28 | glitcher.set_clk_delay(i) 29 | -------------------------------------------------------------------------------- /pcb/pmod2/pmod2.pro: -------------------------------------------------------------------------------- 1 | update=22/05/2015 07:44:53 2 | version=1 3 | last_client=kicad 4 | [general] 5 | version=1 6 | RootSch= 7 | BoardNm= 8 | [pcbnew] 9 | version=1 10 | LastNetListRead= 11 | UseCmpFile=1 12 | PadDrill=0.600000000000 13 | PadDrillOvalY=0.600000000000 14 | PadSizeH=1.500000000000 15 | PadSizeV=1.500000000000 16 | PcbTextSizeV=1.500000000000 17 | PcbTextSizeH=1.500000000000 18 | PcbTextThickness=0.300000000000 19 | ModuleTextSizeV=1.000000000000 20 | ModuleTextSizeH=1.000000000000 21 | ModuleTextSizeThickness=0.150000000000 22 | SolderMaskClearance=0.000000000000 23 | SolderMaskMinWidth=0.000000000000 24 | DrawSegmentWidth=0.200000000000 25 | BoardOutlineThickness=0.100000000000 26 | ModuleOutlineThickness=0.150000000000 27 | [cvpcb] 28 | version=1 29 | NetIExt=net 30 | [eeschema] 31 | version=1 32 | LibDir= 33 | [eeschema/libraries] 34 | -------------------------------------------------------------------------------- /scripts/test-pwm.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | ''' 3 | Simple script to play around with the PWM channels on the IceGlitcher. 4 | There are 2 running modes, saw-tooth and set 5 | set example: 6 | ./test-pwm.py 3.3 7 | saw-tooth example: 8 | ./test-pwm.py 9 | ''' 10 | 11 | import os 12 | import sys 13 | import time 14 | import serial 15 | from Drivers import FindSerial, IceGlitcher 16 | 17 | 18 | glitcher = IceGlitcher(FindSerial().get_path({'PRODUCT':'403/6010/700', 'DEVPATH':'1\.1$'})) 19 | 20 | if len(sys.argv) > 1: 21 | value = float(sys.argv[1]) 22 | print("Setting pwm channels to",value) 23 | glitcher.set_pwm(0,value) 24 | glitcher.set_pwm(1,value) 25 | sys.exit(0) 26 | 27 | while True: 28 | for i in range(1023): 29 | # time.sleep(1.0) 30 | i = (3.3 / (1023)) * i 31 | print(i) 32 | glitcher.set_pwm(0,i) 33 | glitcher.set_pwm(1,i) 34 | -------------------------------------------------------------------------------- /fpga/ecp5evn.lpf: -------------------------------------------------------------------------------- 1 | LOCATE COMP "clk" SITE "A10"; 2 | IOBUF PORT "clkin" IO_TYPE=LVCMOS33; 3 | 4 | LOCATE COMP "LED1" SITE "B17"; 5 | LOCATE COMP "LED2" SITE "A17"; 6 | LOCATE COMP "LED3" SITE "C17"; 7 | LOCATE COMP "LED4" SITE "B18"; 8 | LOCATE COMP "LED5" SITE "A18"; 9 | LOCATE COMP "LED6" SITE "B19"; 10 | LOCATE COMP "LED7" SITE "A12"; 11 | LOCATE COMP "LED8" SITE "A13"; 12 | 13 | IOBUF PORT "LED1" IO_TYPE=LVCMOS25; 14 | IOBUF PORT "LED2" IO_TYPE=LVCMOS25; 15 | IOBUF PORT "LED3" IO_TYPE=LVCMOS25; 16 | IOBUF PORT "LED4" IO_TYPE=LVCMOS25; 17 | IOBUF PORT "LED5" IO_TYPE=LVCMOS25; 18 | IOBUF PORT "LED6" IO_TYPE=LVCMOS25; 19 | IOBUF PORT "LED7" IO_TYPE=LVCMOS25; 20 | IOBUF PORT "LED8" IO_TYPE=LVCMOS25; 21 | 22 | LOCATE COMP "TX" SITE "P3"; 23 | LOCATE COMP "RX" SITE "P2"; 24 | 25 | IOBUF PORT "TX" IO_TYPE=LVCMOS33; 26 | IOBUF PORT "RX" IO_TYPE=LVCMOS33; 27 | 28 | LOCATE COMP "trigger_in" SITE "A19"; 29 | IOBUF PORT "trigger_in" IO_TYPE=LVCMOS25; 30 | LOCATE COMP "switch_out" SITE "A16"; 31 | IOBUF PORT "switch_out" IO_TYPE=LVCMOS25; 32 | 33 | -------------------------------------------------------------------------------- /pcb/pmod2/test2/pmod2-Edge.Cuts.gbr: -------------------------------------------------------------------------------- 1 | %TF.GenerationSoftware,KiCad,Pcbnew,5.0.0+dfsg1-2*% 2 | %TF.CreationDate,2019-12-09T14:25:11+01:00*% 3 | %TF.ProjectId,pmod2,706D6F64322E6B696361645F70636200,rev?*% 4 | %TF.SameCoordinates,Original*% 5 | %TF.FileFunction,Profile,NP*% 6 | %FSLAX46Y46*% 7 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 8 | G04 Created by KiCad (PCBNEW 5.0.0+dfsg1-2) date Mon Dec 9 14:25:11 2019* 9 | %MOMM*% 10 | %LPD*% 11 | G01* 12 | G04 APERTURE LIST* 13 | %ADD10C,0.150000*% 14 | G04 APERTURE END LIST* 15 | D10* 16 | X177250000Y-158000000D02* 17 | X124750000Y-158000000D01* 18 | X177250000Y-113750000D02* 19 | X177250000Y-158000000D01* 20 | X172000000Y-113750000D02* 21 | X177250000Y-113750000D01* 22 | X124750000Y-157250000D02* 23 | X124750000Y-154750000D01* 24 | X124750000Y-113750000D02* 25 | X128000000Y-113750000D01* 26 | X124750000Y-118000000D02* 27 | X124750000Y-113750000D01* 28 | X124750000Y-158000000D02* 29 | X124750000Y-157250000D01* 30 | X124750000Y-118000000D02* 31 | X124750000Y-154750000D01* 32 | X172000000Y-113750000D02* 33 | X128000000Y-113750000D01* 34 | M02* 35 | -------------------------------------------------------------------------------- /scripts/Utils/FiCsv.py: -------------------------------------------------------------------------------- 1 | from csv import DictReader, DictWriter 2 | import datetime 3 | 4 | class FiCsvWriter(): 5 | def __init__(self, file_path): 6 | self.file_path = file_path 7 | self.csv_writer = None 8 | self.last_insert_time = None 9 | 10 | def write(self, entry): 11 | if not self.csv_writer: 12 | self._first_write(entry) 13 | 14 | self._print_row(entry) 15 | self.csv_writer.writerow(entry) 16 | 17 | def _print_row(self, entry): 18 | if not self.last_insert_time: 19 | self.last_insert_time = datetime.datetime.now() 20 | 21 | print("Elapsed:", datetime.datetime.now() - self.last_insert_time, end=' ') 22 | for key, value in entry.items(): 23 | if isinstance(value, float): 24 | print(key, '%.4G'%value, end=' ') 25 | else: 26 | print(key, value, end=' ') 27 | print('') 28 | self.last_insert_time = datetime.datetime.now() 29 | 30 | def _first_write(self, entry): 31 | self.csv_writer = DictWriter(open(self.file_path,'w'),fieldnames=entry.keys()) 32 | self.csv_writer.writeheader() 33 | 34 | class FiCsvReader(): 35 | def __init__(self, file_path): 36 | self.csv_reader = DictReader(open(file_path,'r')) 37 | 38 | def read_all(self): 39 | return list(reader) 40 | 41 | 42 | -------------------------------------------------------------------------------- /fpga/pwm.v: -------------------------------------------------------------------------------- 1 | `default_nettype none 2 | 3 | module pwm( 4 | input clk, 5 | input[9:0] duty_cycle, 6 | output pin 7 | ); 8 | 9 | parameter COUNTER_BITS = 10; 10 | 11 | `ifndef SIM 12 | defparam differential_output_b.PIN_TYPE = 6'b010000; // PIN_OUTPUT_DDR, PIN_INPUT_REGISTER 13 | defparam differential_output_b.IO_STANDARD = "SB_LVCMOS" ; 14 | SB_IO differential_output_b ( 15 | .PACKAGE_PIN(pin), 16 | .LATCH_INPUT_VALUE (1'b1), 17 | .CLOCK_ENABLE (1'b1), 18 | .INPUT_CLK (clk), 19 | .OUTPUT_CLK (clk), 20 | .OUTPUT_ENABLE (1'b1), 21 | .D_OUT_0 (pwm_0_out), // Non-inverted 22 | .D_OUT_1 (pwm_1_out), // Non-inverted 23 | ); 24 | `endif 25 | reg pwm_0_out; 26 | reg pwm_1_out; 27 | 28 | reg pwm_0; 29 | reg pwm_1; 30 | 31 | reg [3:0] top; 32 | reg [3:0] bottom; 33 | reg carry; 34 | reg bottom_e; 35 | reg bottom_lt; 36 | reg bottom_e1; 37 | reg bottom_lt1; 38 | 39 | reg top_e; 40 | reg top_lt; 41 | 42 | always @(posedge clk) begin 43 | pwm_0 <= 0; 44 | pwm_1 <= 0; 45 | pwm_0_out <= pwm_0; 46 | pwm_1_out <= pwm_1; 47 | 48 | {carry, bottom} <= {1'b0,bottom} - 1; 49 | 50 | top <= top - carry; 51 | bottom_e = bottom == duty_cycle[5:2]; 52 | bottom_lt = bottom < duty_cycle[5:2]; 53 | 54 | {bottom_e1, bottom_lt1} <= {bottom_e, bottom_lt}; 55 | top_e = top == duty_cycle[9:6]; 56 | top_lt = top < duty_cycle[9:6]; 57 | 58 | if (top_lt || ( top_e && bottom_lt1 )) 59 | begin 60 | pwm_0 <= 1; 61 | pwm_1 <= 1; 62 | end 63 | 64 | if (top_e && bottom_e1) 65 | begin 66 | pwm_0 <= duty_cycle[1]; 67 | end 68 | 69 | end 70 | 71 | endmodule 72 | -------------------------------------------------------------------------------- /fpga/counter_pipelined.v: -------------------------------------------------------------------------------- 1 | `default_nettype none 2 | 3 | module counter( 4 | input clk, 5 | input [31:0] counterValue, 6 | input setCounter, 7 | output reg isZero 8 | ); 9 | 10 | parameter COUNTER_BITS = 4; 11 | 12 | reg carry0, carry1, carry2, carry3, carry4, carry5, carry6; 13 | reg [COUNTER_BITS-1:0] counter0; 14 | reg [COUNTER_BITS-1:0] counter1; 15 | reg [COUNTER_BITS-1:0] counter2; 16 | reg [COUNTER_BITS-1:0] counter3; 17 | reg [COUNTER_BITS-1:0] counter4; 18 | reg [COUNTER_BITS-1:0] counter5; 19 | reg [COUNTER_BITS-1:0] counter6; 20 | reg [COUNTER_BITS-1:0] counter7; 21 | 22 | //reg top3Zero,top2Zero,top1Zero; 23 | 24 | always @(posedge clk) begin 25 | {carry0,counter0} <= {1'b0,counter0} -1; 26 | {carry1,counter1} <= {1'b0,counter1} - carry0; 27 | {carry2,counter2} <= {1'b0,counter2} - carry1; 28 | {carry3,counter3} <= {1'b0,counter3} - carry2; 29 | {carry4,counter4} <= {1'b0,counter4} - carry3; 30 | {carry5,counter5} <= {1'b0,counter5} - carry4; 31 | {carry6,counter6} <= {1'b0,counter6} - carry5; 32 | { counter7} <= {1'b0,counter7} - carry6; 33 | 34 | // if the bottom counter is zero, all the carries should have propagated 35 | 36 | isZero <= {counter0, setCounter, counter1,counter2, counter3,counter4,counter5 ,counter6,counter7,carry0} == 0; 37 | //isZero <= ((counter0 | counter1) | (counter2 | counter3 )) | ((counter4 | counter5) | (counter6|counter7)) == 0 && carry0==0; 38 | if(setCounter) 39 | begin 40 | {counter7,counter6,counter5,counter4,counter3, counter2, counter1, counter0} <= {counterValue}; 41 | {carry0,carry1,carry2,carry3,carry4,carry5,carry6} <=0; 42 | end 43 | 44 | end 45 | 46 | endmodule 47 | -------------------------------------------------------------------------------- /pcb/pmod2/test2/pmod2-B.SilkS.gbr: -------------------------------------------------------------------------------- 1 | %TF.GenerationSoftware,KiCad,Pcbnew,5.0.0+dfsg1-2*% 2 | %TF.CreationDate,2019-12-09T14:25:11+01:00*% 3 | %TF.ProjectId,pmod2,706D6F64322E6B696361645F70636200,rev?*% 4 | %TF.SameCoordinates,Original*% 5 | %TF.FileFunction,Legend,Bot*% 6 | %TF.FilePolarity,Positive*% 7 | %FSLAX46Y46*% 8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 9 | G04 Created by KiCad (PCBNEW 5.0.0+dfsg1-2) date Mon Dec 9 14:25:11 2019* 10 | %MOMM*% 11 | %LPD*% 12 | G01* 13 | G04 APERTURE LIST* 14 | %ADD10C,0.120000*% 15 | %ADD11C,0.150000*% 16 | G04 APERTURE END LIST* 17 | D10* 18 | X137988748Y-122210000D02* 19 | X138511252Y-122210000D01* 20 | X137988748Y-120790000D02* 21 | X138511252Y-120790000D01* 22 | D11* 23 | X139142857Y-120107142D02* 24 | X139190476Y-120154761D01* 25 | X139333333Y-120202380D01* 26 | X139428571Y-120202380D01* 27 | X139571428Y-120154761D01* 28 | X139666666Y-120059523D01* 29 | X139714285Y-119964285D01* 30 | X139761904Y-119773809D01* 31 | X139761904Y-119630952D01* 32 | X139714285Y-119440476D01* 33 | X139666666Y-119345238D01* 34 | X139571428Y-119250000D01* 35 | X139428571Y-119202380D01* 36 | X139333333Y-119202380D01* 37 | X139190476Y-119250000D01* 38 | X139142857Y-119297619D01* 39 | X138190476Y-120202380D02* 40 | X138761904Y-120202380D01* 41 | X138476190Y-120202380D02* 42 | X138476190Y-119202380D01* 43 | X138571428Y-119345238D01* 44 | X138666666Y-119440476D01* 45 | X138761904Y-119488095D01* 46 | X137857142Y-119202380D02* 47 | X137238095Y-119202380D01* 48 | X137571428Y-119583333D01* 49 | X137428571Y-119583333D01* 50 | X137333333Y-119630952D01* 51 | X137285714Y-119678571D01* 52 | X137238095Y-119773809D01* 53 | X137238095Y-120011904D01* 54 | X137285714Y-120107142D01* 55 | X137333333Y-120154761D01* 56 | X137428571Y-120202380D01* 57 | X137714285Y-120202380D01* 58 | X137809523Y-120154761D01* 59 | X137857142Y-120107142D01* 60 | M02* 61 | -------------------------------------------------------------------------------- /fpga/icestick.pcf: -------------------------------------------------------------------------------- 1 | # Generic iCEstick placement constraints file 2 | 3 | # Red LEDs 4 | set_io LED1 99 5 | set_io LED2 98 6 | set_io LED3 97 7 | set_io LED4 96 8 | 9 | # Green LED 10 | set_io LED5 95 11 | 12 | # IrDA port 13 | #set_io RXD 106 14 | #set_io TXD 105 15 | #set_io SD 107 16 | 17 | # Pmod connector 18 | #set_io PIO1_02 78 # Pin 1 19 | #set_io PIO1_03 79 # Pin 2 20 | #set_io PIO1_04 80 # Pin 3 21 | #set_io PIO1_05 81 # Pin 4 22 | #set_io PIO1_06 87 # Pin 7 23 | #set_io PIO1_07 88 # Pin 8 24 | #set_io PIO1_08 90 # Pin 9 25 | #set_io PIO1_09 91 # Pin 10 26 | 27 | # Connector J1 28 | #set_io PIO0_02 112 # Pin 3 29 | #set_io PIO0_03 113 # Pin 4 30 | #set_io PIO0_04 114 # Pin 5 31 | #set_io PIO0_05 115 # Pin 6 32 | #set_io PIO0_06 116 # Pin 7 33 | #set_io PIO0_07 117 # Pin 8 34 | #set_io PIO0_08 118 # Pin 9 35 | #set_io PIO0_09 119 # Pin 10 36 | 37 | # Connector J3 38 | #set_io PIO2_17 62 # Pin 3 39 | #set_io PIO2_16 61 # Pin 4 40 | #set_io PIO2_15 60 # Pin 5 41 | #set_io PIO2_14 56 # Pin 6 42 | #set_io PIO2_13 48 # Pin 7 43 | #set_io PIO2_12 47 # Pin 8 44 | #set_io PIO2_11 45 # Pin 9 45 | #set_io PIO2_10 44 # Pin 10 46 | 47 | # FTDI Port B UART 48 | #set_io DCDn 1 49 | #set_io DSRn 2 50 | #set_io DTRn 3 51 | #set_io CTSn 4 52 | #set_io RTSn 7 53 | #set_io RS232_Tx_TTL 8 54 | #set_io RS232_Rx_TTL 9 55 | set_io TX 8 56 | set_io RX 9 57 | 58 | # SPI 59 | #set_io SPI_SCK 70 60 | #set_io SPI_SI 68 61 | #set_io SPI_SO 67 62 | #set_io SPI_SS_B 71 63 | 64 | # Configuration pins 65 | #set_io CDONE 65 66 | #set_io CRESET_B 66 67 | 68 | # 12 MHz clock 69 | #set_io iCE_CLK 21 70 | set_io clk 21 71 | 72 | set_io trigger_in 78 # PMOD 1 & 2 73 | set_io switch_out 79 74 | 75 | set_io gpio_0 87 76 | set_io gpio_1 88 77 | 78 | #set_io clka 80 79 | #set_io clkb 81 80 | 81 | # https://stackoverflow.com/questions/42421906/correspondence-between-ice40-i-o-blocks-and-package-pins 82 | 83 | set_io PWM1 90 # PMOD ... 84 | set_io PWM2 91 # PMOD ... 85 | -------------------------------------------------------------------------------- /fpga/Makefile: -------------------------------------------------------------------------------- 1 | QUIET ?= -q 2 | ECP5 ?= 0 3 | ICE40 ?= 0 4 | ifeq ($(ECP5), 1) 5 | FPGA_TYPE ?= um5g-85k 6 | LPF ?= ecp5evn.lpf 7 | NEXTPNR_FLAGS ?= 8 | YOSYS_FLAGS ?= -DECP5=1 9 | else 10 | ifeq ($(ICE40), 1) 11 | FPGA_TYPE ?= hx8k 12 | PCF ?= ice40breakout.pcf 13 | NEXTPNR_FLAGS ?= --opt-timing -r 14 | YOSYS_FLAGS ?= 15 | else 16 | FPGA_TYPE ?= hx1k --package tq144 17 | PCF ?= icestick.pcf 18 | NEXTPNR_FLAGS ?= --opt-timing -r 19 | YOSYS_FLAGS ?= 20 | endif 21 | endif 22 | 23 | glitcher: upload-glitcher 24 | 25 | upload-glitcher: glitcher.bin 26 | sudo iceprog glitcher.bin 27 | 28 | iverilog: 29 | iverilog -DSIM top.v -o iverilog.out 30 | 31 | glitcher.bin: glitcher.txt 32 | ifeq ($(ECP5), 1) 33 | ecppack --svf-rowsize 100000 --svf attosoc.svf glitcher.txt glitcher.bin 34 | else 35 | icepack glitcher.txt glitcher.bin 36 | endif 37 | 38 | glitcher.rpt: glitcher.txt 39 | icetime -d $(FPGA_TYPE) -mtr glitcher.rpt glitcher.txt 40 | 41 | glitcher.txt: glitcher.json 42 | ifeq ($(ECP5), 1) 43 | nextpnr-ecp5 $(QUIET) $(NEXTPNR_FLAGS) --pre-pack ecp5_clock.py --$(FPGA_TYPE) --lpf $(LPF) --textcfg glitcher.txt --json glitcher.json --log nextpnr.log && grep --color -i freq nextpnr.log 44 | else 45 | until nextpnr-ice40 $(QUIET) $(NEXTPNR_FLAGS) --pre-pack ice40_clock.py --$(FPGA_TYPE) --pcf $(PCF) --asc glitcher.txt --json glitcher.json --log nextpnr.log && grep --color -i freq nextpnr.log ; do rm glitcher.txt ; done 46 | endif 47 | 48 | glitcher.json: top.v 49 | ifeq ($(ECP5), 1) 50 | yosys $(QUIET) -E top.deps -p "read_verilog $(YOSYS_FLAGS) top.v; synth_ecp5 -json glitcher.json" | tee yosys.log 51 | else 52 | yosys $(QUIET) -E top.deps -p "read_verilog $(YOSYS_FLAGS) top.v; synth_ice40 -json glitcher.json" | tee yosys.log 53 | endif 54 | 55 | clean: 56 | rm -f glitcher.bin glitcher.json glitcher.txt glitcher.pcf top.deps yosys.log nextpnr.log iverilog.out glitcher.rpt 57 | 58 | -include top.deps 59 | -------------------------------------------------------------------------------- /pcb/pmod2/pmod2.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.4 2 | #encoding utf-8 3 | # 4 | # TS5A63157 5 | # 6 | DEF TS5A63157 U 0 5 Y Y 2 F N 7 | F0 "U" -125 185 50 H V L CNN 8 | F1 "TS5A63157" -125 115 50 H V L CNN 9 | F2 "Package_TO_SOT_SMD:SOT-23-6" 0 -300 50 H I C CNN 10 | F3 "" 0 0 50 H I C CNN 11 | $FPLIST 12 | SOT?23* 13 | $ENDFPLIST 14 | DRAW 15 | C -85 -100 20 1 1 10 N 16 | C 85 -200 20 1 1 10 N 17 | C 85 0 20 1 1 10 N 18 | S -150 75 150 -300 1 1 10 f 19 | S -150 400 150 -400 2 1 10 f 20 | P 2 1 1 0 -200 -100 -110 -100 N 21 | P 2 1 1 10 -65 -95 100 -25 N 22 | P 2 1 1 0 0 -300 0 -280 N 23 | P 2 1 1 0 0 -270 0 -260 N 24 | P 2 1 1 0 0 -250 0 -240 N 25 | P 2 1 1 0 0 -230 0 -220 N 26 | P 2 1 1 0 0 -210 0 -200 N 27 | P 2 1 1 0 0 -190 0 -180 N 28 | P 2 1 1 0 0 -170 0 -160 N 29 | P 2 1 1 0 0 -150 0 -140 N 30 | P 2 1 1 0 0 -130 0 -120 N 31 | P 2 1 1 0 0 -110 0 -100 N 32 | P 2 1 1 0 0 -90 0 -80 N 33 | P 2 1 1 0 0 -90 0 -80 N 34 | P 2 1 1 0 200 -200 110 -200 N 35 | P 2 1 1 0 200 0 110 0 N 36 | X GND 2 0 -500 100 U 50 50 2 0 W 37 | X V+ 5 0 500 100 D 50 50 2 0 W 38 | X ~ 1 300 -200 100 L 50 50 1 1 P 39 | X gnd 2 -350 -200 200 R 50 50 1 1 I 40 | X ~ 3 300 0 100 L 50 50 1 1 P 41 | X ~ 4 -300 -100 100 R 50 50 1 1 P 42 | X vcc 5 -350 0 200 R 50 50 1 1 I 43 | X ~ 6 0 -400 100 U 50 50 1 1 I 44 | X gnd 2-UB -350 -200 200 R 50 50 2 1 I 45 | X vcc 5-UB -350 0 200 R 50 50 2 1 I 46 | ENDDRAW 47 | ENDDEF 48 | # 49 | # MAX4619 50 | # 51 | DEF MAX4619 U 0 40 Y Y 1 F N 52 | F0 "U" 0 -650 60 H V C CNN 53 | F1 "MAX4619" 0 300 60 H V C CNN 54 | F2 "" 0 0 60 H V C CNN 55 | F3 "" 0 0 60 H V C CNN 56 | DRAW 57 | S -250 250 250 -550 0 1 0 f 58 | X Y1 1 -350 200 98 R 40 40 1 1 P 59 | X B 10 350 -400 98 L 40 40 1 1 I 60 | X A 11 350 -300 98 L 40 40 1 1 I 61 | X X0 12 350 -200 98 L 40 40 1 1 P 62 | X X1 13 350 -100 98 L 40 40 1 1 P 63 | X X 14 350 0 98 L 40 40 1 1 P 64 | X Y 15 350 100 98 L 40 40 1 1 P 65 | X VCC 16 350 200 98 L 40 40 1 1 W 66 | X Y0 2 -350 100 98 R 40 40 1 1 P 67 | X Z1 3 -350 0 98 R 40 40 1 1 P 68 | X Z 4 -350 -100 98 R 40 40 1 1 P 69 | X Z0 5 -350 -200 98 R 40 40 1 1 P 70 | X EN 6 -350 -350 98 R 40 40 1 1 I 71 | X GND 8 -350 -450 98 R 40 40 1 1 W 72 | X C 9 350 -500 98 L 40 40 1 1 I 73 | ENDDRAW 74 | ENDDEF 75 | # 76 | #End Library 77 | -------------------------------------------------------------------------------- /pcb/pmod2/test2/pmod2-PTH.drl: -------------------------------------------------------------------------------- 1 | M48 2 | ;DRILL file {KiCad 5.0.0+dfsg1-2} date Mon Dec 9 14:25:03 2019 3 | ;FORMAT={-:-/ absolute / inch / decimal} 4 | FMAT,2 5 | INCH,TZ 6 | T1C0.0157 7 | T2C0.0197 8 | T3C0.0236 9 | T4C0.0315 10 | T5C0.0394 11 | % 12 | G90 13 | G05 14 | M72 15 | T1 16 | X5.0295Y-5.1476 17 | X5.2067Y-5.561 18 | X5.2756Y-5. 19 | X5.2854Y-5.0689 20 | X5.2854Y-5.8071 21 | X5.2854Y-5.8465 22 | X5.2953Y-5.689 23 | X5.3354Y-5.0787 24 | X5.3367Y-4.9978 25 | X5.5315Y-5. 26 | X5.561Y-4.7736 27 | X5.561Y-5.6693 28 | X5.6004Y-5.0098 29 | X5.6004Y-5.0689 30 | X5.6102Y-6.0236 31 | X5.6398Y-5.3445 32 | X5.6496Y-5.6398 33 | X5.6791Y-6.1024 34 | X5.689Y-5.6791 35 | X5.876Y-5.7579 36 | X6.0039Y-4.8819 37 | X6.0531Y-5.5217 38 | X6.1516Y-6.0433 39 | X6.2795Y-6.0433 40 | X6.3287Y-4.8425 41 | X6.3287Y-5.315 42 | X6.3976Y-5.4528 43 | X6.5059Y-5.561 44 | X6.5059Y-5.8169 45 | X6.5059Y-5.8661 46 | X6.5846Y-5.8169 47 | X6.6142Y-5.4232 48 | X6.6831Y-5.2362 49 | X6.6831Y-5.3543 50 | T3 51 | X5.5906Y-4.6457 52 | X6.5945Y-4.9606 53 | X6.6437Y-4.5571 54 | T4 55 | X5.8366Y-4.6949 56 | X5.8366Y-4.7949 57 | X5.8366Y-4.8949 58 | X5.8366Y-4.9949 59 | X5.8366Y-5.0949 60 | X5.8366Y-5.1949 61 | X5.8366Y-5.2949 62 | X5.8366Y-5.3949 63 | X6.1366Y-4.6949 64 | X6.1366Y-4.7949 65 | X6.1366Y-4.8949 66 | X6.1366Y-4.9949 67 | X6.1366Y-5.0949 68 | X6.1366Y-5.1949 69 | X6.1366Y-5.2949 70 | X6.1366Y-5.3949 71 | X5.2841Y-4.8883 72 | X5.2841Y-5.1883 73 | X5.3841Y-4.8883 74 | X5.3841Y-5.1883 75 | X5.4841Y-4.8883 76 | X5.4841Y-5.1883 77 | X5.5841Y-4.8883 78 | X5.5841Y-5.1883 79 | T5 80 | X5.0378Y-5.3563 81 | X5.0378Y-5.4563 82 | X5.0378Y-5.5563 83 | X5.0378Y-5.6563 84 | X5.0378Y-5.7563 85 | X5.0378Y-5.8563 86 | X5.1378Y-5.3563 87 | X5.1378Y-5.4563 88 | X5.1378Y-5.5563 89 | X5.1378Y-5.6563 90 | X5.1378Y-5.7563 91 | X5.1378Y-5.8563 92 | X6.8996Y-4.9134 93 | X6.8996Y-5.0134 94 | X6.8996Y-5.1134 95 | X6.8996Y-5.2134 96 | X6.8996Y-5.3134 97 | X6.8996Y-5.4134 98 | X6.8996Y-5.5901 99 | X6.8996Y-5.6901 100 | X6.8996Y-5.7901 101 | X6.8996Y-5.8901 102 | X6.8996Y-5.9901 103 | X6.8996Y-6.0901 104 | X5.9184Y-6.1226 105 | X6.0184Y-6.1226 106 | X6.1184Y-6.1226 107 | X6.2184Y-6.1226 108 | X6.3184Y-6.1226 109 | X6.4184Y-6.1226 110 | X5.0492Y-6.122 111 | X5.1492Y-6.122 112 | X5.2492Y-6.122 113 | X5.3492Y-6.122 114 | X5.4492Y-6.122 115 | X5.5492Y-6.122 116 | X5.0295Y-4.5705 117 | X5.0295Y-4.6705 118 | X5.0295Y-4.7705 119 | X5.0295Y-4.8705 120 | X5.0295Y-4.9705 121 | T2 122 | X6.9252Y-4.5315G85X6.8976Y-4.5315 123 | G05 124 | X6.9252Y-4.7992G85X6.8976Y-4.7992 125 | G05 126 | T0 127 | M30 128 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # iceGLITCH 2 | 3 | iceGLITCH is a cheap, fun and terrible voltage glitcher! 4 | 5 | You can use it to inject faults in the voltage line of targets, making them do weird things. 6 | 7 | You can control both the normal and glitch voltage levels, and if you squint and sort of wave your hands a lot, then you can pretend you get ~200ps of resolution for the glitch length (time that the voltage is changed from normal to glitch level). Accuracy, on the other hand, is left as an exercise for the reader.. 8 | 9 | Many people played with this at the 'Hardware Slackers' assembly at 36C3! We're still recovering and will update the repository once we've gotten a few days of good sleep. 10 | 11 | This is what a typical setup looks like: 12 | 13 | ![Image of iceGLITCH setup](images/example_setup.jpeg) 14 | 15 | And this is an example of what a real-world attack looks like (from our 36C3 assembly): 16 | 17 | ![Game controller glitch setup](images/controller_demo.jpeg) 18 | 19 | # Hardware 20 | 21 | You can solder a good-enough (fun!) version of this glitcher using protoboard, 22 | but nowadays we use a PCB version (see the 'pcb' directory). You can solder several 23 | different combinations of components to get different glitcher designs, some of which make more 24 | sense than others; however, we guarantee that all combinations will be both terrible and fun. 25 | 26 | You can use it with any ICE40HX FPGA board with a PMOD connector; we're using the cheap (~22eur) 'iCEstick'. 27 | 28 | Also it turns out you don't have to solder it nicely, it'll work fine anyway: 29 | 30 | ![Image of badly-soldered rev2 board](images/pcb_rev2.jpeg) 31 | 32 | # Code 33 | 34 | The 'TOE' directory contains code for some example targets. 35 | 36 | The FPGA code (to be built using the open source yosys/nextpnr toolchain) is in the 'fpga' directory. We can't write verilog, there are no test cases, it is all terrible. We are sorry, our code is bad and we should feel bad. But it works :D 37 | 38 | The (python) scripts are in the 'scripts' directory, including scripts to attack the example targets. 39 | 40 | ## History/Context 41 | 42 | We built a horrible, horrible 5eur "oscilloscope" for our 35C3 side channel analysis workshop: 43 | the [HorrorScope](https://github.com/albert-spruyt/HorrorScope). 44 | This glitcher is our attempt to build a similar cheap-and-cheerful workshop platform for voltage glitching. 45 | 46 | Some of our friends used it at the HITB CyberWeek in [October 2019](https://twitter.com/AllOurFaults/status/1184734015699464192), and we "released" it at 36C3 in December 2019. 47 | 48 | Thanks to everyone who helped inspire or test our hacks, and thanks to @nedos in particular for making us realize we could 49 | just use a cheap analog switch rather than overcomplicating things! 50 | 51 | -------------------------------------------------------------------------------- /scripts/Drivers/DPS5005.py: -------------------------------------------------------------------------------- 1 | 2 | ''' 3 | DPS5005 cheap tiny lab power supply driver wrapper to make it nicer for glitching tasks 4 | ''' 5 | 6 | 7 | import sys 8 | import time 9 | import rdserial.device 10 | import rdserial.dps.tool 11 | 12 | class DPS5005(): 13 | ''' 14 | DPS5005 cheap tiny lab power supply wrapper class to make glitching nicer 15 | ''' 16 | def __init__(self, serialPort, voltage=None, amps=None, on=True): 17 | powersock = rdserial.device.Serial(serialPort, 9600) 18 | powersock.connect() 19 | power = rdserial.dps.tool.Tool() 20 | power.socket = powersock 21 | power.modbus_client = rdserial.modbus.RTUClient(power.socket, 9600) 22 | 23 | self.prev_voltage = None 24 | self.prev_amps = None 25 | self.prev_on = None 26 | 27 | class Myobj: 28 | '''Helper for modbus''' 29 | all_groups = [] 30 | group = None 31 | modbus_unit = 1 32 | power.args = Myobj() 33 | 34 | self.power = power 35 | 36 | # Setup the defaults 37 | self.set_voltage_amps(voltage, amps) 38 | 39 | self.turn_on(on) 40 | 41 | def set_voltage(self, voltage): 42 | self.power.args.set_volts = voltage 43 | self.power.send_commands() 44 | self.power.args.set_volts = None 45 | 46 | def turn_on(self, on=True): 47 | self.power.args.set_output_state = on 48 | self.power.send_commands() 49 | self.power.args.set_output_state = None 50 | 51 | def set_amps(self, amps): 52 | self.power.args.set_amps = amps 53 | self.power.send_commands() 54 | self.power.args.set_amps = None 55 | 56 | def set_voltage_amps(self, voltage, amps): 57 | change_volt = self.prev_voltage != voltage and voltage 58 | change_amps = self.prev_amps != amps and amps 59 | 60 | self.prev_voltage = voltage 61 | self.prev_amps = amps 62 | 63 | if change_volt and change_amps: 64 | self.power.args.set_amps = amps 65 | self.power.args.set_volts = voltage 66 | self.power.send_commands() 67 | self.power.args.set_amps = None 68 | self.power.args.set_volts = None 69 | elif change_volt: 70 | self.set_voltage(voltage) 71 | elif change_amps: 72 | self.set_amps(amps) 73 | 74 | if change_volt or change_amps: 75 | time.sleep(0.6) 76 | 77 | def close(self): 78 | self.power.powersock.close() 79 | 80 | if __name__ == '__main__': 81 | if len(sys.argv) < 2: 82 | print("USAGE: %s "%sys.argv[0]) 83 | 84 | power_device = DPS5005(sys.argv[1]) 85 | for i in range(0, 1000, 10): 86 | power_device.set_voltage(5.0) 87 | time.sleep(0.5) 88 | power_device.set_voltage(0) 89 | time.sleep(i/1000.) 90 | device_state = power_device.power.assemble_device_state() 91 | print(i, device_state.volts) 92 | -------------------------------------------------------------------------------- /TOE/arduino-nano/main.c: -------------------------------------------------------------------------------- 1 | #define F_CPU 16000000UL 2 | #define USART_BAUDRATE 19200 3 | #define BAUD_PRESCALE ((F_CPU / (USART_BAUDRATE * 16UL)) -1 ) 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | 10 | static void usart_init(){ 11 | UBRR0L = BAUD_PRESCALE & 0xff; 12 | UBRR0H = BAUD_PRESCALE >> 8; 13 | UCSR0B = (1<> 8); 39 | usart_putchar(val & 0xff); 40 | } 41 | 42 | static void usart_putstring(char* string){ 43 | for(;*string;string++) 44 | usart_putchar((uint8_t)*string); 45 | } 46 | static void usart_getbuf(uint8_t* buf,uint8_t len){ 47 | for(uint8_t i=0;i= MAX_MUTES_IN_A_ROW: 87 | print("\nToo many mutes in row resetting: ", end='') 88 | mutes_in_a_row = 0 89 | _reset_target(target) 90 | 91 | # send most of the message 92 | target.write(b'recipe\na') 93 | 94 | # Send parameters to glitcher 95 | glitcher.set_params(attempt['length'] , attempt['delay'], normal_voltage, attempt['volts']) 96 | time.sleep(0.014) 97 | response = target.read(51) 98 | 99 | glitcher.arm() # Tell the glitcher to get ready 100 | 101 | target.write(b'\n') # send last byte and trigger the glitcher 102 | 103 | glitcherTimeout = glitcher.wait_for_glitcher() 104 | response = target.read(100) # Get response data, a glitched target can send more data 105 | 106 | color = 'k' # default to black 107 | mutes_in_a_row += 1 # Unless it's good it was bad ;) 108 | 109 | if glitcherTimeout: 110 | print('[G] The glitcher timed out') 111 | elif b'Incorrect' in response: 112 | print("Correct response!") 113 | mutes_in_a_row = 0 114 | color = 'g' 115 | elif b'Ardu' in response: # short for Arduino 116 | color = 'y' # should really be orange 117 | elif len(response) < len("Incorrect\r\n") or b'know about, nano' in response: 118 | color = 'y' 119 | elif b'rice' in response: 120 | print("Glitch i guess") 121 | response += target.read(100) 122 | color = 'r' 123 | else: 124 | print("TARGET RESPONDED:") 125 | color = 'm' 126 | 127 | # The measurement data to the attempt 128 | attempt['data'] = response 129 | attempt['color'] = color 130 | 131 | database.write(attempt) 132 | 133 | except Exception: 134 | traceback.print_exc() 135 | _test_target(target) 136 | -------------------------------------------------------------------------------- /pcb/pmod2/test2/pmod2-B.Paste.gbr: -------------------------------------------------------------------------------- 1 | %TF.GenerationSoftware,KiCad,Pcbnew,5.0.0+dfsg1-2*% 2 | %TF.CreationDate,2019-12-09T14:25:11+01:00*% 3 | %TF.ProjectId,pmod2,706D6F64322E6B696361645F70636200,rev?*% 4 | %TF.SameCoordinates,Original*% 5 | %TF.FileFunction,Paste,Bot*% 6 | %TF.FilePolarity,Positive*% 7 | %FSLAX46Y46*% 8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 9 | G04 Created by KiCad (PCBNEW 5.0.0+dfsg1-2) date Mon Dec 9 14:25:11 2019* 10 | %MOMM*% 11 | %LPD*% 12 | G01* 13 | G04 APERTURE LIST* 14 | %ADD10C,0.100000*% 15 | %ADD11C,1.150000*% 16 | G04 APERTURE END LIST* 17 | D10* 18 | G36* 19 | X137574505Y-120801204D02* 20 | X137598773Y-120804804D01* 21 | X137622572Y-120810765D01* 22 | X137645671Y-120819030D01* 23 | X137667850Y-120829520D01* 24 | X137688893Y-120842132D01* 25 | X137708599Y-120856747D01* 26 | X137726777Y-120873223D01* 27 | X137743253Y-120891401D01* 28 | X137757868Y-120911107D01* 29 | X137770480Y-120932150D01* 30 | X137780970Y-120954329D01* 31 | X137789235Y-120977428D01* 32 | X137795196Y-121001227D01* 33 | X137798796Y-121025495D01* 34 | X137800000Y-121049999D01* 35 | X137800000Y-121950001D01* 36 | X137798796Y-121974505D01* 37 | X137795196Y-121998773D01* 38 | X137789235Y-122022572D01* 39 | X137780970Y-122045671D01* 40 | X137770480Y-122067850D01* 41 | X137757868Y-122088893D01* 42 | X137743253Y-122108599D01* 43 | X137726777Y-122126777D01* 44 | X137708599Y-122143253D01* 45 | X137688893Y-122157868D01* 46 | X137667850Y-122170480D01* 47 | X137645671Y-122180970D01* 48 | X137622572Y-122189235D01* 49 | X137598773Y-122195196D01* 50 | X137574505Y-122198796D01* 51 | X137550001Y-122200000D01* 52 | X136899999Y-122200000D01* 53 | X136875495Y-122198796D01* 54 | X136851227Y-122195196D01* 55 | X136827428Y-122189235D01* 56 | X136804329Y-122180970D01* 57 | X136782150Y-122170480D01* 58 | X136761107Y-122157868D01* 59 | X136741401Y-122143253D01* 60 | X136723223Y-122126777D01* 61 | X136706747Y-122108599D01* 62 | X136692132Y-122088893D01* 63 | X136679520Y-122067850D01* 64 | X136669030Y-122045671D01* 65 | X136660765Y-122022572D01* 66 | X136654804Y-121998773D01* 67 | X136651204Y-121974505D01* 68 | X136650000Y-121950001D01* 69 | X136650000Y-121049999D01* 70 | X136651204Y-121025495D01* 71 | X136654804Y-121001227D01* 72 | X136660765Y-120977428D01* 73 | X136669030Y-120954329D01* 74 | X136679520Y-120932150D01* 75 | X136692132Y-120911107D01* 76 | X136706747Y-120891401D01* 77 | X136723223Y-120873223D01* 78 | X136741401Y-120856747D01* 79 | X136761107Y-120842132D01* 80 | X136782150Y-120829520D01* 81 | X136804329Y-120819030D01* 82 | X136827428Y-120810765D01* 83 | X136851227Y-120804804D01* 84 | X136875495Y-120801204D01* 85 | X136899999Y-120800000D01* 86 | X137550001Y-120800000D01* 87 | X137574505Y-120801204D01* 88 | X137574505Y-120801204D01* 89 | G37* 90 | D11* 91 | X137225000Y-121500000D03* 92 | D10* 93 | G36* 94 | X139624505Y-120801204D02* 95 | X139648773Y-120804804D01* 96 | X139672572Y-120810765D01* 97 | X139695671Y-120819030D01* 98 | X139717850Y-120829520D01* 99 | X139738893Y-120842132D01* 100 | X139758599Y-120856747D01* 101 | X139776777Y-120873223D01* 102 | X139793253Y-120891401D01* 103 | X139807868Y-120911107D01* 104 | X139820480Y-120932150D01* 105 | X139830970Y-120954329D01* 106 | X139839235Y-120977428D01* 107 | X139845196Y-121001227D01* 108 | X139848796Y-121025495D01* 109 | X139850000Y-121049999D01* 110 | X139850000Y-121950001D01* 111 | X139848796Y-121974505D01* 112 | X139845196Y-121998773D01* 113 | X139839235Y-122022572D01* 114 | X139830970Y-122045671D01* 115 | X139820480Y-122067850D01* 116 | X139807868Y-122088893D01* 117 | X139793253Y-122108599D01* 118 | X139776777Y-122126777D01* 119 | X139758599Y-122143253D01* 120 | X139738893Y-122157868D01* 121 | X139717850Y-122170480D01* 122 | X139695671Y-122180970D01* 123 | X139672572Y-122189235D01* 124 | X139648773Y-122195196D01* 125 | X139624505Y-122198796D01* 126 | X139600001Y-122200000D01* 127 | X138949999Y-122200000D01* 128 | X138925495Y-122198796D01* 129 | X138901227Y-122195196D01* 130 | X138877428Y-122189235D01* 131 | X138854329Y-122180970D01* 132 | X138832150Y-122170480D01* 133 | X138811107Y-122157868D01* 134 | X138791401Y-122143253D01* 135 | X138773223Y-122126777D01* 136 | X138756747Y-122108599D01* 137 | X138742132Y-122088893D01* 138 | X138729520Y-122067850D01* 139 | X138719030Y-122045671D01* 140 | X138710765Y-122022572D01* 141 | X138704804Y-121998773D01* 142 | X138701204Y-121974505D01* 143 | X138700000Y-121950001D01* 144 | X138700000Y-121049999D01* 145 | X138701204Y-121025495D01* 146 | X138704804Y-121001227D01* 147 | X138710765Y-120977428D01* 148 | X138719030Y-120954329D01* 149 | X138729520Y-120932150D01* 150 | X138742132Y-120911107D01* 151 | X138756747Y-120891401D01* 152 | X138773223Y-120873223D01* 153 | X138791401Y-120856747D01* 154 | X138811107Y-120842132D01* 155 | X138832150Y-120829520D01* 156 | X138854329Y-120819030D01* 157 | X138877428Y-120810765D01* 158 | X138901227Y-120804804D01* 159 | X138925495Y-120801204D01* 160 | X138949999Y-120800000D01* 161 | X139600001Y-120800000D01* 162 | X139624505Y-120801204D01* 163 | X139624505Y-120801204D01* 164 | G37* 165 | D11* 166 | X139275000Y-121500000D03* 167 | M02* 168 | -------------------------------------------------------------------------------- /scripts/Drivers/FindSerial.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | ''' 4 | # FindSerial: class to make management of /dev/ttyUSB* devices easier. 5 | # the names in /dev/ttyUSB* change depending on the order they were plugged in. 6 | # Give FindSerial a UNIQUE descriptor and it will give you the right path. 7 | # While the goal is to make this independent of where you plug in the device, 8 | # this isn't always possible: If you have 2 of exactly the same device, 9 | # however you can then use the DEVPATH.. :( 10 | 11 | 12 | # NOTE: Run this file without arguments to see what devices are available: 13 | 14 | 15 | # EXAMPLE in python code 16 | # ser = serial.Serial(port=FindSerial().get_path({'PRODUCT':'403/6010/700', 'DEVPATH': '1.1$'}), 17 | # baudrate=9600 18 | # ) 19 | 20 | ''' 21 | from os import path, listdir 22 | import sys 23 | import re 24 | import pyudev 25 | def _print_device(device): 26 | ttys = [path.join('/dev', f) for f in listdir(device.sys_path) if f.startswith('tty')] 27 | print('#'*60) 28 | if len(ttys) > 0: 29 | print(ttys[0]) 30 | keys = ['ID_VENDOR_FROM_DATABASE', 31 | 'ID_VENDOR_ID', 32 | 'ID_PRODUCT_ID', 33 | 'ID_REVISION', 34 | 'ID_SERIAL', 35 | 'ID_SERIAL_SHORT', 36 | 'ID_USB_DRIVER', 37 | 'ID_INSTANCE', 38 | 'ID_MODEL_ID', 39 | 'PRODUCT', 40 | 'MODALIAS' 41 | ] 42 | for key in keys: 43 | val = device.get(key, None) 44 | if val: 45 | print(key, '\t', val) 46 | 47 | def _match_constraints(constraints, device, tty): 48 | ''' 49 | Match everything against parent device, except DEVPATH!! 50 | Given this is a regexp, mostly wont be able to tell the difference 51 | ''' 52 | for key in constraints.keys(): 53 | if key == 'DEVPATH': 54 | if not re.search(constraints[key], tty[key]): 55 | return False 56 | elif not re.search(constraints[key], device.get(key, 'unknown')): 57 | return False 58 | return True 59 | 60 | def _is_parent(child, parent): 61 | if child.startswith(parent) and parent != child and '/' not in child[len(parent)+1:-1]: 62 | return True 63 | return False 64 | 65 | 66 | class FindSerial: 67 | ''' See module Description ''' 68 | def __init__(self): 69 | self.context = pyudev.Context() 70 | 71 | def get_path(self, constraints): 72 | ''' 73 | Returns a path to the device uniquely identified by constraints. 74 | if a device is not uniquely identified throw an exception 75 | ''' 76 | ret = [] 77 | for tty in self._get_tty_devs(): 78 | for device in self.context.list_devices(subsystem='usb'): 79 | 80 | # The driver we're looking for has a kid which has a /dev/tty* address 81 | if not _is_parent(tty['DEVPATH'], device.get('DEVPATH', 'UNKNOWN')): 82 | continue 83 | 84 | if not _match_constraints(constraints, device, tty): 85 | continue 86 | 87 | if len(tty) > 0: 88 | print("found tty within constraints: ", constraints) 89 | print("tty", tty['tty']) 90 | ret.append(tty['tty']) 91 | 92 | if len(ret) == 1: 93 | return ret[0] 94 | 95 | self.print_serial_devices() 96 | if len(ret) > 1: 97 | message = "Constraints match multiple dev. Constraints: " 98 | message += str(constraints)+" devices: "+str(ret) 99 | raise Exception(message) 100 | raise Exception("Constraint don't match any device: "+str(constraints)) 101 | 102 | def print_serial_devices(self): 103 | '''Print the serial devices and properties which can be used to create constraints.''' 104 | for tty in self._get_tty_devs(): 105 | for device in self.context.list_devices(subsystem='usb'): 106 | if not _is_parent(tty['DEVPATH'], device.get('DEVPATH', 'UNKNOWN')): 107 | continue 108 | if len(tty) > 0: 109 | _print_device(device) 110 | print("TTY", tty) 111 | 112 | def print_all_devices(self): 113 | ''' Print all USB devices and properties which can be used to create constraints''' 114 | for device in self.context.list_devices(subsystem='usb'): 115 | _print_device(device) 116 | 117 | def _get_tty_devs(self): 118 | ret = [] 119 | for dev in self.context.list_devices(subsystem='usb'): 120 | ttys = [path.join('/dev', f) for f in listdir(dev.sys_path) if f.startswith('tty')] 121 | if len(ttys) == 0: 122 | continue 123 | #self._print_device(device) 124 | ret.append({'tty' : ttys[0], 'DEVPATH':dev.get('DEVPATH', None)}) 125 | return ret 126 | 127 | 128 | 129 | if __name__ == '__main__': 130 | if len(sys.argv) > 1: 131 | FindSerial().print_all_devices() 132 | else: 133 | FindSerial().print_serial_devices() 134 | 135 | # print(FindSerial().get_path({'PRODUCT':'403/6010/700', 'DEVPATH': '1.1$'})) 136 | -------------------------------------------------------------------------------- /scripts/Drivers/HorrorScope.py: -------------------------------------------------------------------------------- 1 | import serial 2 | import numpy as np 3 | 4 | class HorrorScope: 5 | def __init__(self, 6 | port='/dev/ttyACM0', 7 | timeout=2.5, 8 | numSamples = 3500, 9 | sampleSpeed=2, # 1=4msps,2=2 msps,3=1 msps (from 0-7 ) 10 | bits12=True, # 12 bit mode? 11 | bias = 0x444, 12 | gain = 0, # Value from 0-7 -> 1,2,4,8,16,32,64,1/2 13 | delay = 0, # wait before sampling (in a non-defined-made-up-unit) 14 | ): 15 | 16 | self.port = port 17 | self.timeout=timeout 18 | 19 | self.serial = None 20 | 21 | self.numSamples = numSamples 22 | self.clockDivider = sampleSpeed 23 | self.bits12 = bits12 24 | self.bias = bias 25 | self.gain = gain 26 | self.delay = delay 27 | 28 | self.reconnect() 29 | 30 | def reconnect(self): 31 | 32 | while True: 33 | if self.serial != None: 34 | self.serial.close() 35 | 36 | self.serial = serial.Serial(port=self.port,baudrate=115200,timeout=self.timeout) 37 | if self._testScope(): 38 | break 39 | 40 | self.setSamples(self.numSamples) 41 | self.setSampleSpeed(self.clockDivider) 42 | self.set12Bits(self.bits12) 43 | self.setBias(self.bias) 44 | self.setGain(self.gain) 45 | self.setDelay(self.delay) 46 | 47 | # This routine is to check if the scope behaves as it should. Cheap trick to find non-responsive boards, half finished commands etc. 48 | def _testScope(self): 49 | print("Testing Scope: if you're getting a lot of dots, reset the scope board. Maybe board is waiting for trigger?") 50 | 51 | oldTimeout = self.serial.timeout 52 | self.serial.timeout = 0.2 53 | 54 | self.serial.write(b't') 55 | val = self.serial.read(10) 56 | ret = False 57 | if val == b'T': 58 | ret = True 59 | elif val == 'T\r\n': 60 | print("Switched target and scope serial ports") 61 | 62 | self.serial.timeout = oldTimeout 63 | 64 | return ret 65 | 66 | 67 | def _checkResponse(self): 68 | response = self.serial.read(1) 69 | if response != b'd': 70 | raise Exception("Incorrect response:"+response.hex()+" extra: "+ self.serial.read(100).hex() ) 71 | 72 | def setSamples(self,numSamples): 73 | self.numSamples = numSamples 74 | assert numSamples <= 0xffff # in reality this should be even lower 75 | self.serial.write(b'n' + bytes([numSamples >> 8, numSamples & 0xff] ) ) 76 | self._checkResponse() 77 | 78 | def set12Bits(self,bits12): 79 | self.bits12 = bits12 80 | if self.bits12: 81 | self.serial.write(b'8\x01') 82 | else: 83 | self.serial.write(b'8\x00') 84 | self._checkResponse() 85 | 86 | 87 | def setBias(self,bias): 88 | assert bias <= 0xffff 89 | self.bias = bias 90 | self.serial.write(bytes([ord('b'), bias >> 8, bias & 0xff])) 91 | self._checkResponse() 92 | 93 | def setDelay(self,delay): 94 | assert delay <= 0xffff 95 | self.delay = delay 96 | self.serial.write(bytes([ord('w'), delay >> 8, delay & 0xff])) 97 | self._checkResponse() 98 | 99 | def setSampleSpeed(self,clockDivider): 100 | assert clockDivider <= 0xff 101 | self.clockDivider = clockDivider 102 | self.serial.write(b'c' + bytes([clockDivider]) ) 103 | self._checkResponse() 104 | 105 | def setGain(self,gain): 106 | assert gain <= 0xff 107 | self.gain = gain 108 | self.serial.write(b'g'+bytes([gain])) 109 | self._checkResponse() 110 | 111 | def waitForCompletion(self): 112 | response = self.serial.read(1) 113 | if response == b'e': 114 | return False 115 | if response == b'd': 116 | return True 117 | raise Exception("incorrect response") 118 | 119 | def arm(self): 120 | self.serial.write(b'd') 121 | armed = self.serial.read(1) 122 | if armed != b'r': 123 | additional = self.serial.read(100) 124 | raise Exception("Scope hasn't armed!" + armed.hex() + "additional" + additional.hex() + ' ' ) 125 | 126 | def getSamples(self): 127 | self.serial.write(b's') 128 | samples = self.serial.read(self.numSamples) 129 | 130 | if len(samples) != self.numSamples: 131 | raise Exception("Scope didn't return enough samples("+str(self.numSamples)+"):" + str(len(samples)) ) 132 | 133 | 134 | #This turns 2 bytes into a int16 135 | if self.bits12: 136 | return np.frombuffer(samples,'>8, glitchLength & 0xff ]) ) 162 | self._checkResponse() 163 | 164 | def setPulses(self,pulses): 165 | assert pulses < 0xff 166 | self.serial.write(b'p' + bytes([ pulses & 0xff ]) ) 167 | self._checkResponse() 168 | 169 | # Note: the glitch command waits for a trigger. Making it a real possibility that this times out 170 | # Return: timed out? 171 | def glitchArm(self): # TODO: this should move to the 'h' command when implemented 172 | self.serial.write(b'h') 173 | response = self.serial.read(1) 174 | return response != b'r' # is it ready? 175 | 176 | def waitForGlitcher(self): 177 | response = self.serial.read(1) 178 | return response != b'd' 179 | 180 | def setDAC(self,value): 181 | #self.serial.write(b'D' + bytes([channel & 1, value>>8, value & 0xff ]) ) 182 | self.serial.write(b'D' + bytes([ value>>8,value & 0xff ]) ) 183 | self._checkResponse() 184 | 185 | 186 | 187 | -------------------------------------------------------------------------------- /scripts/notebook-nano.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Exercise 1: Stealing the recipe\n", 8 | "\n", 9 | "The goal of todays exercise is to steal the paella recipe!\n", 10 | "\n", 11 | "# Step 1 Investiage the target\n", 12 | "\n", 13 | "Lets first investiate the target and have a look around.\n", 14 | "\n", 15 | "1. Remove all USB serial devices\n", 16 | "2. Grab the arduino nano\n", 17 | "3. Connect it to the PC with the mini usb cable.\n", 18 | "4. run: minicom -D /dev/ttyUSB0\n", 19 | "5. Change the baud rate to 19200\n", 20 | "6. Hit the reset button on the arduino a couple of times\n", 21 | "7. Investigate the menu, where can we find the recipe?\n", 22 | "\n", 23 | "# Questions:\n", 24 | "1. What happens when you hit reset on the Arduino nano?\n", 25 | "2. How could we try to get the secret recipe from the nano?\n" 26 | ] 27 | }, 28 | { 29 | "cell_type": "markdown", 30 | "metadata": {}, 31 | "source": [ 32 | "# Step 2 Connecting the glitcher\n", 33 | "\n", 34 | "So after having failed to get the password through logical means (and since we consider extracting the flash through the JTAG interface cheating), It's time to build a glitch setup.\n", 35 | "\n", 36 | "1. REMOVE THE USB MINI CABLE FROM THE ARDUINO !!!!!\n", 37 | "2. Grab the ice stick FPGA board\n", 38 | "3. Place the glitching PMOD on the ICE STICK\n", 39 | "4. Connect the FTDI-serial cable to the Arduino TX and RX pins\n", 40 | "5. Connect the glitcher trigger in to the arduino RX pin TOO\n", 41 | "6. Connect the 5v pin on the arduino to a power pin on the glitcher\n", 42 | "7. Connect the GND pin on the glitcher with the arduino\n" 43 | ] 44 | }, 45 | { 46 | "cell_type": "markdown", 47 | "metadata": {}, 48 | "source": [ 49 | "# Step 3 Investigating the glitching script \n", 50 | "1. Open glitcher/scripts/IceGlitcherNano.py\n", 51 | "2. have a look around\n", 52 | "\n", 53 | "# Questions\n", 54 | "1. Where are the parameters for the glitch?\n", 55 | "2. Why did we connect the RX line of the arduino to the trigger input of the glitcher?\n", 56 | "3. How do we know that we've succeeded in getting the recipe?\n" 57 | ] 58 | }, 59 | { 60 | "cell_type": "markdown", 61 | "metadata": {}, 62 | "source": [ 63 | "# Step 4 Running the glitcher script\n", 64 | "1. Run the ./IceGlitcherNano.py script\n", 65 | "2. wait a bit\n", 66 | "3. Run the cells below\n" 67 | ] 68 | }, 69 | { 70 | "cell_type": "code", 71 | "execution_count": 3, 72 | "metadata": { 73 | "collapsed": false 74 | }, 75 | "outputs": [ 76 | { 77 | "data": { 78 | "text/html": [ 79 | "" 80 | ], 81 | "text/plain": [ 82 | "" 83 | ] 84 | }, 85 | "metadata": {}, 86 | "output_type": "display_data" 87 | }, 88 | { 89 | "name": "stdout", 90 | "output_type": "stream", 91 | "text": [ 92 | "attempt int64\n", 93 | "length float64\n", 94 | "delay float64\n", 95 | "volts float64\n", 96 | "data object\n", 97 | "color object\n", 98 | "dtype: object\n" 99 | ] 100 | } 101 | ], 102 | "source": [ 103 | "from IPython.core.display import display, HTML\n", 104 | "display(HTML(\"\"))\n", 105 | "import pandas\n", 106 | "import matplotlib.pyplot as plt\n", 107 | "from pandas.tools.plotting import scatter_matrix\n", 108 | "%matplotlib inline\n", 109 | "df = pandas.read_csv('/home/albert/devel/glitcher/scripts/log-nano.csv')\n", 110 | "\n", 111 | "df.head() # Displays the top 5 rows. Accepts an optional int parameter - num. of rows to show\n", 112 | "df.tail() # Similar to head, but displays the last rows\n", 113 | "df.shape # The dimensions of the dataframe as a (rows, cols) tuple\n", 114 | "len(df) # The number of columns. Equal to df.shape[0]\n", 115 | "df.columns # An array of the column names\n", 116 | "df.values # Converts the frame to a two-dimensional table\n", 117 | "\n", 118 | "print(df.dtypes)\n", 119 | "None" 120 | ] 121 | }, 122 | { 123 | "cell_type": "code", 124 | "execution_count": null, 125 | "metadata": { 126 | "collapsed": false 127 | }, 128 | "outputs": [], 129 | "source": [ 130 | "# Show all parameters plotted against all parameters\n", 131 | "scatter_matrix(df,c=colors,figsize=[25,25], marker='o')\n", 132 | "# LEGEND: GREEN: target ran as expected YELLOW: target muted or rebooted (we say a boot message) MAGENTA: something weird happened RED: WE HAVE THE RECIPE!\n", 133 | "None" 134 | ] 135 | }, 136 | { 137 | "cell_type": "code", 138 | "execution_count": null, 139 | "metadata": { 140 | "collapsed": false 141 | }, 142 | "outputs": [], 143 | "source": [ 144 | "# Let's have a look at some weird responses.\n", 145 | "df_f = df.loc[ ( df['data'].str.len()> 21) & ( df['color'] == 'm')]\n", 146 | "print(df_f['data'])" 147 | ] 148 | }, 149 | { 150 | "cell_type": "code", 151 | "execution_count": null, 152 | "metadata": { 153 | "collapsed": false 154 | }, 155 | "outputs": [], 156 | "source": [ 157 | "# Lets have a look at voltage vs length only\n", 158 | "df.plot.scatter(x='volts',y='length',c=df['color'], figsize=[20, 10])\n", 159 | "None" 160 | ] 161 | }, 162 | { 163 | "cell_type": "code", 164 | "execution_count": null, 165 | "metadata": { 166 | "collapsed": false 167 | }, 168 | "outputs": [], 169 | "source": [ 170 | "# Do we have the recipe yet?\n", 171 | "print(df.loc[df['color'] == 'r'])" 172 | ] 173 | }, 174 | { 175 | "cell_type": "markdown", 176 | "metadata": {}, 177 | "source": [ 178 | "# If you wait long enough the secret recipe will fall out. But how can we speed up this process?\n", 179 | "This is a simple target so the recipe will drop out some time, but what about harder targets.....\n", 180 | "# Questions\n", 181 | "1. Which relationships do we seen in the plots above?\n", 182 | "2. Which parameters can we tweak to get the results faster? i.e. which parts of the plot are boring?\n", 183 | "3. Whats the recipe\n" 184 | ] 185 | } 186 | ], 187 | "metadata": { 188 | "kernelspec": { 189 | "display_name": "Python 3", 190 | "language": "python", 191 | "name": "python3" 192 | }, 193 | "language_info": { 194 | "codemirror_mode": { 195 | "name": "ipython", 196 | "version": 3 197 | }, 198 | "file_extension": ".py", 199 | "mimetype": "text/x-python", 200 | "name": "python", 201 | "nbconvert_exporter": "python", 202 | "pygments_lexer": "ipython3", 203 | "version": "3.5.3" 204 | } 205 | }, 206 | "nbformat": 4, 207 | "nbformat_minor": 2 208 | } 209 | -------------------------------------------------------------------------------- /fpga/top.v: -------------------------------------------------------------------------------- 1 | `default_nettype none 2 | `include "uart.v" 3 | `include "glitcher.v" 4 | `include "pwm.v" 5 | 6 | module top ( 7 | input clk, 8 | input trigger_in, 9 | output switch_out, 10 | output reg gpio_0, 11 | output reg gpio_1, 12 | input RX, 13 | output TX, 14 | output LED1, 15 | output LED2, 16 | output LED3, 17 | output LED4, 18 | output LED5, 19 | output PWM1, 20 | output PWM2 21 | ); 22 | 23 | wire [3:0] clk_delay; 24 | reg [3:0] clk_delay_target = 4'hf; 25 | 26 | wire clk_fast, clk_fast_faster; 27 | 28 | `ifdef SIM 29 | assign clk_fast = clk; 30 | assign clk_fast_faster = clk; 31 | `else 32 | `ifndef INTERNAL_OSC 33 | SB_PLL40_2F_CORE #( 34 | .FEEDBACK_PATH("SIMPLE"), 35 | .DELAY_ADJUSTMENT_MODE_RELATIVE("DYNAMIC"), 36 | .DELAY_ADJUSTMENT_MODE_FEEDBACK("DYNAMIC"), //Don't touch 37 | .DIVR(4'b0000), // DIVR = 0 38 | .DIVF(7'b0111001), // DIVF = 82 39 | .DIVQ(3'b010), // DIVQ = 3 40 | .FILTER_RANGE(3'b001), // FILTER_RANGE = 1 41 | .FDA_RELATIVE(4'hf), //Not needed 42 | .PLLOUT_SELECT_PORTA("GENCLK"), 43 | .PLLOUT_SELECT_PORTB("GENCLK"), 44 | ) uut ( 45 | .RESETB(1'b1), 46 | .BYPASS(1'b0), 47 | .REFERENCECLK(clk), 48 | .PLLOUTGLOBALA(clk_fast_faster), 49 | .PLLOUTGLOBALB(clk_fast), 50 | .DYNAMICDELAY({clk_delay,4'b0}), 51 | ); 52 | 53 | `endif 54 | `endif 55 | 56 | reg transmit; 57 | reg[7:0] tx_byte; 58 | wire received; 59 | wire[7:0] rx_byte; 60 | wire is_transmitting; 61 | wire rx_error; 62 | reg rx_tmp,rx; 63 | uart myUART(clk, 1'b0, rx, TX, transmit, tx_byte, received, rx_byte, , is_transmitting,rx_error ); 64 | 65 | parameter COMM_IDLE = 0; 66 | parameter COMM_SET_DELAY = 1; 67 | parameter COMM_SET_LENGTH = 2; 68 | parameter COMM_SET_PWM = 3; 69 | parameter COMM_SET_GPIO = 4; 70 | parameter COMM_SET_CLKD = 5; 71 | 72 | // slow-side state 73 | reg armed; 74 | reg[2:0] state = COMM_IDLE; 75 | 76 | parameter TIMEOUT = 2 * 12 * 1000 * 1000; 77 | reg[31:0] timeoutCounter; //Timeout timer for the glitcher (on the slow side!) 78 | reg gpio_0_tmp, gpio_1_tmp; 79 | 80 | // slow-side temporary state 81 | reg[1:0] setting_bits; 82 | 83 | // shared glitcher setup 84 | reg[31:0] delay; 85 | reg[31:0] length; 86 | 87 | reg armed_fast, armed_ack, armed_ack_tmp; 88 | reg done, done_tmp, done_ack; 89 | wire armed_ack_fast, done_fast ; 90 | reg glitcherStop; 91 | 92 | glitcher myGlitcher(clk_fast,clk_fast_faster, trigger_in, armed_fast, armed_ack_fast, done_fast, done_ack, delay, length, switch_out, glitcherStop, clk_delay, clk_delay_target); 93 | 94 | //The PWM values, note: the setting of the PWM values will introduce glitches 95 | //on the line. We hope that the LPF on the line filters this out. 96 | reg pwm_channel_to_set; 97 | reg[9:0] pwm_value1_high; 98 | reg[9:0] pwm_value2_high; 99 | 100 | pwm pwm1(clk_fast,pwm_value1_high,PWM1); 101 | pwm pwm2(clk_fast,pwm_value2_high,PWM2); 102 | 103 | always @(posedge clk) begin 104 | {gpio_1, gpio_0} <= {gpio_1_tmp, gpio_0_tmp}; 105 | {rx,rx_tmp} <= {rx_tmp,RX}; 106 | {armed_ack_tmp, armed_ack} <= {armed_ack_fast, armed_ack_tmp}; 107 | if (armed_ack) 108 | armed_fast <= 0; 109 | {done_tmp, done} <= {done_fast, done_tmp}; 110 | if (done) begin 111 | done_ack <= 1; 112 | armed <= 0; 113 | end 114 | else 115 | done_ack <= 0; 116 | 117 | transmit <= 0; //By default we're not transmitting 118 | case (state) 119 | COMM_IDLE: 120 | begin 121 | glitcherStop<= timeoutCounter == 0; 122 | if(timeoutCounter!=0) begin 123 | timeoutCounter<= timeoutCounter - 1; 124 | end 125 | if (rx_error) begin 126 | state <= COMM_IDLE; 127 | transmit <= 1; 128 | tx_byte <= "Z"; 129 | end else 130 | if (received) begin 131 | // So don't allow setting any weird stuff when armed, 132 | // except maybe the PWM as albert decided he needed it 133 | // for boot attacks 134 | if (armed && ~(rx_byte == "S" || rx_byte == "P" || rx_byte == "G") ) begin 135 | state <= COMM_IDLE; 136 | transmit <= 1; 137 | tx_byte <= "E"; 138 | end else 139 | case (rx_byte) 140 | "S": 141 | begin 142 | state <= COMM_IDLE; 143 | transmit <= 1; 144 | if (armed && glitcherStop) 145 | tx_byte <= "!"; // try again 146 | else if (armed) 147 | tx_byte <= "a"; 148 | else if (glitcherStop) 149 | tx_byte <= "t"; 150 | else 151 | tx_byte <= "i"; 152 | end 153 | "D": 154 | begin 155 | // set delay 156 | setting_bits <= 0; 157 | state <= COMM_SET_DELAY; 158 | end 159 | "L": 160 | begin 161 | // set length 162 | setting_bits <= 0; 163 | state <= COMM_SET_LENGTH; 164 | end 165 | "P": 166 | begin 167 | //set the PWM channel 168 | setting_bits <= 0; 169 | state <= COMM_SET_PWM; 170 | end 171 | "G": 172 | begin 173 | //set the GPO pins 174 | state <= COMM_SET_GPIO; 175 | end 176 | "C": 177 | begin 178 | state <= COMM_SET_CLKD; 179 | end 180 | "A": 181 | begin 182 | // arm 183 | armed <= 1; 184 | armed_fast <= 1; 185 | state <= COMM_IDLE; 186 | transmit <= 1; 187 | tx_byte <= "d"; 188 | glitcherStop <=0; 189 | timeoutCounter <= TIMEOUT; 190 | end 191 | default: 192 | begin 193 | state <= COMM_IDLE; 194 | transmit <= 1; 195 | tx_byte <= "e"; 196 | end 197 | endcase 198 | end 199 | end 200 | COMM_SET_LENGTH: 201 | begin 202 | if (received) begin 203 | length[(setting_bits+1)*8-1 -:8] <= rx_byte; 204 | setting_bits <= setting_bits + 1; 205 | if (setting_bits == 3) begin 206 | state <= COMM_IDLE; 207 | transmit <= 1; 208 | tx_byte <= "d"; 209 | end 210 | end 211 | end 212 | COMM_SET_DELAY: 213 | begin 214 | if (received) begin 215 | delay[(setting_bits+1)*8-1 -:8] <= rx_byte; 216 | setting_bits <= setting_bits + 1; 217 | if (setting_bits == 3) begin 218 | state <= COMM_IDLE; 219 | transmit <= 1; 220 | tx_byte <= "d"; 221 | end 222 | end 223 | end 224 | COMM_SET_PWM: 225 | begin 226 | if (received) begin 227 | case (setting_bits) 228 | "0": 229 | begin 230 | pwm_channel_to_set <= rx_byte; 231 | end 232 | "1": 233 | begin 234 | if(pwm_channel_to_set == 0) begin 235 | pwm_value1_high[9:8] <= rx_byte; 236 | end 237 | else begin 238 | pwm_value2_high[9:8] <= rx_byte; 239 | end 240 | end 241 | "2": 242 | begin 243 | if(pwm_channel_to_set == 0) begin 244 | pwm_value1_high[7:0] <= rx_byte; 245 | end 246 | else begin 247 | pwm_value2_high[7:0] <= rx_byte; 248 | end 249 | state <= COMM_IDLE; 250 | transmit <= 1; 251 | tx_byte <= "d"; 252 | end 253 | endcase 254 | setting_bits <= setting_bits + 1; 255 | end 256 | end 257 | COMM_SET_GPIO: 258 | begin 259 | if (received) begin 260 | {gpio_1_tmp, gpio_0_tmp} <= rx_byte; 261 | state <= COMM_IDLE; 262 | transmit <= 1; 263 | tx_byte <= "d"; 264 | end 265 | end 266 | COMM_SET_CLKD: 267 | begin 268 | if(received) begin 269 | clk_delay_target <= rx_byte; 270 | state <= COMM_IDLE; 271 | transmit <= 1; 272 | tx_byte <= "d"; 273 | end 274 | end 275 | endcase 276 | end 277 | 278 | assign LED5 = 0; 279 | 280 | assign LED1 = rx_error; 281 | assign {LED2,LED3,LED4} = 0; 282 | 283 | endmodule 284 | -------------------------------------------------------------------------------- /pcb/pmod2/test2/pmod2-B.Mask.gbr: -------------------------------------------------------------------------------- 1 | %TF.GenerationSoftware,KiCad,Pcbnew,5.0.0+dfsg1-2*% 2 | %TF.CreationDate,2019-12-09T14:25:11+01:00*% 3 | %TF.ProjectId,pmod2,706D6F64322E6B696361645F70636200,rev?*% 4 | %TF.SameCoordinates,Original*% 5 | %TF.FileFunction,Soldermask,Bot*% 6 | %TF.FilePolarity,Negative*% 7 | %FSLAX46Y46*% 8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 9 | G04 Created by KiCad (PCBNEW 5.0.0+dfsg1-2) date Mon Dec 9 14:25:11 2019* 10 | %MOMM*% 11 | %LPD*% 12 | G01* 13 | G04 APERTURE LIST* 14 | %ADD10C,0.100000*% 15 | %ADD11C,1.550000*% 16 | %ADD12R,2.100000X2.100000*% 17 | %ADD13O,2.100000X2.100000*% 18 | %ADD14R,2.800000X2.000000*% 19 | %ADD15O,2.800000X2.000000*% 20 | %ADD16R,2.000000X2.800000*% 21 | %ADD17O,2.000000X2.800000*% 22 | %ADD18O,2.000000X1.300000*% 23 | G04 APERTURE END LIST* 24 | D10* 25 | G36* 26 | X137696071Y-120601623D02* 27 | X137728781Y-120606475D01* 28 | X137760857Y-120614509D01* 29 | X137791991Y-120625649D01* 30 | X137821884Y-120639787D01* 31 | X137850247Y-120656787D01* 32 | X137876807Y-120676485D01* 33 | X137901308Y-120698692D01* 34 | X137923515Y-120723193D01* 35 | X137943213Y-120749753D01* 36 | X137960213Y-120778116D01* 37 | X137974351Y-120808009D01* 38 | X137985491Y-120839143D01* 39 | X137993525Y-120871219D01* 40 | X137998377Y-120903929D01* 41 | X138000000Y-120936956D01* 42 | X138000000Y-122063044D01* 43 | X137998377Y-122096071D01* 44 | X137993525Y-122128781D01* 45 | X137985491Y-122160857D01* 46 | X137974351Y-122191991D01* 47 | X137960213Y-122221884D01* 48 | X137943213Y-122250247D01* 49 | X137923515Y-122276807D01* 50 | X137901308Y-122301308D01* 51 | X137876807Y-122323515D01* 52 | X137850247Y-122343213D01* 53 | X137821884Y-122360213D01* 54 | X137791991Y-122374351D01* 55 | X137760857Y-122385491D01* 56 | X137728781Y-122393525D01* 57 | X137696071Y-122398377D01* 58 | X137663044Y-122400000D01* 59 | X136786956Y-122400000D01* 60 | X136753929Y-122398377D01* 61 | X136721219Y-122393525D01* 62 | X136689143Y-122385491D01* 63 | X136658009Y-122374351D01* 64 | X136628116Y-122360213D01* 65 | X136599753Y-122343213D01* 66 | X136573193Y-122323515D01* 67 | X136548692Y-122301308D01* 68 | X136526485Y-122276807D01* 69 | X136506787Y-122250247D01* 70 | X136489787Y-122221884D01* 71 | X136475649Y-122191991D01* 72 | X136464509Y-122160857D01* 73 | X136456475Y-122128781D01* 74 | X136451623Y-122096071D01* 75 | X136450000Y-122063044D01* 76 | X136450000Y-120936956D01* 77 | X136451623Y-120903929D01* 78 | X136456475Y-120871219D01* 79 | X136464509Y-120839143D01* 80 | X136475649Y-120808009D01* 81 | X136489787Y-120778116D01* 82 | X136506787Y-120749753D01* 83 | X136526485Y-120723193D01* 84 | X136548692Y-120698692D01* 85 | X136573193Y-120676485D01* 86 | X136599753Y-120656787D01* 87 | X136628116Y-120639787D01* 88 | X136658009Y-120625649D01* 89 | X136689143Y-120614509D01* 90 | X136721219Y-120606475D01* 91 | X136753929Y-120601623D01* 92 | X136786956Y-120600000D01* 93 | X137663044Y-120600000D01* 94 | X137696071Y-120601623D01* 95 | X137696071Y-120601623D01* 96 | G37* 97 | D11* 98 | X137225000Y-121500000D03* 99 | D10* 100 | G36* 101 | X139746071Y-120601623D02* 102 | X139778781Y-120606475D01* 103 | X139810857Y-120614509D01* 104 | X139841991Y-120625649D01* 105 | X139871884Y-120639787D01* 106 | X139900247Y-120656787D01* 107 | X139926807Y-120676485D01* 108 | X139951308Y-120698692D01* 109 | X139973515Y-120723193D01* 110 | X139993213Y-120749753D01* 111 | X140010213Y-120778116D01* 112 | X140024351Y-120808009D01* 113 | X140035491Y-120839143D01* 114 | X140043525Y-120871219D01* 115 | X140048377Y-120903929D01* 116 | X140050000Y-120936956D01* 117 | X140050000Y-122063044D01* 118 | X140048377Y-122096071D01* 119 | X140043525Y-122128781D01* 120 | X140035491Y-122160857D01* 121 | X140024351Y-122191991D01* 122 | X140010213Y-122221884D01* 123 | X139993213Y-122250247D01* 124 | X139973515Y-122276807D01* 125 | X139951308Y-122301308D01* 126 | X139926807Y-122323515D01* 127 | X139900247Y-122343213D01* 128 | X139871884Y-122360213D01* 129 | X139841991Y-122374351D01* 130 | X139810857Y-122385491D01* 131 | X139778781Y-122393525D01* 132 | X139746071Y-122398377D01* 133 | X139713044Y-122400000D01* 134 | X138836956Y-122400000D01* 135 | X138803929Y-122398377D01* 136 | X138771219Y-122393525D01* 137 | X138739143Y-122385491D01* 138 | X138708009Y-122374351D01* 139 | X138678116Y-122360213D01* 140 | X138649753Y-122343213D01* 141 | X138623193Y-122323515D01* 142 | X138598692Y-122301308D01* 143 | X138576485Y-122276807D01* 144 | X138556787Y-122250247D01* 145 | X138539787Y-122221884D01* 146 | X138525649Y-122191991D01* 147 | X138514509Y-122160857D01* 148 | X138506475Y-122128781D01* 149 | X138501623Y-122096071D01* 150 | X138500000Y-122063044D01* 151 | X138500000Y-120936956D01* 152 | X138501623Y-120903929D01* 153 | X138506475Y-120871219D01* 154 | X138514509Y-120839143D01* 155 | X138525649Y-120808009D01* 156 | X138539787Y-120778116D01* 157 | X138556787Y-120749753D01* 158 | X138576485Y-120723193D01* 159 | X138598692Y-120698692D01* 160 | X138623193Y-120676485D01* 161 | X138649753Y-120656787D01* 162 | X138678116Y-120639787D01* 163 | X138708009Y-120625649D01* 164 | X138739143Y-120614509D01* 165 | X138771219Y-120606475D01* 166 | X138803929Y-120601623D01* 167 | X138836956Y-120600000D01* 168 | X139713044Y-120600000D01* 169 | X139746071Y-120601623D01* 170 | X139746071Y-120601623D01* 171 | G37* 172 | D11* 173 | X139275000Y-121500000D03* 174 | D12* 175 | X150327862Y-155515305D03* 176 | D13* 177 | X152867862Y-155515305D03* 178 | X155407862Y-155515305D03* 179 | X157947862Y-155515305D03* 180 | X160487862Y-155515305D03* 181 | X163027862Y-155515305D03* 182 | D12* 183 | X127750000Y-126250000D03* 184 | D13* 185 | X127750000Y-123710000D03* 186 | X127750000Y-121170000D03* 187 | X127750000Y-118630000D03* 188 | X127750000Y-116090000D03* 189 | D12* 190 | X128250000Y-155500000D03* 191 | D13* 192 | X130790000Y-155500000D03* 193 | X133330000Y-155500000D03* 194 | X135870000Y-155500000D03* 195 | X138410000Y-155500000D03* 196 | X140950000Y-155500000D03* 197 | D12* 198 | X175250000Y-137500000D03* 199 | D13* 200 | X175250000Y-134960000D03* 201 | X175250000Y-132420000D03* 202 | X175250000Y-129880000D03* 203 | X175250000Y-127340000D03* 204 | X175250000Y-124800000D03* 205 | X175250000Y-154689415D03* 206 | X175250000Y-152149415D03* 207 | X175250000Y-149609415D03* 208 | X175250000Y-147069415D03* 209 | X175250000Y-144529415D03* 210 | D12* 211 | X175250000Y-141989415D03* 212 | X130500000Y-148750000D03* 213 | D13* 214 | X127960000Y-148750000D03* 215 | X130500000Y-146210000D03* 216 | X127960000Y-146210000D03* 217 | X130500000Y-143670000D03* 218 | X127960000Y-143670000D03* 219 | X130500000Y-141130000D03* 220 | X127960000Y-141130000D03* 221 | X130500000Y-138590000D03* 222 | X127960000Y-138590000D03* 223 | X130500000Y-136050000D03* 224 | X127960000Y-136050000D03* 225 | D14* 226 | X148250000Y-119250000D03* 227 | D15* 228 | X155870000Y-137030000D03* 229 | X148250000Y-121790000D03* 230 | X155870000Y-134490000D03* 231 | X148250000Y-124330000D03* 232 | X155870000Y-131950000D03* 233 | X148250000Y-126870000D03* 234 | X155870000Y-129410000D03* 235 | X148250000Y-129410000D03* 236 | X155870000Y-126870000D03* 237 | X148250000Y-131950000D03* 238 | X155870000Y-124330000D03* 239 | X148250000Y-134490000D03* 240 | X155870000Y-121790000D03* 241 | X148250000Y-137030000D03* 242 | X155870000Y-119250000D03* 243 | D16* 244 | X141836336Y-124164029D03* 245 | D17* 246 | X134216336Y-131784029D03* 247 | X139296336Y-124164029D03* 248 | X136756336Y-131784029D03* 249 | X136756336Y-124164029D03* 250 | X139296336Y-131784029D03* 251 | X134216336Y-124164029D03* 252 | X141836336Y-131784029D03* 253 | D18* 254 | X175550000Y-121900000D03* 255 | X175550000Y-115100000D03* 256 | M02* 257 | -------------------------------------------------------------------------------- /scripts/Drivers/IceGlitcher.py: -------------------------------------------------------------------------------- 1 | ''' Module for: THE ICE GLITSER ''' 2 | import os 3 | import sys 4 | import struct 5 | import serial 6 | import binascii 7 | from Utils import hex_ascii 8 | 9 | def _pack32(val): 10 | return struct.pack("> 8, val & 0xff]) 66 | 67 | class IceGlitcher: 68 | ''' The Ice glitcher!''' 69 | def __init__(self, serial_path): 70 | os.system("setserial %s low_latency"%serial_path) # low latency!!! 71 | self.serial = serial.Serial(serial_path, baudrate=1e6, timeout=0.5) 72 | 73 | done = False 74 | for _ in range(100): 75 | self.serial.write(b'S') 76 | status = self.serial.read(1) 77 | #print(b"status %b" % status) 78 | if status == b'i': 79 | done = True 80 | break 81 | elif status == b't': 82 | done = True 83 | break 84 | 85 | if not done: 86 | raise Exception("IceGlitcher is stuck in arm") 87 | 88 | def _write_cmd(self, cmd, expected=b'd'): 89 | # print(b"write %b" % cmd) 90 | self.serial.write(cmd) 91 | response = self.serial.read(1) 92 | # print(b"got %b" % response) 93 | if response != expected: 94 | print("Bad response (expected %s): %s" % (hex_ascii(expected), hex_ascii(response))) 95 | raise Exception("Bad response (expected %x): %x" % (ord(expected), ord(response))) 96 | 97 | def _set_delay(self, val): 98 | ''' Use set_length_and_delay so that an off-by-one is prevented ''' 99 | self._write_cmd(b'D' + _pack32(val)) 100 | 101 | def _set_length(self, val): 102 | ''' Use set_length_and_delay so that an off-by-one is prevented''' 103 | self._write_cmd(b'L' + _pack32(val)) 104 | 105 | def set_length_and_delay(self, length, delay): 106 | ''' Due to the implementation of the DDR glitch pin, 107 | we need to compensate when a DDR piece is used for the delay 108 | The glitch will appear to start half a clock cycle earlier 109 | 110 | length in nanoseconds and delay in seconds 111 | ''' 112 | delay = _calc_time(delay) 113 | length, clk_delay = _calc_nano_time(length) 114 | if delay & 1 == 0: 115 | length = max(length-1,0) 116 | 117 | self._set_delay(delay) 118 | self._set_length(length) 119 | self.set_clk_delay(clk_delay) 120 | 121 | def set_pwm(self, channel, val): 122 | ''' channel 1 or 2, val: voltage between 0 and 3.3v ''' 123 | self._write_cmd(_prepare_pwm_cmd(channel, val)) 124 | 125 | def set_pwm_raw(self, channel, val): 126 | ''' channel 1 or 2, val: voltage between 0 and 3.3v ''' 127 | cmd = b'P' + bytes([channel, val >> 8, val & 0xff]) 128 | self._write_cmd(cmd) 129 | 130 | def set_gpio(self, bitmap): 131 | ''' Set the 2 GPIO pins in 1 go ''' 132 | self._write_cmd(b'G' + bytes([bitmap & 0x3])) 133 | 134 | def set_clk_delay(self, bitmap): 135 | ''' Set the 2 GPIO pins in 1 go ''' 136 | self._write_cmd(b'C' + bytes([bitmap & 0xf])) 137 | 138 | def arm(self): 139 | ''' Tell the IceGlitcher to get ready for the trigger''' 140 | self._write_cmd(b'A') 141 | 142 | 143 | def wait_for_glitcher(self): 144 | '''After the glitcher has been armed, wait for it to complete glitching''' 145 | while True: 146 | self.serial.write(b'S') 147 | status = self.serial.read(1) 148 | if status == b'i': 149 | return False # good 150 | elif status == b't': 151 | return True # timed out 152 | 153 | def set_params(self, length=None, delay=None, pwm1=None, pwm2=None, translate_pwm0=True, translate_pwm1=True): 154 | '''Set all the parameters in 1 go, this should get rid of the RTT overhead''' 155 | '''PWM goes first as it needs more settling time, however at 1e6...''' 156 | 157 | buf = b'' 158 | sent_messages = 0 159 | if pwm1: 160 | buf += _prepare_pwm_cmd(0, pwm1, translate_pwm0) 161 | sent_messages += 1 162 | if pwm2: 163 | buf += _prepare_pwm_cmd(1, pwm2, translate_pwm1) 164 | sent_messages += 1 165 | if length: 166 | delay = _calc_time(delay) 167 | length, clk_delay = _calc_nano_time(length) 168 | if delay and delay % 2 == 1: # do we have DDR delay? 169 | length = max(length-1,0) 170 | if length & 1 == 1: # we have a DDR length 171 | clk_delay = (clk_delay + 9) & 0xf 172 | 173 | if clk_delay <= 8: # handle the phase inversion 174 | length = ((length & 0xffFFffFe) << 1) + 1 175 | else: 176 | length = ((length & 0xffFFffFe) << 1) + 2 177 | 178 | 179 | else: 180 | length = (length << 1) + 0 181 | clk_delay = (clk_delay + 9) & 0xf 182 | 183 | buf += b'L' + _pack32(length) 184 | buf += b'C' + bytes([clk_delay]) 185 | sent_messages += 2 186 | 187 | if delay: 188 | buf += b'D' + _pack32(delay) 189 | sent_messages += 1 190 | 191 | self.serial.write(buf) 192 | recv = self.serial.read(sent_messages) 193 | 194 | if recv != b'd' * sent_messages: 195 | raise Exception("Received incorrect output for:"+str(recv)+" messages: "+str(sent_messages)) 196 | sys.exit(-1) 197 | 198 | def status(self): 199 | ''' Is the glitcher ready to start glitching''' 200 | self.serial.write(b'S') 201 | return self.serial.read(1) 202 | -------------------------------------------------------------------------------- /fpga/uart.v: -------------------------------------------------------------------------------- 1 | `timescale 1ns / 1ps 2 | `default_nettype none 3 | // Documented Verilog UART 4 | // Copyright (C) 2010 Timothy Goddard (tim@goddard.net.nz) 5 | // Distributed under the MIT licence. 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | // 25 | module uart( 26 | input clk, // The master clock for this module 27 | input rst, // Synchronous reset. 28 | input rx, // Incoming serial line 29 | output tx, // Outgoing serial line 30 | input transmit, // Signal to transmit 31 | input [7:0] tx_byte, // Byte to transmit 32 | output received, // Indicated that a byte has been received. 33 | output [7:0] rx_byte, // Byte received 34 | output is_receiving, // Low when receive line is idle. 35 | output is_transmitting, // Low when transmit line is idle. 36 | output recv_error // Indicates error in receiving packet. 37 | ); 38 | 39 | //parameter CLOCK_DIVIDE = 312; // clock rate (12Mhz) / (baud rate (9600) * 4) 40 | //parameter CLOCK_DIVIDE = 26; // clock rate (12Mhz) / (baud rate (115200) * 4) 41 | 42 | parameter CLOCK_DIVIDE = 3; // clock rate (12Mhz) / (baud rate (1e6) * 4) 43 | 44 | 45 | // States for the receiving state machine. 46 | // These are just constants, not parameters to override. 47 | parameter RX_IDLE = 0; 48 | parameter RX_CHECK_START = 1; 49 | parameter RX_READ_BITS = 2; 50 | parameter RX_CHECK_STOP = 3; 51 | parameter RX_DELAY_RESTART = 4; 52 | parameter RX_ERROR = 5; 53 | parameter RX_RECEIVED = 6; 54 | 55 | // States for the transmitting state machine. 56 | // Constants - do not override. 57 | parameter TX_IDLE = 0; 58 | parameter TX_SENDING = 1; 59 | parameter TX_DELAY_RESTART = 2; 60 | 61 | reg [10:0] rx_clk_divider = CLOCK_DIVIDE; 62 | reg [10:0] tx_clk_divider = CLOCK_DIVIDE; 63 | 64 | reg [2:0] recv_state = RX_IDLE; 65 | reg [5:0] rx_countdown; 66 | reg [3:0] rx_bits_remaining; 67 | reg [7:0] rx_data; 68 | 69 | reg tx_out = 1'b1; 70 | reg [1:0] tx_state = TX_IDLE; 71 | reg [5:0] tx_countdown; 72 | reg [3:0] tx_bits_remaining; 73 | reg [7:0] tx_data; 74 | 75 | assign received = recv_state == RX_RECEIVED; 76 | assign recv_error = recv_state == RX_ERROR; 77 | assign is_receiving = recv_state != RX_IDLE; 78 | assign rx_byte = rx_data; 79 | 80 | assign tx = tx_out; 81 | assign is_transmitting = tx_state != TX_IDLE; 82 | 83 | always @(posedge clk) begin 84 | if (rst) begin 85 | recv_state = RX_IDLE; 86 | tx_state = TX_IDLE; 87 | end 88 | 89 | // The clk_divider counter counts down from 90 | // the CLOCK_DIVIDE constant. Whenever it 91 | // reaches 0, 1/16 of the bit period has elapsed. 92 | // Countdown timers for the receiving and transmitting 93 | // state machines are decremented. 94 | rx_clk_divider = rx_clk_divider - 1; 95 | if (!rx_clk_divider) begin 96 | rx_clk_divider = CLOCK_DIVIDE; 97 | rx_countdown = rx_countdown - 1; 98 | end 99 | tx_clk_divider = tx_clk_divider - 1; 100 | if (!tx_clk_divider) begin 101 | tx_clk_divider = CLOCK_DIVIDE; 102 | tx_countdown = tx_countdown - 1; 103 | end 104 | 105 | // Receive state machine 106 | case (recv_state) 107 | RX_IDLE: begin 108 | // A low pulse on the receive line indicates the 109 | // start of data. 110 | if (!rx) begin 111 | // Wait half the period - should resume in the 112 | // middle of this first pulse. 113 | rx_clk_divider = CLOCK_DIVIDE; 114 | rx_countdown = 2; 115 | recv_state = RX_CHECK_START; 116 | end 117 | end 118 | RX_CHECK_START: begin 119 | if (!rx_countdown) begin 120 | // Check the pulse is still there 121 | if (!rx) begin 122 | // Pulse still there - good 123 | // Wait the bit period to resume half-way 124 | // through the first bit. 125 | rx_countdown = 4; 126 | rx_bits_remaining = 8; 127 | recv_state = RX_READ_BITS; 128 | end else begin 129 | // Pulse lasted less than half the period - 130 | // not a valid transmission. 131 | recv_state = RX_ERROR; 132 | end 133 | end 134 | end 135 | RX_READ_BITS: begin 136 | if (!rx_countdown) begin 137 | // Should be half-way through a bit pulse here. 138 | // Read this bit in, wait for the next if we 139 | // have more to get. 140 | rx_data = {rx, rx_data[7:1]}; 141 | rx_countdown = 4; 142 | rx_bits_remaining = rx_bits_remaining - 1; 143 | recv_state = rx_bits_remaining ? RX_READ_BITS : RX_CHECK_STOP; 144 | end 145 | end 146 | RX_CHECK_STOP: begin 147 | if (!rx_countdown) begin 148 | // Should resume half-way through the stop bit 149 | // This should be high - if not, reject the 150 | // transmission and signal an error. 151 | recv_state = rx ? RX_RECEIVED : RX_ERROR; 152 | end 153 | end 154 | RX_DELAY_RESTART: begin 155 | // Waits a set number of cycles before accepting 156 | // another transmission. 157 | recv_state = rx_countdown ? RX_DELAY_RESTART : RX_IDLE; 158 | end 159 | RX_ERROR: begin 160 | // There was an error receiving. 161 | // Raises the recv_error flag for one clock 162 | // cycle while in this state and then waits 163 | // 2 bit periods before accepting another 164 | // transmission. 165 | rx_countdown = 8; 166 | recv_state = RX_DELAY_RESTART; 167 | end 168 | RX_RECEIVED: begin 169 | // Successfully received a byte. 170 | // Raises the received flag for one clock 171 | // cycle while in this state. 172 | recv_state = RX_IDLE; 173 | end 174 | endcase 175 | 176 | // Transmit state machine 177 | case (tx_state) 178 | TX_IDLE: begin 179 | if (transmit) begin 180 | // If the transmit flag is raised in the idle 181 | // state, start transmitting the current content 182 | // of the tx_byte input. 183 | tx_data = tx_byte; 184 | // Send the initial, low pulse of 1 bit period 185 | // to signal the start, followed by the data 186 | tx_clk_divider = CLOCK_DIVIDE; 187 | tx_countdown = 4; 188 | tx_out = 0; 189 | tx_bits_remaining = 8; 190 | tx_state = TX_SENDING; 191 | end 192 | end 193 | TX_SENDING: begin 194 | if (!tx_countdown) begin 195 | if (tx_bits_remaining) begin 196 | tx_bits_remaining = tx_bits_remaining - 1; 197 | tx_out = tx_data[0]; 198 | tx_data = {1'b0, tx_data[7:1]}; 199 | tx_countdown = 4; 200 | tx_state = TX_SENDING; 201 | end else begin 202 | // Set delay to send out 2 stop bits. 203 | tx_out = 1; 204 | tx_countdown = 8; 205 | tx_state = TX_DELAY_RESTART; 206 | end 207 | end 208 | end 209 | TX_DELAY_RESTART: begin 210 | // Wait until tx_countdown reaches the end before 211 | // we send another transmission. This covers the 212 | // "stop bit" delay. 213 | tx_state = tx_countdown ? TX_DELAY_RESTART : TX_IDLE; 214 | end 215 | endcase 216 | end 217 | 218 | endmodule 219 | -------------------------------------------------------------------------------- /scripts/Drivers/Picoscope3000a.py: -------------------------------------------------------------------------------- 1 | import ctypes 2 | from picosdk.ps3000a import ps3000a as ps 3 | import numpy as np 4 | import matplotlib.pyplot as plt 5 | from picosdk.functions import adc2mV, assert_pico_ok 6 | 7 | class Picoscope3000a: 8 | def __init__(self): 9 | # Create chandle and status ready for use 10 | self.status = {} 11 | self.chandle = ctypes.c_int16() 12 | 13 | # Opens the device/s 14 | self.status["openunit"] = ps.ps3000aOpenUnit(ctypes.byref(self.chandle), None) 15 | 16 | 17 | 18 | try: 19 | assert_pico_ok(self.status["openunit"]) 20 | except: 21 | 22 | # powerstate becomes the status number of openunit 23 | powerstate = self.status["openunit"] 24 | 25 | # If powerstate is the same as 282 then it will run this if statement 26 | if powerstate == 282: 27 | # Changes the power input to "PICO_POWER_SUPPLY_NOT_CONNECTED" 28 | self.status["ChangePowerSource"] = ps.ps3000aChangePowerSource(self.chandle, 282) 29 | # If the powerstate is the same as 286 then it will run this if statement 30 | elif powerstate == 286: 31 | # Changes the power input to "PICO_USB3_0_DEVICE_NON_USB3_0_PORT" 32 | self.status["ChangePowerSource"] = ps.ps3000aChangePowerSource(self.chandle, 286) 33 | else: 34 | raise 35 | 36 | assert_pico_ok(self.status["ChangePowerSource"]) 37 | 38 | # Channel : A=0,B=1,C=2,D=3,EXT=4? 39 | # enabled : False=0,True=1 40 | # Coupling: AC=0,DC=1 41 | # Range = 50mV=1 100mV=2 200mV=3 500mV=4 1V=5 2V=6 5V=7 10V=8 20V=9 42 | # Analogue_offset = TODO, looks really nice though 43 | 44 | def setChannel(self,channel,enabled=1,coupling_type=1,Range = 8,analogue_offset=0): 45 | # Set up channel A 46 | # handle = chandle 47 | # channel = PS3000A_CHANNEL_A = 0 48 | # enabled = 1 49 | # coupling type = PS3000A_DC = 1 50 | # range = PS3000A_10V = 8 51 | # analogue offset = 0 V 52 | self.chARange = Range 53 | self.status["setChA"] = ps.ps3000aSetChannel(self.chandle, channel, enabled, coupling_type, Range, analogue_offset) 54 | assert_pico_ok(self.status["setChA"]) 55 | 56 | # source: B = 0 ? 57 | # enable: 58 | 59 | def setTrigger(self,channel,enable=1,threshold=1024,direction=3,delay=0,autoTrigger_ms=5000): 60 | # Sets up single trigger 61 | # Handle = Chandle 62 | # Source = ps3000A_channel_B = 0 63 | # Enable = 0 64 | # Threshold = 1024 ADC counts 65 | # Direction = ps3000A_Falling = 3 66 | # Delay = 0 67 | # autoTrigger_ms = 1000 68 | self.status["trigger"] = ps.ps3000aSetSimpleTrigger(self.chandle,channel,enable,threshold,direction,delay, autoTrigger_ms) 69 | assert_pico_ok(self.status["trigger"]) 70 | 71 | def setTimebase(self,postTriggerSamples=0,preTriggerSamples=0, timebase=2): 72 | # Gets timebase innfomation 73 | # Handle = chandle 74 | # Timebase = 2 = timebase 75 | # Nosample = maxsamples 76 | # TimeIntervalNanoseconds = ctypes.byref(timeIntervalns) 77 | # MaxSamples = ctypes.byref(returnedMaxSamples) 78 | # Segement index = 0 79 | self.timebase = timebase 80 | self.preTriggerSamples=int(preTriggerSamples) 81 | self.postTriggerSamples=int(postTriggerSamples) 82 | self.maxsamples=preTriggerSamples+postTriggerSamples 83 | self.timeIntervalns = ctypes.c_float() 84 | self.returnedMaxSamples = ctypes.c_int16() 85 | segment_index=0 86 | self.status["GetTimebase"] = ps.ps3000aGetTimebase2(self.chandle, timebase, self.maxsamples, ctypes.byref(self.timeIntervalns), 1, ctypes.byref(self.returnedMaxSamples), segment_index) 87 | assert_pico_ok(self.status["GetTimebase"]) 88 | 89 | 90 | def arm(self): 91 | # Creates a overlow location for data 92 | self.overflow = ctypes.c_int16() 93 | # Creates converted types maxsamples 94 | self.cmaxSamples = ctypes.c_int32(self.maxsamples) 95 | 96 | # Starts the block capture 97 | # Handle = chandle 98 | # Number of prTriggerSamples 99 | # Number of postTriggerSamples 100 | # Timebase = 2 = 4ns (see Programmer's guide for more information on timebases) 101 | # time indisposed ms = None (This is not needed within the example) 102 | # Segment index = 0 103 | # LpRead = None 104 | # pParameter = None 105 | self.status["runblock"] = ps.ps3000aRunBlock(self.chandle, self.preTriggerSamples, self.postTriggerSamples, self.timebase, 1, None, 0, None, None) 106 | assert_pico_ok(self.status["runblock"]) 107 | 108 | # Create buffers ready for assigning pointers for data collection 109 | self.bufferAMax = (ctypes.c_int16 * self.maxsamples)() 110 | self.bufferAMin = (ctypes.c_int16 * self.maxsamples)() # used for downsampling which isn't in the scope of this example 111 | 112 | # Setting the data buffer location for data collection from channel A 113 | # Handle = Chandle 114 | # source = ps3000A_channel_A = 0 115 | # Buffer max = ctypes.byref(bufferAMax) 116 | # Buffer min = ctypes.byref(bufferAMin) 117 | # Buffer length = maxsamples 118 | # Segment index = 0 119 | # Ratio mode = ps3000A_Ratio_Mode_None = 0 120 | self.status["SetDataBuffers"] = ps.ps3000aSetDataBuffers(self.chandle, 0, ctypes.byref(self.bufferAMax), ctypes.byref(self.bufferAMin), self.maxsamples, 0, 0) 121 | assert_pico_ok(self.status["SetDataBuffers"]) 122 | 123 | # Creates a overlow location for data 124 | self.overflow = (ctypes.c_int16 * 10)() 125 | # Creates converted types maxsamples 126 | self.cmaxSamples = ctypes.c_int32(self.maxsamples) 127 | 128 | 129 | def get_samples(self): 130 | # Checks data collection to finish the capture 131 | ready = ctypes.c_int16(0) 132 | check = ctypes.c_int16(0) 133 | while ready.value == check.value: # Note: we assume that the AUTOTRIGGER function is used here 134 | self.status["isReady"] = ps.ps3000aIsReady(self.chandle, ctypes.byref(ready)) 135 | 136 | # Handle = chandle 137 | # start index = 0 138 | # noOfSamples = ctypes.byref(cmaxSamples) 139 | # DownSampleRatio = 0 140 | # DownSampleRatioMode = 0 141 | # SegmentIndex = 0 142 | # Overflow = ctypes.byref(overflow) 143 | 144 | self.status["GetValues"] = ps.ps3000aGetValues(self.chandle, 0, ctypes.byref(self.cmaxSamples), 0, 0, 0, ctypes.byref(self.overflow)) 145 | assert_pico_ok(self.status["GetValues"]) 146 | 147 | # Finds the max ADC count 148 | # Handle = chandle 149 | # Value = ctype.byref(maxADC) 150 | maxADC = ctypes.c_int16() 151 | self.status["maximumValue"] = ps.ps3000aMaximumValue(self.chandle, ctypes.byref(maxADC)) 152 | assert_pico_ok(self.status["maximumValue"]) 153 | 154 | # Converts ADC from channel A to mV 155 | adc2mVChAMax = adc2mV(self.bufferAMax, self.chARange, maxADC) 156 | 157 | # Creates the time data 158 | #time = np.linspace(0, (self.cmaxSamples.value) * timeIntervalns.value, self.cmaxSamples.value) 159 | #print self.bufferAMax 160 | #return np.array(self.bufferAMax,dtype='int16') 161 | return np.array(adc2mVChAMax) 162 | 163 | 164 | def close(self): 165 | self.status["stop"] = ps.ps3000aStop(self.chandle) 166 | assert_pico_ok(self.status["stop"]) 167 | 168 | # Closes the unit 169 | # Handle = chandle 170 | self.status["close"] = ps.ps3000aCloseUnit(self.chandle) 171 | assert_pico_ok(self.status["close"]) 172 | -------------------------------------------------------------------------------- /scripts/Utils/Utils.py: -------------------------------------------------------------------------------- 1 | ''' Random utility functions ''' 2 | 3 | from random import randint, uniform 4 | import subprocess 5 | 6 | 7 | def hex_ascii(data): 8 | '''converts a byte string into string with non-printable ascii as dots''' 9 | ret = '' 10 | for dat in data: 11 | if 0x20 <= dat <= 0x80: 12 | ret += chr(dat) 13 | else: 14 | ret += '.' 15 | return ret 16 | 17 | def random_float(min_v, max_v, repeat=1): 18 | ''' Parameter generator which can take a repeat''' 19 | while True: 20 | val = uniform(min_v, max_v) 21 | for i in range(repeat): 22 | i = i 23 | yield val 24 | 25 | def random_int(min_v, max_v, repeat=1): 26 | ''' Parameter generator which can take a repeat''' 27 | while True: 28 | val = randint(min_v, max_v) 29 | for i in range(repeat): 30 | i = i 31 | return val 32 | 33 | 34 | def run_command(command): 35 | ''' Run a command in a shell, no user supplied input allowed 36 | but why is the sentence so long? 37 | ''' 38 | return subprocess.Popen(command, shell=True, stdout=subprocess.PIPE).stdout.read() 39 | 40 | 41 | def random_in_poly(x_coords, y_coords): 42 | ''' Returns coordinates within a polygon from a uniform distribution''' 43 | 44 | # We compute the bounding box of the polygon and then repeatedly 45 | # Pick a point in the bounding box until we find one which is within the polygon 46 | # We're not expecting pathological polygons (uh-oh) 47 | min_x, max_x = min(x_coords), max(x_coords) 48 | min_y, max_y = min(y_coords), max(y_coords) 49 | poly = Polygon(x_coords, y_coords) 50 | print("minx", min_x, "max_x", max_x) 51 | print("miny", min_y, "max_y", max_y) 52 | 53 | while True: 54 | x, y = 0, 0 55 | while True: 56 | x, y = uniform(min_x, max_x), uniform(min_y, max_y) 57 | 58 | if poly.is_inside(x, y) > 0: 59 | break 60 | return x, y 61 | 62 | 63 | 64 | '''FROM: https://code.activestate.com/recipes/578381-a-point-in-polygon-program-sw-sloan-algorithm/ ''' 65 | '''Class to compute if a point lies inside/outside/on-side of a polygon. 66 | 67 | This is a Python 3 implementation of the Sloan's improved version of the 68 | Nordbeck and Rystedt algorithm, published in the paper: 69 | 70 | SLOAN, S.W. (1985): A point-in-polygon program. 71 | Adv. Eng. Software, Vol 7, No. 1, pp 45-47. 72 | 73 | This class has 1 method (is_inside) that returns the minimum distance to the 74 | nearest point of the polygon: 75 | 76 | If is_inside < 0 then point is outside the polygon. 77 | If is_inside = 0 then point in on a side of the polygon. 78 | If is_inside > 0 then point is inside the polygon. 79 | 80 | ''' 81 | 82 | import numpy as np 83 | 84 | 85 | def _det(xvert, yvert): 86 | '''Compute twice the area of the triangle defined by points with using 87 | determinant formula. 88 | 89 | Input parameters: 90 | 91 | xvert -- A vector of nodal x-coords (array-like). 92 | yvert -- A vector of nodal y-coords (array-like). 93 | 94 | Output parameters: 95 | 96 | Twice the area of the triangle defined by the points. 97 | 98 | Notes: 99 | 100 | _det is positive if points define polygon in anticlockwise order. 101 | _det is negative if points define polygon in clockwise order. 102 | _det is zero if at least two of the points are concident or if 103 | all points are collinear. 104 | 105 | ''' 106 | xvert = np.asfarray(xvert) 107 | yvert = np.asfarray(yvert) 108 | x_prev = np.concatenate(([xvert[-1]], xvert[:-1])) 109 | y_prev = np.concatenate(([yvert[-1]], yvert[:-1])) 110 | return np.sum(yvert * x_prev - xvert * y_prev, axis=0) 111 | 112 | 113 | class Polygon: 114 | '''Polygon object. 115 | 116 | Input parameters: 117 | 118 | x -- A sequence of nodal x-coords. 119 | y -- A sequence of nodal y-coords. 120 | 121 | ''' 122 | 123 | def __init__(self, x, y): 124 | if len(x) != len(y): 125 | raise IndexError('x and y must be equally sized.') 126 | self.x = np.asfarray(x) 127 | self.y = np.asfarray(y) 128 | # Closes the polygon if were open 129 | x1, y1 = x[0], y[0] 130 | xn, yn = x[-1], y[-1] 131 | if x1 != xn or y1 != yn: 132 | self.x = np.concatenate((self.x, [x1])) 133 | self.y = np.concatenate((self.y, [y1])) 134 | # Anti-clockwise coordinates 135 | if _det(self.x, self.y) < 0: 136 | self.x = self.x[::-1] 137 | self.y = self.y[::-1] 138 | 139 | def is_inside(self, xpoint, ypoint, smalld=1e-12): 140 | '''Check if point is inside a general polygon. 141 | 142 | Input parameters: 143 | 144 | xpoint -- The x-coord of the point to be tested. 145 | ypoint -- The y-coords of the point to be tested. 146 | smalld -- A small float number. 147 | 148 | xpoint and ypoint could be scalars or array-like sequences. 149 | 150 | Output parameters: 151 | 152 | mindst -- The distance from the point to the nearest point of the 153 | polygon. 154 | If mindst < 0 then point is outside the polygon. 155 | If mindst = 0 then point in on a side of the polygon. 156 | If mindst > 0 then point is inside the polygon. 157 | 158 | Notes: 159 | 160 | An improved version of the algorithm of Nordbeck and Rydstedt. 161 | 162 | REF: SLOAN, S.W. (1985): A point-in-polygon program. Adv. Eng. 163 | Software, Vol 7, No. 1, pp 45-47. 164 | 165 | ''' 166 | xpoint = np.asfarray(xpoint) 167 | ypoint = np.asfarray(ypoint) 168 | # Scalar to array 169 | if xpoint.shape is tuple(): 170 | xpoint = np.array([xpoint], dtype=float) 171 | ypoint = np.array([ypoint], dtype=float) 172 | scalar = True 173 | else: 174 | scalar = False 175 | # Check consistency 176 | if xpoint.shape != ypoint.shape: 177 | raise IndexError('x and y has different shapes') 178 | # If snear = True: Dist to nearest side < nearest vertex 179 | # If snear = False: Dist to nearest vertex < nearest side 180 | snear = np.ma.masked_all(xpoint.shape, dtype=bool) 181 | # Initialize arrays 182 | mindst = np.ones_like(xpoint, dtype=float) * np.inf 183 | j = np.ma.masked_all(xpoint.shape, dtype=int) 184 | x = self.x 185 | y = self.y 186 | n = len(x) - 1 # Number of sides/vertices defining the polygon 187 | # Loop over each side defining polygon 188 | for i in range(n): 189 | d = np.ones_like(xpoint, dtype=float) * np.inf 190 | # Start of side has coords (x1, y1) 191 | # End of side has coords (x2, y2) 192 | # Point has coords (xpoint, ypoint) 193 | x1 = x[i] 194 | y1 = y[i] 195 | x21 = x[i + 1] - x1 196 | y21 = y[i + 1] - y1 197 | x1p = x1 - xpoint 198 | y1p = y1 - ypoint 199 | # Points on infinite line defined by 200 | # x = x1 + t * (x1 - x2) 201 | # y = y1 + t * (y1 - y2) 202 | # where 203 | # t = 0 at (x1, y1) 204 | # t = 1 at (x2, y2) 205 | # Find where normal passing through (xpoint, ypoint) intersects 206 | # infinite line 207 | t = -(x1p * x21 + y1p * y21) / (x21 ** 2 + y21 ** 2) 208 | tlt0 = t < 0 209 | tle1 = (0 <= t) & (t <= 1) 210 | # Normal intersects side 211 | d[tle1] = ((x1p[tle1] + t[tle1] * x21) ** 2 + 212 | (y1p[tle1] + t[tle1] * y21) ** 2) 213 | # Normal does not intersects side 214 | # Point is closest to vertex (x1, y1) 215 | # Compute square of distance to this vertex 216 | d[tlt0] = x1p[tlt0] ** 2 + y1p[tlt0] ** 2 217 | # Store distances 218 | mask = d < mindst 219 | mindst[mask] = d[mask] 220 | j[mask] = i 221 | # Point is closer to (x1, y1) than any other vertex or side 222 | snear[mask & tlt0] = False 223 | # Point is closer to this side than to any other side or vertex 224 | snear[mask & tle1] = True 225 | if np.ma.count(snear) != snear.size: 226 | raise IndexError('Error computing distances') 227 | mindst **= 0.5 228 | # Point is closer to its nearest vertex than its nearest side, check if 229 | # nearest vertex is concave. 230 | # If the nearest vertex is concave then point is inside the polygon, 231 | # else the point is outside the polygon. 232 | jo = j.copy() 233 | jo[j == 0] -= 1 234 | area = _det([x[j + 1], x[j], x[jo - 1]], [y[j + 1], y[j], y[jo - 1]]) 235 | mindst[~snear] = np.copysign(mindst, area)[~snear] 236 | # Point is closer to its nearest side than to its nearest vertex, check 237 | # if point is to left or right of this side. 238 | # If point is to left of side it is inside polygon, else point is 239 | # outside polygon. 240 | area = _det([x[j], x[j + 1], xpoint], [y[j], y[j + 1], ypoint]) 241 | mindst[snear] = np.copysign(mindst, area)[snear] 242 | # Point is on side of polygon 243 | mindst[np.fabs(mindst) < smalld] = 0 244 | # If input values were scalar then the output should be too 245 | if scalar: 246 | mindst = float(mindst) 247 | return mindst 248 | -------------------------------------------------------------------------------- /pcb/pmod2/pmod2-cache.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.4 2 | #encoding utf-8 3 | # 4 | # Amplifier_Operational:L272M 5 | # 6 | DEF Amplifier_Operational:L272M U 0 5 Y Y 3 L N 7 | F0 "U" 0 200 50 H V L CNN 8 | F1 "Amplifier_Operational:L272M" 0 -200 50 H V L CNN 9 | F2 "Package_DIP:DIP-8_W7.62mm_LongPads" 0 0 50 H I C CNN 10 | F3 "" 0 0 50 H I C CNN 11 | $FPLIST 12 | *DIP*W7.62mm* 13 | $ENDFPLIST 14 | DRAW 15 | P 4 1 1 10 -200 200 200 0 -200 -200 -200 200 f 16 | P 4 2 1 10 -200 200 200 0 -200 -200 -200 200 f 17 | X ~ 1 300 0 100 L 50 50 1 1 O 18 | X + 7 -300 100 100 R 50 50 1 1 I 19 | X - 8 -300 -100 100 R 50 50 1 1 I 20 | X ~ 3 300 0 100 L 50 50 2 1 O 21 | X - 5 -300 -100 100 R 50 50 2 1 I 22 | X + 6 -300 100 100 R 50 50 2 1 I 23 | X V+ 2 -100 300 150 D 50 50 3 1 W 24 | X V- 4 -100 -300 150 U 50 50 3 1 W 25 | ENDDRAW 26 | ENDDEF 27 | # 28 | # Amplifier_Operational:THS4631DDA 29 | # 30 | DEF Amplifier_Operational:THS4631DDA U 0 5 Y Y 1 F N 31 | F0 "U" 0 250 50 H V L CNN 32 | F1 "Amplifier_Operational:THS4631DDA" 0 150 50 H V L CNN 33 | F2 "" 0 0 50 H I L CNN 34 | F3 "" 150 150 50 H I C CNN 35 | ALIAS THS4631DGN 36 | $FPLIST 37 | SOIC*EP*3.9x4.9mm*P1.27mm* 38 | MSOP*EP*3x3mm*P0.65mm* 39 | $ENDFPLIST 40 | DRAW 41 | P 4 0 1 10 -200 200 200 0 -200 -200 -200 200 f 42 | X NC 1 -100 100 100 D 50 50 1 1 N N 43 | X - 2 -300 -100 100 R 50 50 1 1 I 44 | X + 3 -300 100 100 R 50 50 1 1 I 45 | X V- 4 -100 -300 150 U 50 50 1 1 W 46 | X NC 5 0 100 100 D 50 50 1 1 N N 47 | X ~ 6 300 0 100 L 50 50 1 1 O 48 | X V+ 7 -100 300 150 D 50 50 1 1 W 49 | X NC 8 0 -100 100 U 50 50 1 1 N N 50 | X PAD 9 0 -300 200 U 50 50 1 1 P 51 | ENDDRAW 52 | ENDDEF 53 | # 54 | # Analog_DAC:MCP4822 55 | # 56 | DEF Analog_DAC:MCP4822 U 0 40 Y Y 1 F N 57 | F0 "U" -100 425 50 H V R CNN 58 | F1 "Analog_DAC:MCP4822" -100 350 50 H V R CNN 59 | F2 "" 800 -300 50 H I C CNN 60 | F3 "" 800 -300 50 H I C CNN 61 | ALIAS MCP4812 MCP4822 62 | $FPLIST 63 | DIP*W7.62mm* 64 | SOIC*3.9x4.9mm*P1.27mm* 65 | MSOP*3x3mm*P0.65mm* 66 | $ENDFPLIST 67 | DRAW 68 | T 900 -80 -165 50 0 0 0 CNTRL Normal 0 L B 69 | T 0 150 -150 50 0 0 0 DAC Normal 0 C C 70 | T 0 150 50 50 0 0 0 DAC Normal 0 C C 71 | S 30 -15 -30 -80 0 0 0 N 72 | S -400 300 400 -400 0 1 10 f 73 | S -50 -250 -150 150 0 1 0 N 74 | P 2 0 0 0 0 -70 0 -25 N 75 | P 2 0 0 0 15 -35 20 -30 N 76 | P 2 0 0 0 90 -45 90 -75 N 77 | P 3 0 0 0 15 -35 -15 -35 -20 -40 N 78 | P 3 0 0 0 30 -50 90 -50 90 -30 N 79 | P 4 0 0 0 0 -35 20 -55 -20 -55 0 -35 N 80 | P 4 0 0 0 275 -150 375 -150 375 -200 400 -200 N 81 | P 4 0 0 0 275 50 375 50 375 100 400 100 N 82 | P 2 0 1 0 50 -150 -50 -150 N 83 | P 2 0 1 0 50 50 -50 50 N 84 | P 6 0 1 0 275 -150 225 -75 50 -75 50 -225 225 -225 275 -150 N 85 | P 6 0 1 0 275 50 225 125 50 125 50 -25 225 -25 275 50 N 86 | X Vdd 1 0 400 100 D 50 50 1 1 W 87 | X ~CS 2 -500 -200 100 R 50 50 1 1 I 88 | X SCK 3 -500 100 100 R 50 50 1 1 I C 89 | X SDI 4 -500 -100 100 R 50 50 1 1 I 90 | X ~LDAC 5 -500 0 100 R 50 50 1 1 I 91 | X VB 6 500 -200 100 L 50 50 1 1 O 92 | X Vss 7 0 -500 100 U 50 50 1 1 W 93 | X VA 8 500 100 100 L 50 50 1 1 O 94 | ENDDRAW 95 | ENDDEF 96 | # 97 | # Connector:USB_B_Micro 98 | # 99 | DEF Connector:USB_B_Micro J 0 40 Y Y 1 F N 100 | F0 "J" -200 450 50 H V L CNN 101 | F1 "Connector:USB_B_Micro" -200 350 50 H V L CNN 102 | F2 "" 150 -50 50 H I C CNN 103 | F3 "" 150 -50 50 H I C CNN 104 | ALIAS USB_B_Mini 105 | $FPLIST 106 | USB* 107 | $ENDFPLIST 108 | DRAW 109 | C -150 85 25 0 1 10 F 110 | C -25 135 15 0 1 10 F 111 | S -200 -300 200 300 0 1 10 f 112 | S -5 -300 5 -270 0 1 0 N 113 | S 10 50 -20 20 0 1 10 F 114 | S 200 -205 170 -195 0 1 0 N 115 | S 200 -105 170 -95 0 1 0 N 116 | S 200 -5 170 5 0 1 0 N 117 | S 200 195 170 205 0 1 0 N 118 | P 2 0 1 10 -75 85 25 85 N 119 | P 4 0 1 10 -125 85 -100 85 -50 135 -25 135 N 120 | P 4 0 1 10 -100 85 -75 85 -50 35 0 35 N 121 | P 4 0 1 10 25 110 25 60 75 85 25 110 F 122 | P 5 0 1 0 -170 220 -70 220 -80 190 -160 190 -170 220 F 123 | P 9 0 1 0 -185 230 -185 220 -175 190 -175 180 -65 180 -65 190 -55 220 -55 230 -185 230 N 124 | X VBUS 1 300 200 100 L 50 50 1 1 w 125 | X D- 2 300 -100 100 L 50 50 1 1 P 126 | X D+ 3 300 0 100 L 50 50 1 1 P 127 | X ID 4 300 -200 100 L 50 50 1 1 P 128 | X GND 5 0 -400 100 U 50 50 1 1 w 129 | X Shield 6 -100 -400 100 U 50 50 1 1 P 130 | ENDDRAW 131 | ENDDEF 132 | # 133 | # Connector_Generic:Conn_01x05 134 | # 135 | DEF Connector_Generic:Conn_01x05 J 0 40 Y N 1 F N 136 | F0 "J" 0 300 50 H V C CNN 137 | F1 "Connector_Generic:Conn_01x05" 0 -300 50 H V C CNN 138 | F2 "" 0 0 50 H I C CNN 139 | F3 "" 0 0 50 H I C CNN 140 | $FPLIST 141 | Connector*:*_1x??_* 142 | $ENDFPLIST 143 | DRAW 144 | S -50 -195 0 -205 1 1 6 N 145 | S -50 -95 0 -105 1 1 6 N 146 | S -50 5 0 -5 1 1 6 N 147 | S -50 105 0 95 1 1 6 N 148 | S -50 205 0 195 1 1 6 N 149 | S -50 250 50 -250 1 1 10 f 150 | X Pin_1 1 -200 200 150 R 50 50 1 1 P 151 | X Pin_2 2 -200 100 150 R 50 50 1 1 P 152 | X Pin_3 3 -200 0 150 R 50 50 1 1 P 153 | X Pin_4 4 -200 -100 150 R 50 50 1 1 P 154 | X Pin_5 5 -200 -200 150 R 50 50 1 1 P 155 | ENDDRAW 156 | ENDDEF 157 | # 158 | # Connector_Generic:Conn_01x06 159 | # 160 | DEF Connector_Generic:Conn_01x06 J 0 40 Y N 1 F N 161 | F0 "J" 0 300 50 H V C CNN 162 | F1 "Connector_Generic:Conn_01x06" 0 -400 50 H V C CNN 163 | F2 "" 0 0 50 H I C CNN 164 | F3 "" 0 0 50 H I C CNN 165 | $FPLIST 166 | Connector*:*_1x??_* 167 | $ENDFPLIST 168 | DRAW 169 | S -50 -295 0 -305 1 1 6 N 170 | S -50 -195 0 -205 1 1 6 N 171 | S -50 -95 0 -105 1 1 6 N 172 | S -50 5 0 -5 1 1 6 N 173 | S -50 105 0 95 1 1 6 N 174 | S -50 205 0 195 1 1 6 N 175 | S -50 250 50 -350 1 1 10 f 176 | X Pin_1 1 -200 200 150 R 50 50 1 1 P 177 | X Pin_2 2 -200 100 150 R 50 50 1 1 P 178 | X Pin_3 3 -200 0 150 R 50 50 1 1 P 179 | X Pin_4 4 -200 -100 150 R 50 50 1 1 P 180 | X Pin_5 5 -200 -200 150 R 50 50 1 1 P 181 | X Pin_6 6 -200 -300 150 R 50 50 1 1 P 182 | ENDDRAW 183 | ENDDEF 184 | # 185 | # Connector_Generic:Conn_02x06_Top_Bottom 186 | # 187 | DEF Connector_Generic:Conn_02x06_Top_Bottom J 0 40 Y N 1 F N 188 | F0 "J" 50 300 50 H V C CNN 189 | F1 "Connector_Generic:Conn_02x06_Top_Bottom" 50 -400 50 H V C CNN 190 | F2 "" 0 0 50 H I C CNN 191 | F3 "" 0 0 50 H I C CNN 192 | $FPLIST 193 | Connector*:*_2x??_* 194 | $ENDFPLIST 195 | DRAW 196 | S -50 -295 0 -305 1 1 6 N 197 | S -50 -195 0 -205 1 1 6 N 198 | S -50 -95 0 -105 1 1 6 N 199 | S -50 5 0 -5 1 1 6 N 200 | S -50 105 0 95 1 1 6 N 201 | S -50 205 0 195 1 1 6 N 202 | S -50 250 150 -350 1 1 10 f 203 | S 150 -295 100 -305 1 1 6 N 204 | S 150 -195 100 -205 1 1 6 N 205 | S 150 -95 100 -105 1 1 6 N 206 | S 150 5 100 -5 1 1 6 N 207 | S 150 105 100 95 1 1 6 N 208 | S 150 205 100 195 1 1 6 N 209 | X Pin_1 1 -200 200 150 R 50 50 1 1 P 210 | X Pin_10 10 300 -100 150 L 50 50 1 1 P 211 | X Pin_11 11 300 -200 150 L 50 50 1 1 P 212 | X Pin_12 12 300 -300 150 L 50 50 1 1 P 213 | X Pin_2 2 -200 100 150 R 50 50 1 1 P 214 | X Pin_3 3 -200 0 150 R 50 50 1 1 P 215 | X Pin_4 4 -200 -100 150 R 50 50 1 1 P 216 | X Pin_5 5 -200 -200 150 R 50 50 1 1 P 217 | X Pin_6 6 -200 -300 150 R 50 50 1 1 P 218 | X Pin_7 7 300 200 150 L 50 50 1 1 P 219 | X Pin_8 8 300 100 150 L 50 50 1 1 P 220 | X Pin_9 9 300 0 150 L 50 50 1 1 P 221 | ENDDRAW 222 | ENDDEF 223 | # 224 | # Device:C 225 | # 226 | DEF Device:C C 0 10 N Y 1 F N 227 | F0 "C" 25 100 50 H V L CNN 228 | F1 "Device:C" 25 -100 50 H V L CNN 229 | F2 "" 38 -150 50 H I C CNN 230 | F3 "" 0 0 50 H I C CNN 231 | $FPLIST 232 | C_* 233 | $ENDFPLIST 234 | DRAW 235 | P 2 0 1 20 -80 -30 80 -30 N 236 | P 2 0 1 20 -80 30 80 30 N 237 | X ~ 1 0 150 110 D 50 50 1 1 P 238 | X ~ 2 0 -150 110 U 50 50 1 1 P 239 | ENDDRAW 240 | ENDDEF 241 | # 242 | # Device:Ferrite_Bead_Small 243 | # 244 | DEF Device:Ferrite_Bead_Small L 0 0 N Y 1 F N 245 | F0 "L" 75 50 50 H V L CNN 246 | F1 "Device:Ferrite_Bead_Small" 75 -50 50 H V L CNN 247 | F2 "" -70 0 50 V I C CNN 248 | F3 "" 0 0 50 H I C CNN 249 | $FPLIST 250 | Inductor_* 251 | L_* 252 | *Ferrite* 253 | $ENDFPLIST 254 | DRAW 255 | P 2 0 1 0 0 -50 0 -31 N 256 | P 2 0 1 0 0 35 0 51 N 257 | P 5 0 1 0 -72 11 -44 59 72 -8 44 -56 -72 11 N 258 | X ~ 1 0 100 50 D 50 50 1 1 P 259 | X ~ 2 0 -100 50 U 50 50 1 1 P 260 | ENDDRAW 261 | ENDDEF 262 | # 263 | # Device:L 264 | # 265 | DEF Device:L L 0 40 N N 1 F N 266 | F0 "L" -50 0 50 V V C CNN 267 | F1 "Device:L" 75 0 50 V V C CNN 268 | F2 "" 0 0 50 H I C CNN 269 | F3 "" 0 0 50 H I C CNN 270 | $FPLIST 271 | Choke_* 272 | *Coil* 273 | Inductor_* 274 | L_* 275 | $ENDFPLIST 276 | DRAW 277 | A 0 -75 25 -899 899 0 1 0 N 0 -100 0 -50 278 | A 0 -25 25 -899 899 0 1 0 N 0 -50 0 0 279 | A 0 25 25 -899 899 0 1 0 N 0 0 0 50 280 | A 0 75 25 -899 899 0 1 0 N 0 50 0 100 281 | X 1 1 0 150 50 D 50 50 1 1 P 282 | X 2 2 0 -150 50 U 50 50 1 1 P 283 | ENDDRAW 284 | ENDDEF 285 | # 286 | # Device:R 287 | # 288 | DEF Device:R R 0 0 N Y 1 F N 289 | F0 "R" 80 0 50 V V C CNN 290 | F1 "Device:R" 0 0 50 V V C CNN 291 | F2 "" -70 0 50 V I C CNN 292 | F3 "" 0 0 50 H I C CNN 293 | $FPLIST 294 | R_* 295 | $ENDFPLIST 296 | DRAW 297 | S -40 -100 40 100 0 1 10 N 298 | X ~ 1 0 150 50 D 50 50 1 1 P 299 | X ~ 2 0 -150 50 U 50 50 1 1 P 300 | ENDDRAW 301 | ENDDEF 302 | # 303 | # pmod1:AP2210N-4.0 304 | # 305 | DEF pmod1:AP2210N-4.0 U 0 10 Y Y 1 F N 306 | F0 "U" -150 125 50 H V C CNN 307 | F1 "pmod1:AP2210N-4.0" 0 125 50 H V L CNN 308 | F2 "Package_TO_SOT_SMD:TSOT-23" 0 225 50 H I C CIN 309 | F3 "" 0 0 50 H I C CNN 310 | $FPLIST 311 | TSOT?23* 312 | $ENDFPLIST 313 | DRAW 314 | S -200 75 200 -200 0 1 10 f 315 | X GND 1 0 -300 100 U 50 50 1 1 W 316 | X VO 2 300 0 100 L 50 50 1 1 w 317 | X VI 3 -300 0 100 R 50 50 1 1 W 318 | ENDDRAW 319 | ENDDEF 320 | # 321 | # pmod1:MAX4232 322 | # 323 | DEF pmod1:MAX4232 U 0 40 Y Y 1 F N 324 | F0 "U" 0 0 50 H V C CNN 325 | F1 "pmod1:MAX4232" 0 0 50 H V C CNN 326 | F2 "" 0 0 50 H I C CNN 327 | F3 "" 0 0 50 H I C CNN 328 | DRAW 329 | S -300 -100 300 -600 0 1 0 N 330 | X OUT1 1 -500 -200 200 R 50 50 1 1 I 331 | X IN1- 2 -500 -300 200 R 50 50 1 1 I 332 | X IN1+ 3 -500 -400 200 R 50 50 1 1 I 333 | X VSS 4 -500 -500 200 R 50 50 1 1 I 334 | X IN2+ 5 500 -500 200 L 50 50 1 1 I 335 | X IN2- 6 500 -400 200 L 50 50 1 1 I 336 | X OUT2 7 500 -300 200 L 50 50 1 1 I 337 | X VDD 8 500 -200 200 L 50 50 1 1 I 338 | ENDDRAW 339 | ENDDEF 340 | # 341 | # pmod1:MAX4619 342 | # 343 | DEF pmod1:MAX4619 U 0 40 Y Y 1 F N 344 | F0 "U" 0 -650 60 H V C CNN 345 | F1 "pmod1:MAX4619" 0 300 60 H V C CNN 346 | F2 "" 0 0 60 H V C CNN 347 | F3 "" 0 0 60 H V C CNN 348 | DRAW 349 | S -250 250 250 -550 0 1 0 f 350 | X Y1 1 -350 200 98 R 40 40 1 1 P 351 | X B 10 350 -400 98 L 40 40 1 1 I 352 | X A 11 350 -300 98 L 40 40 1 1 I 353 | X X0 12 350 -200 98 L 40 40 1 1 P 354 | X X1 13 350 -100 98 L 40 40 1 1 P 355 | X X 14 350 0 98 L 40 40 1 1 P 356 | X Y 15 350 100 98 L 40 40 1 1 P 357 | X VCC 16 350 200 98 L 40 40 1 1 W 358 | X Y0 2 -350 100 98 R 40 40 1 1 P 359 | X Z1 3 -350 0 98 R 40 40 1 1 P 360 | X Z 4 -350 -100 98 R 40 40 1 1 P 361 | X Z0 5 -350 -200 98 R 40 40 1 1 P 362 | X EN 6 -350 -350 98 R 40 40 1 1 I 363 | X GND 8 -350 -450 98 R 40 40 1 1 W 364 | X C 9 350 -500 98 L 40 40 1 1 I 365 | ENDDRAW 366 | ENDDEF 367 | # 368 | # pmod1:TS5A63157 369 | # 370 | DEF pmod1:TS5A63157 U 0 5 Y Y 2 F N 371 | F0 "U" -125 185 50 H V L CNN 372 | F1 "pmod1:TS5A63157" -125 115 50 H V L CNN 373 | F2 "Package_TO_SOT_SMD:SOT-23-6" 0 -300 50 H I C CNN 374 | F3 "" 0 0 50 H I C CNN 375 | $FPLIST 376 | SOT?23* 377 | $ENDFPLIST 378 | DRAW 379 | C -85 -100 20 1 1 10 N 380 | C 85 -200 20 1 1 10 N 381 | C 85 0 20 1 1 10 N 382 | S -150 75 150 -300 1 1 10 f 383 | S -150 400 150 -400 2 1 10 f 384 | P 2 1 1 0 -200 -100 -110 -100 N 385 | P 2 1 1 10 -65 -95 100 -25 N 386 | P 2 1 1 0 0 -300 0 -280 N 387 | P 2 1 1 0 0 -270 0 -260 N 388 | P 2 1 1 0 0 -250 0 -240 N 389 | P 2 1 1 0 0 -230 0 -220 N 390 | P 2 1 1 0 0 -210 0 -200 N 391 | P 2 1 1 0 0 -190 0 -180 N 392 | P 2 1 1 0 0 -170 0 -160 N 393 | P 2 1 1 0 0 -150 0 -140 N 394 | P 2 1 1 0 0 -130 0 -120 N 395 | P 2 1 1 0 0 -110 0 -100 N 396 | P 2 1 1 0 0 -90 0 -80 N 397 | P 2 1 1 0 0 -90 0 -80 N 398 | P 2 1 1 0 200 -200 110 -200 N 399 | P 2 1 1 0 200 0 110 0 N 400 | X GND 2 0 -500 100 U 50 50 2 0 W 401 | X V+ 5 0 500 100 D 50 50 2 0 W 402 | X ~ 1 300 -200 100 L 50 50 1 1 P 403 | X gnd 2 -350 -200 200 R 50 50 1 1 I 404 | X ~ 3 300 0 100 L 50 50 1 1 P 405 | X ~ 4 -300 -100 100 R 50 50 1 1 P 406 | X vcc 5 -350 0 200 R 50 50 1 1 I 407 | X ~ 6 0 -400 100 U 50 50 1 1 I 408 | X gnd 2-UB -350 -200 200 R 50 50 2 1 I 409 | X vcc 5-UB -350 0 200 R 50 50 2 1 I 410 | ENDDRAW 411 | ENDDEF 412 | # 413 | # pmod1:trigger 414 | # 415 | DEF pmod1:trigger U 0 10 Y Y 1 F N 416 | F0 "U" 150 125 50 H V L CNN 417 | F1 "pmod1:trigger" 150 -125 50 H V L CNN 418 | F2 "" 0 0 50 H I C CNN 419 | F3 "" 0 0 50 H I C CNN 420 | DRAW 421 | P 4 0 1 10 200 0 -200 200 -200 -200 200 0 f 422 | X in 2 -300 0 100 R 50 50 1 1 I 423 | X gnd 3 -100 -300 150 U 50 50 1 1 W 424 | X out 4 300 0 100 L 50 50 1 1 O 425 | X vcc 5 -100 300 150 D 50 50 1 1 W 426 | ENDDRAW 427 | ENDDEF 428 | # 429 | # power:+3.3V 430 | # 431 | DEF power:+3.3V #PWR 0 0 Y Y 1 F P 432 | F0 "#PWR" 0 -150 50 H I C CNN 433 | F1 "power:+3.3V" 0 140 50 H V C CNN 434 | F2 "" 0 0 50 H I C CNN 435 | F3 "" 0 0 50 H I C CNN 436 | ALIAS +3.3V 437 | DRAW 438 | P 2 0 1 0 -30 50 0 100 N 439 | P 2 0 1 0 0 0 0 100 N 440 | P 2 0 1 0 0 100 30 50 N 441 | X +3V3 1 0 0 0 U 50 50 1 1 W N 442 | ENDDRAW 443 | ENDDEF 444 | # 445 | # power:+5V 446 | # 447 | DEF power:+5V #PWR 0 0 Y Y 1 F P 448 | F0 "#PWR" 0 -150 50 H I C CNN 449 | F1 "power:+5V" 0 140 50 H V C CNN 450 | F2 "" 0 0 50 H I C CNN 451 | F3 "" 0 0 50 H I C CNN 452 | DRAW 453 | P 2 0 1 0 -30 50 0 100 N 454 | P 2 0 1 0 0 0 0 100 N 455 | P 2 0 1 0 0 100 30 50 N 456 | X +5V 1 0 0 0 U 50 50 1 1 W N 457 | ENDDRAW 458 | ENDDEF 459 | # 460 | # power:GND 461 | # 462 | DEF power:GND #PWR 0 0 Y Y 1 F P 463 | F0 "#PWR" 0 -250 50 H I C CNN 464 | F1 "power:GND" 0 -150 50 H V C CNN 465 | F2 "" 0 0 50 H I C CNN 466 | F3 "" 0 0 50 H I C CNN 467 | DRAW 468 | P 6 0 1 0 0 0 0 -50 50 -50 0 -100 -50 -50 0 -50 N 469 | X GND 1 0 0 0 D 50 50 1 1 W N 470 | ENDDRAW 471 | ENDDEF 472 | # 473 | # power:PWR_FLAG 474 | # 475 | DEF power:PWR_FLAG #FLG 0 0 N N 1 F P 476 | F0 "#FLG" 0 75 50 H I C CNN 477 | F1 "power:PWR_FLAG" 0 150 50 H V C CNN 478 | F2 "" 0 0 50 H I C CNN 479 | F3 "" 0 0 50 H I C CNN 480 | DRAW 481 | P 6 0 1 0 0 0 0 50 -40 75 0 100 40 75 0 50 N 482 | X pwr 1 0 0 0 U 50 50 0 0 w 483 | ENDDRAW 484 | ENDDEF 485 | # 486 | #End Library 487 | -------------------------------------------------------------------------------- /pcb/pmod2/pmod2.bak: -------------------------------------------------------------------------------- 1 | EESchema Schematic File Version 4 2 | LIBS:pmod2-cache 3 | EELAYER 26 0 4 | EELAYER END 5 | $Descr A4 11693 8268 6 | encoding utf-8 7 | Sheet 1 1 8 | Title "" 9 | Date "" 10 | Rev "" 11 | Comp "" 12 | Comment1 "" 13 | Comment2 "" 14 | Comment3 "" 15 | Comment4 "" 16 | $EndDescr 17 | $Comp 18 | L Connector_Generic:Conn_02x06_Top_Bottom J2 19 | U 1 1 5D726350 20 | P 2100 4700 21 | F 0 "J2" H 2150 5117 50 0000 C CNN 22 | F 1 "PMOD" H 2150 5026 50 0000 C CNN 23 | F 2 "Connector_PinHeader_2.54mm:PinHeader_2x06_P2.54mm_Vertical" H 2100 4700 50 0001 C CNN 24 | F 3 "~" H 2100 4700 50 0001 C CNN 25 | 1 2100 4700 26 | 1 0 0 -1 27 | $EndComp 28 | $Comp 29 | L power:+3.3V #PWR07 30 | U 1 1 5D726405 31 | P 1900 5000 32 | F 0 "#PWR07" H 1900 4850 50 0001 C CNN 33 | F 1 "+3.3V" V 1915 5128 50 0000 L CNN 34 | F 2 "" H 1900 5000 50 0001 C CNN 35 | F 3 "" H 1900 5000 50 0001 C CNN 36 | 1 1900 5000 37 | 0 -1 -1 0 38 | $EndComp 39 | $Comp 40 | L power:+3.3V #PWR010 41 | U 1 1 5D72641D 42 | P 2400 5000 43 | F 0 "#PWR010" H 2400 4850 50 0001 C CNN 44 | F 1 "+3.3V" V 2415 5128 50 0000 L CNN 45 | F 2 "" H 2400 5000 50 0001 C CNN 46 | F 3 "" H 2400 5000 50 0001 C CNN 47 | 1 2400 5000 48 | 0 1 1 0 49 | $EndComp 50 | $Comp 51 | L power:GND #PWR09 52 | U 1 1 5D726474 53 | P 2400 4900 54 | F 0 "#PWR09" H 2400 4650 50 0001 C CNN 55 | F 1 "GND" V 2405 4772 50 0000 R CNN 56 | F 2 "" H 2400 4900 50 0001 C CNN 57 | F 3 "" H 2400 4900 50 0001 C CNN 58 | 1 2400 4900 59 | 0 -1 -1 0 60 | $EndComp 61 | $Comp 62 | L power:GND #PWR06 63 | U 1 1 5D72648B 64 | P 1900 4900 65 | F 0 "#PWR06" H 1900 4650 50 0001 C CNN 66 | F 1 "GND" V 1905 4772 50 0000 R CNN 67 | F 2 "" H 1900 4900 50 0001 C CNN 68 | F 3 "" H 1900 4900 50 0001 C CNN 69 | 1 1900 4900 70 | 0 1 1 0 71 | $EndComp 72 | $Comp 73 | L Device:L L1 74 | U 1 1 5D726529 75 | P 2950 1700 76 | F 0 "L1" V 2772 1700 50 0000 C CNN 77 | F 1 "L" V 2863 1700 50 0000 C CNN 78 | F 2 "Inductor_SMD:L_1210_3225Metric_Pad1.42x2.65mm_HandSolder" H 2950 1700 50 0001 C CNN 79 | F 3 "~" H 2950 1700 50 0001 C CNN 80 | 1 2950 1700 81 | 0 1 1 0 82 | $EndComp 83 | $Comp 84 | L Device:R R1 85 | U 1 1 5D726654 86 | P 3350 1700 87 | F 0 "R1" V 3143 1700 50 0000 C CNN 88 | F 1 "R" V 3234 1700 50 0000 C CNN 89 | F 2 "Resistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolder" V 3280 1700 50 0001 C CNN 90 | F 3 "~" H 3350 1700 50 0001 C CNN 91 | 1 3350 1700 92 | 0 1 1 0 93 | $EndComp 94 | Wire Wire Line 95 | 3100 1700 3200 1700 96 | $Comp 97 | L Device:C C2 98 | U 1 1 5D7267F4 99 | P 3600 1450 100 | F 0 "C2" H 3485 1404 50 0000 R CNN 101 | F 1 "C" H 3485 1495 50 0000 R CNN 102 | F 2 "Capacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolder" H 3638 1300 50 0001 C CNN 103 | F 3 "~" H 3600 1450 50 0001 C CNN 104 | 1 3600 1450 105 | -1 0 0 1 106 | $EndComp 107 | Wire Wire Line 108 | 3500 1700 3600 1700 109 | Wire Wire Line 110 | 3600 1700 3600 1600 111 | $Comp 112 | L power:GND #PWR011 113 | U 1 1 5D726888 114 | P 3600 1300 115 | F 0 "#PWR011" H 3600 1050 50 0001 C CNN 116 | F 1 "GND" H 3605 1127 50 0000 C CNN 117 | F 2 "" H 3600 1300 50 0001 C CNN 118 | F 3 "" H 3600 1300 50 0001 C CNN 119 | 1 3600 1300 120 | -1 0 0 1 121 | $EndComp 122 | $Comp 123 | L Device:L L2 124 | U 1 1 5D72720E 125 | P 2950 1800 126 | F 0 "L2" V 3048 1800 50 0000 C CNN 127 | F 1 "L" V 3139 1800 50 0000 C CNN 128 | F 2 "Inductor_SMD:L_1210_3225Metric_Pad1.42x2.65mm_HandSolder" H 2950 1800 50 0001 C CNN 129 | F 3 "~" H 2950 1800 50 0001 C CNN 130 | 1 2950 1800 131 | 0 1 1 0 132 | $EndComp 133 | $Comp 134 | L Device:R R2 135 | U 1 1 5D727214 136 | P 3350 1800 137 | F 0 "R2" V 3465 1800 50 0000 C CNN 138 | F 1 "R" V 3556 1800 50 0000 C CNN 139 | F 2 "Resistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolder" V 3280 1800 50 0001 C CNN 140 | F 3 "~" H 3350 1800 50 0001 C CNN 141 | 1 3350 1800 142 | 0 1 1 0 143 | $EndComp 144 | Wire Wire Line 145 | 3100 1800 3200 1800 146 | Connection ~ 3600 1700 147 | Text Label 2450 4700 0 50 ~ 0 148 | PWM_IN1 149 | Text Label 2450 4800 0 50 ~ 0 150 | PWM_IN2 151 | Text Label 1850 4500 2 50 ~ 0 152 | TRIGGER_OUT 153 | Text Label 1850 4600 2 50 ~ 0 154 | SWITCH_IN 155 | Wire Wire Line 156 | 1900 4500 1250 4500 157 | Wire Wire Line 158 | 1900 4600 1250 4600 159 | $Comp 160 | L Amplifier_Operational:L272M U1 161 | U 1 1 5D727EDB 162 | P 6300 2000 163 | F 0 "U1" H 6300 1633 50 0000 C CNN 164 | F 1 "L272M" H 6300 1724 50 0000 C CNN 165 | F 2 "Package_DIP:DIP-8_W7.62mm_LongPads" H 6300 2000 50 0001 C CNN 166 | F 3 "www.st.com/resource/en/datasheet/l272.pdf" H 6300 2000 50 0001 C CNN 167 | 1 6300 2000 168 | 1 0 0 1 169 | $EndComp 170 | $Comp 171 | L Amplifier_Operational:L272M U1 172 | U 2 1 5D727FAF 173 | P 6300 2600 174 | F 0 "U1" H 6300 2967 50 0000 C CNN 175 | F 1 "L272M" H 6300 2876 50 0000 C CNN 176 | F 2 "Package_DIP:DIP-8_W7.62mm_LongPads" H 6300 2600 50 0001 C CNN 177 | F 3 "www.st.com/resource/en/datasheet/l272.pdf" H 6300 2600 50 0001 C CNN 178 | 2 6300 2600 179 | 1 0 0 -1 180 | $EndComp 181 | $Comp 182 | L Amplifier_Operational:L272M U1 183 | U 3 1 5D7280CF 184 | P 6300 1000 185 | F 0 "U1" V 6303 1000 50 0000 C CNN 186 | F 1 "L272M" V 6394 1000 50 0000 C CNN 187 | F 2 "Package_DIP:DIP-8_W7.62mm_LongPads" H 6300 1000 50 0001 C CNN 188 | F 3 "www.st.com/resource/en/datasheet/l272.pdf" H 6300 1000 50 0001 C CNN 189 | 3 6300 1000 190 | 0 1 1 0 191 | $EndComp 192 | $Comp 193 | L power:+5V #PWR016 194 | U 1 1 5D7282C0 195 | P 6600 900 196 | F 0 "#PWR016" H 6600 750 50 0001 C CNN 197 | F 1 "+5V" V 6615 1028 50 0000 L CNN 198 | F 2 "" H 6600 900 50 0001 C CNN 199 | F 3 "" H 6600 900 50 0001 C CNN 200 | 1 6600 900 201 | 0 1 1 0 202 | $EndComp 203 | $Comp 204 | L power:GND #PWR015 205 | U 1 1 5D728318 206 | P 6000 900 207 | F 0 "#PWR015" H 6000 650 50 0001 C CNN 208 | F 1 "GND" V 6005 772 50 0000 R CNN 209 | F 2 "" H 6000 900 50 0001 C CNN 210 | F 3 "" H 6000 900 50 0001 C CNN 211 | 1 6000 900 212 | 0 1 1 0 213 | $EndComp 214 | Wire Wire Line 215 | 6000 2500 5900 2500 216 | Wire Wire Line 217 | 5900 2500 5900 2350 218 | Wire Wire Line 219 | 5900 2250 5900 2100 220 | Wire Wire Line 221 | 6000 2100 5900 2100 222 | $Comp 223 | L Device:R Rfb1 224 | U 1 1 5D72A7D6 225 | P 6300 1500 226 | F 0 "Rfb1" V 6093 1500 50 0000 C CNN 227 | F 1 "0" V 6184 1500 50 0000 C CNN 228 | F 2 "Resistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolder" V 6230 1500 50 0001 C CNN 229 | F 3 "~" H 6300 1500 50 0001 C CNN 230 | 1 6300 1500 231 | 0 1 1 0 232 | $EndComp 233 | $Comp 234 | L Device:R Rfb2 235 | U 1 1 5D72A826 236 | P 6300 2950 237 | F 0 "Rfb2" V 6415 2950 50 0000 C CNN 238 | F 1 "0" V 6506 2950 50 0000 C CNN 239 | F 2 "Resistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolder" V 6230 2950 50 0001 C CNN 240 | F 3 "~" H 6300 2950 50 0001 C CNN 241 | 1 6300 2950 242 | 0 1 1 0 243 | $EndComp 244 | Wire Wire Line 245 | 6000 2950 6150 2950 246 | Wire Wire Line 247 | 6450 2950 6600 2950 248 | Wire Wire Line 249 | 6000 1500 6150 1500 250 | Wire Wire Line 251 | 6000 1500 6000 1900 252 | Wire Wire Line 253 | 6450 1500 6600 1500 254 | Wire Wire Line 255 | 6600 1500 6600 2000 256 | Wire Wire Line 257 | 6000 2950 6000 2700 258 | Wire Wire Line 259 | 6600 2950 6600 2600 260 | $Comp 261 | L Device:R Rld2 262 | U 1 1 5D72C66E 263 | P 7150 2600 264 | F 0 "Rld2" H 7080 2554 50 0000 R CNN 265 | F 1 "R" H 7080 2645 50 0000 R CNN 266 | F 2 "Resistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolder" V 7080 2600 50 0001 C CNN 267 | F 3 "~" H 7150 2600 50 0001 C CNN 268 | 1 7150 2600 269 | -1 0 0 1 270 | $EndComp 271 | $Comp 272 | L Device:R Rld1 273 | U 1 1 5D72C6F2 274 | P 7150 2000 275 | F 0 "Rld1" H 7080 1954 50 0000 R CNN 276 | F 1 "R" H 7080 2045 50 0000 R CNN 277 | F 2 "Resistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolder" V 7080 2000 50 0001 C CNN 278 | F 3 "~" H 7150 2000 50 0001 C CNN 279 | 1 7150 2000 280 | -1 0 0 1 281 | $EndComp 282 | Wire Wire Line 283 | 7000 2150 7000 2000 284 | Wire Wire Line 285 | 7000 2600 7000 2450 286 | $Comp 287 | L pmod1:MAX4619 U2 288 | U 1 1 5D72E384 289 | P 9650 2200 290 | F 0 "U2" H 9650 2637 60 0000 C CNN 291 | F 1 "MAX4619" H 9650 2531 60 0000 C CNN 292 | F 2 "Package_DIP:DIP-16_W7.62mm_LongPads" H 9650 2200 60 0001 C CNN 293 | F 3 "" H 9650 2200 60 0000 C CNN 294 | 1 9650 2200 295 | 1 0 0 -1 296 | $EndComp 297 | Wire Wire Line 298 | 9050 2200 8950 2200 299 | Wire Wire Line 300 | 9100 2500 8950 2500 301 | Wire Wire Line 302 | 10000 2600 10200 2600 303 | Wire Wire Line 304 | 9300 2550 9150 2550 305 | Wire Wire Line 306 | 9150 2550 9150 2650 307 | Wire Wire Line 308 | 9300 2650 9150 2650 309 | $Comp 310 | L power:GND #PWR017 311 | U 1 1 5D72FE59 312 | P 9150 2750 313 | F 0 "#PWR017" H 9150 2500 50 0001 C CNN 314 | F 1 "GND" H 9155 2577 50 0000 C CNN 315 | F 2 "" H 9150 2750 50 0001 C CNN 316 | F 3 "" H 9150 2750 50 0001 C CNN 317 | 1 9150 2750 318 | 1 0 0 -1 319 | $EndComp 320 | Wire Wire Line 321 | 9150 2750 9150 2650 322 | Connection ~ 9150 2650 323 | $Comp 324 | L power:+5V #PWR018 325 | U 1 1 5D732EAB 326 | P 10100 2000 327 | F 0 "#PWR018" H 10100 1850 50 0001 C CNN 328 | F 1 "+5V" H 10115 2173 50 0000 C CNN 329 | F 2 "" H 10100 2000 50 0001 C CNN 330 | F 3 "" H 10100 2000 50 0001 C CNN 331 | 1 10100 2000 332 | 1 0 0 -1 333 | $EndComp 334 | Wire Wire Line 335 | 10100 2000 10000 2000 336 | $Comp 337 | L Device:R R7 338 | U 1 1 5D73465F 339 | P 10200 2850 340 | F 0 "R7" H 10130 2804 50 0000 R CNN 341 | F 1 "R" H 10130 2895 50 0000 R CNN 342 | F 2 "Resistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolder" V 10130 2850 50 0001 C CNN 343 | F 3 "~" H 10200 2850 50 0001 C CNN 344 | 1 10200 2850 345 | -1 0 0 1 346 | $EndComp 347 | Wire Wire Line 348 | 10200 2700 10200 2600 349 | $Comp 350 | L power:GND #PWR019 351 | U 1 1 5D734D41 352 | P 10200 3000 353 | F 0 "#PWR019" H 10200 2750 50 0001 C CNN 354 | F 1 "GND" H 10205 2827 50 0000 C CNN 355 | F 2 "" H 10200 3000 50 0001 C CNN 356 | F 3 "" H 10200 3000 50 0001 C CNN 357 | 1 10200 3000 358 | 1 0 0 -1 359 | $EndComp 360 | Text Label 10550 2600 0 50 ~ 0 361 | SWITCH_IN 362 | Text Label 10800 2100 0 50 ~ 0 363 | POWER_PREOUT 364 | Wire Wire Line 365 | 10200 2600 10550 2600 366 | Connection ~ 10200 2600 367 | Wire Wire Line 368 | 10000 2100 10550 2100 369 | $Comp 370 | L Device:C C1 371 | U 1 1 5D73789D 372 | P 1350 3300 373 | F 0 "C1" H 1235 3254 50 0000 R CNN 374 | F 1 "C" H 1235 3345 50 0000 R CNN 375 | F 2 "Capacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolder" H 1388 3150 50 0001 C CNN 376 | F 3 "~" H 1350 3300 50 0001 C CNN 377 | 1 1350 3300 378 | -1 0 0 1 379 | $EndComp 380 | $Comp 381 | L Connector:USB_B_Micro J1 382 | U 1 1 5D737A9D 383 | P 850 3350 384 | F 0 "J1" H 905 3817 50 0000 C CNN 385 | F 1 "USB_B_Micro" H 905 3726 50 0000 C CNN 386 | F 2 "custom:USB_Micro-B_Amphenol_hax" H 1000 3300 50 0001 C CNN 387 | F 3 "~" H 1000 3300 50 0001 C CNN 388 | 1 850 3350 389 | 1 0 0 -1 390 | $EndComp 391 | $Comp 392 | L power:GND #PWR01 393 | U 1 1 5D737B64 394 | P 850 3750 395 | F 0 "#PWR01" H 850 3500 50 0001 C CNN 396 | F 1 "GND" H 855 3577 50 0000 C CNN 397 | F 2 "" H 850 3750 50 0001 C CNN 398 | F 3 "" H 850 3750 50 0001 C CNN 399 | 1 850 3750 400 | 1 0 0 -1 401 | $EndComp 402 | Wire Wire Line 403 | 1150 3150 1350 3150 404 | $Comp 405 | L power:+5V #PWR08 406 | U 1 1 5D739175 407 | P 3550 3150 408 | F 0 "#PWR08" H 3550 3000 50 0001 C CNN 409 | F 1 "+5V" V 3565 3278 50 0000 L CNN 410 | F 2 "" H 3550 3150 50 0001 C CNN 411 | F 3 "" H 3550 3150 50 0001 C CNN 412 | 1 3550 3150 413 | 0 1 1 0 414 | $EndComp 415 | NoConn ~ 750 3750 416 | NoConn ~ 1150 3550 417 | NoConn ~ 1150 3450 418 | NoConn ~ 1150 3350 419 | Wire Wire Line 420 | 6600 2000 7000 2000 421 | Connection ~ 6600 2000 422 | Wire Wire Line 423 | 6600 2600 7000 2600 424 | Connection ~ 6600 2600 425 | Wire Notes Line 426 | 5600 750 5600 3250 427 | Wire Notes Line 428 | 5600 750 6950 750 429 | Wire Notes Line 430 | 6950 750 6950 3250 431 | Wire Notes Line 432 | 5600 3250 6950 3250 433 | Wire Notes Line 434 | 4550 1000 4550 2500 435 | Wire Notes Line 436 | 2750 2500 2750 1000 437 | Text Notes 2800 2450 0 50 ~ 0 438 | PWM filter/caps 439 | Text Notes 5650 3200 0 50 ~ 0 440 | pre-switch\nopamp 441 | $Comp 442 | L Connector_Generic:Conn_01x06 J3 443 | U 1 1 5D745A80 444 | P 2150 5600 445 | F 0 "J3" H 2230 5592 50 0000 L CNN 446 | F 1 "Conn_01x04" H 2230 5501 50 0000 L CNN 447 | F 2 "Connector_PinHeader_2.54mm:PinHeader_1x06_P2.54mm_Vertical" H 2150 5600 50 0001 C CNN 448 | F 3 "~" H 2150 5600 50 0001 C CNN 449 | 1 2150 5600 450 | 1 0 0 -1 451 | $EndComp 452 | Text Label 1950 6350 2 50 ~ 0 453 | TRIGGER_OUT 454 | Text Label 1950 5600 2 50 ~ 0 455 | POWER_OUT 456 | Wire Wire Line 457 | 1950 5500 1400 5500 458 | Wire Wire Line 459 | 1950 5800 1400 5800 460 | Wire Wire Line 461 | 1950 5900 1400 5900 462 | Wire Wire Line 463 | 1950 5400 1400 5400 464 | $Comp 465 | L power:GND #PWR02 466 | U 1 1 5D748B3E 467 | P 1400 5400 468 | F 0 "#PWR02" H 1400 5150 50 0001 C CNN 469 | F 1 "GND" V 1405 5272 50 0000 R CNN 470 | F 2 "" H 1400 5400 50 0001 C CNN 471 | F 3 "" H 1400 5400 50 0001 C CNN 472 | 1 1400 5400 473 | 0 1 1 0 474 | $EndComp 475 | $Comp 476 | L power:PWR_FLAG #FLG01 477 | U 1 1 5D74BD45 478 | P 1900 5000 479 | F 0 "#FLG01" H 1900 5075 50 0001 C CNN 480 | F 1 "PWR_FLAG" H 1900 5173 50 0000 C CNN 481 | F 2 "" H 1900 5000 50 0001 C CNN 482 | F 3 "~" H 1900 5000 50 0001 C CNN 483 | 1 1900 5000 484 | -1 0 0 1 485 | $EndComp 486 | Connection ~ 1900 5000 487 | $Comp 488 | L power:GND #PWR05 489 | U 1 1 5D74D073 490 | P 1350 3450 491 | F 0 "#PWR05" H 1350 3200 50 0001 C CNN 492 | F 1 "GND" H 1355 3277 50 0000 C CNN 493 | F 2 "" H 1350 3450 50 0001 C CNN 494 | F 3 "" H 1350 3450 50 0001 C CNN 495 | 1 1350 3450 496 | 1 0 0 -1 497 | $EndComp 498 | Text Label 1950 6450 2 50 ~ 0 499 | TRIGGER_OUT 500 | $Comp 501 | L Connector_Generic:Conn_01x06 J4 502 | U 1 1 5D74F30C 503 | P 2150 6550 504 | F 0 "J4" H 2230 6542 50 0000 L CNN 505 | F 1 "Conn_01x04" H 2230 6451 50 0000 L CNN 506 | F 2 "Connector_PinHeader_2.54mm:PinHeader_1x06_P2.54mm_Vertical" H 2150 6550 50 0001 C CNN 507 | F 3 "~" H 2150 6550 50 0001 C CNN 508 | 1 2150 6550 509 | 1 0 0 -1 510 | $EndComp 511 | $Comp 512 | L power:GND #PWR03 513 | U 1 1 5D74F811 514 | P 1400 5800 515 | F 0 "#PWR03" H 1400 5550 50 0001 C CNN 516 | F 1 "GND" V 1405 5672 50 0000 R CNN 517 | F 2 "" H 1400 5800 50 0001 C CNN 518 | F 3 "" H 1400 5800 50 0001 C CNN 519 | 1 1400 5800 520 | 0 1 1 0 521 | $EndComp 522 | Text Label 1950 6550 2 50 ~ 0 523 | TRIGGER_OUT 524 | Text Notes 2250 7150 0 50 ~ 0 525 | debug/extras 526 | Text Notes 2250 5850 0 50 ~ 0 527 | interface 528 | $Comp 529 | L power:+5V #PWR04 530 | U 1 1 5D752721 531 | P 1400 5900 532 | F 0 "#PWR04" H 1400 5750 50 0001 C CNN 533 | F 1 "+5V" V 1415 6028 50 0000 L CNN 534 | F 2 "" H 1400 5900 50 0001 C CNN 535 | F 3 "" H 1400 5900 50 0001 C CNN 536 | 1 1400 5900 537 | 0 -1 -1 0 538 | $EndComp 539 | Wire Wire Line 540 | 1400 6450 1950 6450 541 | Wire Wire Line 542 | 1400 6550 1950 6550 543 | Wire Wire Line 544 | 2800 1800 2400 1800 545 | Wire Wire Line 546 | 2800 1700 2400 1700 547 | Text Label 2400 1700 0 50 ~ 0 548 | PWM_IN1 549 | Text Label 2400 1800 0 50 ~ 0 550 | PWM_IN2 551 | Wire Wire Line 552 | 2400 4700 2450 4700 553 | Wire Wire Line 554 | 2400 4800 2450 4800 555 | Wire Wire Line 556 | 5900 2250 5550 2250 557 | Wire Wire Line 558 | 5900 2350 5550 2350 559 | Text Label 5000 1700 2 50 ~ 0 560 | PWM_FILT1 561 | Text Label 5000 1800 2 50 ~ 0 562 | PWM_FILT2 563 | $Comp 564 | L Device:C C4 565 | U 1 1 5D764D01 566 | P 3600 2050 567 | F 0 "C4" H 3715 2096 50 0000 L CNN 568 | F 1 "C" H 3715 2005 50 0000 L CNN 569 | F 2 "Capacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolder" H 3638 1900 50 0001 C CNN 570 | F 3 "~" H 3600 2050 50 0001 C CNN 571 | 1 3600 2050 572 | 1 0 0 -1 573 | $EndComp 574 | $Comp 575 | L power:GND #PWR013 576 | U 1 1 5D764D07 577 | P 3600 2200 578 | F 0 "#PWR013" H 3600 1950 50 0001 C CNN 579 | F 1 "GND" H 3605 2027 50 0000 C CNN 580 | F 2 "" H 3600 2200 50 0001 C CNN 581 | F 3 "" H 3600 2200 50 0001 C CNN 582 | 1 3600 2200 583 | 1 0 0 -1 584 | $EndComp 585 | Wire Wire Line 586 | 3600 1900 3600 1800 587 | Text Label 5550 2250 2 50 ~ 0 588 | PWM_FILT1 589 | Text Label 5550 2350 2 50 ~ 0 590 | PWM_FILT2 591 | $Comp 592 | L Device:C C6 593 | U 1 1 5D7751F7 594 | P 3250 3300 595 | F 0 "C6" H 3135 3254 50 0000 R CNN 596 | F 1 "C" H 3135 3345 50 0000 R CNN 597 | F 2 "Capacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolder" H 3288 3150 50 0001 C CNN 598 | F 3 "~" H 3250 3300 50 0001 C CNN 599 | 1 3250 3300 600 | -1 0 0 1 601 | $EndComp 602 | $Comp 603 | L power:GND #PWR020 604 | U 1 1 5D7751FD 605 | P 3250 3450 606 | F 0 "#PWR020" H 3250 3200 50 0001 C CNN 607 | F 1 "GND" H 3255 3277 50 0000 C CNN 608 | F 2 "" H 3250 3450 50 0001 C CNN 609 | F 3 "" H 3250 3450 50 0001 C CNN 610 | 1 3250 3450 611 | 1 0 0 -1 612 | $EndComp 613 | Wire Wire Line 614 | 3600 1700 3950 1700 615 | Wire Wire Line 616 | 3500 1800 3600 1800 617 | Connection ~ 3600 1800 618 | Wire Wire Line 619 | 3600 1800 3950 1800 620 | $Comp 621 | L Device:C C3 622 | U 1 1 5D781A63 623 | P 4300 1450 624 | F 0 "C3" H 4185 1404 50 0000 R CNN 625 | F 1 "C" H 4185 1495 50 0000 R CNN 626 | F 2 "Capacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolder" H 4338 1300 50 0001 C CNN 627 | F 3 "~" H 4300 1450 50 0001 C CNN 628 | 1 4300 1450 629 | -1 0 0 1 630 | $EndComp 631 | Wire Wire Line 632 | 4300 1700 4300 1600 633 | $Comp 634 | L power:GND #PWR0101 635 | U 1 1 5D781A6A 636 | P 4300 1300 637 | F 0 "#PWR0101" H 4300 1050 50 0001 C CNN 638 | F 1 "GND" H 4305 1127 50 0000 C CNN 639 | F 2 "" H 4300 1300 50 0001 C CNN 640 | F 3 "" H 4300 1300 50 0001 C CNN 641 | 1 4300 1300 642 | -1 0 0 1 643 | $EndComp 644 | Wire Wire Line 645 | 4300 1700 5000 1700 646 | $Comp 647 | L Device:C C5 648 | U 1 1 5D782C02 649 | P 4300 2050 650 | F 0 "C5" H 4415 2096 50 0000 L CNN 651 | F 1 "C" H 4415 2005 50 0000 L CNN 652 | F 2 "Capacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolder" H 4338 1900 50 0001 C CNN 653 | F 3 "~" H 4300 2050 50 0001 C CNN 654 | 1 4300 2050 655 | 1 0 0 -1 656 | $EndComp 657 | $Comp 658 | L power:GND #PWR0102 659 | U 1 1 5D782C08 660 | P 4300 2200 661 | F 0 "#PWR0102" H 4300 1950 50 0001 C CNN 662 | F 1 "GND" H 4305 2027 50 0000 C CNN 663 | F 2 "" H 4300 2200 50 0001 C CNN 664 | F 3 "" H 4300 2200 50 0001 C CNN 665 | 1 4300 2200 666 | 1 0 0 -1 667 | $EndComp 668 | Wire Wire Line 669 | 4300 1900 4300 1800 670 | Wire Wire Line 671 | 4300 1800 5000 1800 672 | $Comp 673 | L power:GND #PWR0103 674 | U 1 1 5D756549 675 | P 1950 6750 676 | F 0 "#PWR0103" H 1950 6500 50 0001 C CNN 677 | F 1 "GND" V 1955 6622 50 0000 R CNN 678 | F 2 "" H 1950 6750 50 0001 C CNN 679 | F 3 "" H 1950 6750 50 0001 C CNN 680 | 1 1950 6750 681 | 0 1 1 0 682 | $EndComp 683 | $Comp 684 | L power:GND #PWR0104 685 | U 1 1 5D756582 686 | P 1950 6650 687 | F 0 "#PWR0104" H 1950 6400 50 0001 C CNN 688 | F 1 "GND" V 1955 6522 50 0000 R CNN 689 | F 2 "" H 1950 6650 50 0001 C CNN 690 | F 3 "" H 1950 6650 50 0001 C CNN 691 | 1 1950 6650 692 | 0 1 1 0 693 | $EndComp 694 | $Comp 695 | L power:GND #PWR0105 696 | U 1 1 5D756884 697 | P 1950 6850 698 | F 0 "#PWR0105" H 1950 6600 50 0001 C CNN 699 | F 1 "GND" V 1955 6722 50 0000 R CNN 700 | F 2 "" H 1950 6850 50 0001 C CNN 701 | F 3 "" H 1950 6850 50 0001 C CNN 702 | 1 1950 6850 703 | 0 1 1 0 704 | $EndComp 705 | Text Label 1950 5700 2 50 ~ 0 706 | POWER_OUT 707 | Wire Wire Line 708 | 1950 5700 1400 5700 709 | Wire Wire Line 710 | 1950 5600 1400 5600 711 | $Comp 712 | L power:GND #PWR0106 713 | U 1 1 5D75B3CD 714 | P 1400 5500 715 | F 0 "#PWR0106" H 1400 5250 50 0001 C CNN 716 | F 1 "GND" V 1405 5372 50 0000 R CNN 717 | F 2 "" H 1400 5500 50 0001 C CNN 718 | F 3 "" H 1400 5500 50 0001 C CNN 719 | 1 1400 5500 720 | 0 1 1 0 721 | $EndComp 722 | Wire Wire Line 723 | 9100 2000 9200 2000 724 | Wire Wire Line 725 | 9100 2000 9100 2500 726 | Wire Wire Line 727 | 9050 2200 9050 2100 728 | Wire Wire Line 729 | 9050 2100 9150 2100 730 | Text Label 1950 7050 2 50 ~ 0 731 | SWITCH_IN 732 | Text Label 1950 7250 2 50 ~ 0 733 | PWM_IN1 734 | Text Label 1950 7150 2 50 ~ 0 735 | PWM_IN2 736 | Wire Wire Line 737 | 10000 2700 10000 2600 738 | Connection ~ 10000 2600 739 | Wire Wire Line 740 | 10000 2600 10000 2500 741 | Wire Wire Line 742 | 9300 2300 9250 2300 743 | Wire Wire Line 744 | 9250 2300 9250 1700 745 | Wire Wire Line 746 | 9250 1700 10550 1700 747 | Wire Wire Line 748 | 10550 1700 10550 2100 749 | Wire Wire Line 750 | 10000 2200 10550 2200 751 | Wire Wire Line 752 | 10550 2200 10550 2100 753 | Connection ~ 10550 2100 754 | Wire Wire Line 755 | 9200 2000 9200 2200 756 | Wire Wire Line 757 | 9200 2200 9300 2200 758 | Connection ~ 9200 2000 759 | Wire Wire Line 760 | 9200 2000 9300 2000 761 | Wire Wire Line 762 | 9200 2000 9200 1650 763 | Wire Wire Line 764 | 9200 1650 10600 1650 765 | Wire Wire Line 766 | 10600 1650 10600 2300 767 | Wire Wire Line 768 | 10600 2300 10000 2300 769 | Wire Wire Line 770 | 9300 2400 9150 2400 771 | Wire Wire Line 772 | 9150 2400 9150 2100 773 | Connection ~ 9150 2100 774 | Wire Wire Line 775 | 9150 2100 9300 2100 776 | Wire Wire Line 777 | 9150 2100 9150 1600 778 | Wire Wire Line 779 | 9150 1600 10650 1600 780 | Wire Wire Line 781 | 10650 1600 10650 2400 782 | Wire Wire Line 783 | 10650 2400 10000 2400 784 | $Comp 785 | L power:GND #PWR0108 786 | U 1 1 5DEE7BE0 787 | P 3900 5300 788 | F 0 "#PWR0108" H 3900 5050 50 0001 C CNN 789 | F 1 "GND" V 3905 5172 50 0000 R CNN 790 | F 2 "" H 3900 5300 50 0001 C CNN 791 | F 3 "" H 3900 5300 50 0001 C CNN 792 | 1 3900 5300 793 | 0 -1 -1 0 794 | $EndComp 795 | $Comp 796 | L Device:R R3 797 | U 1 1 5DEEBB20 798 | P 3750 5300 799 | F 0 "R3" V 3543 5300 50 0000 C CNN 800 | F 1 "R" V 3634 5300 50 0000 C CNN 801 | F 2 "Resistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolder" V 3680 5300 50 0001 C CNN 802 | F 3 "~" H 3750 5300 50 0001 C CNN 803 | 1 3750 5300 804 | 0 1 1 0 805 | $EndComp 806 | Text Label 3600 5300 2 50 ~ 0 807 | TRIGGER_OUT 808 | Wire Wire Line 809 | 10550 2100 10800 2100 810 | Connection ~ 1350 3150 811 | $Comp 812 | L Device:C C7 813 | U 1 1 5DEF82A1 814 | P 2150 3300 815 | F 0 "C7" H 2035 3254 50 0000 R CNN 816 | F 1 "C" H 2035 3345 50 0000 R CNN 817 | F 2 "Capacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolder" H 2188 3150 50 0001 C CNN 818 | F 3 "~" H 2150 3300 50 0001 C CNN 819 | 1 2150 3300 820 | -1 0 0 1 821 | $EndComp 822 | $Comp 823 | L power:GND #PWR0109 824 | U 1 1 5DEF82F3 825 | P 2150 3450 826 | F 0 "#PWR0109" H 2150 3200 50 0001 C CNN 827 | F 1 "GND" H 2155 3277 50 0000 C CNN 828 | F 2 "" H 2150 3450 50 0001 C CNN 829 | F 3 "" H 2150 3450 50 0001 C CNN 830 | 1 2150 3450 831 | 1 0 0 -1 832 | $EndComp 833 | Wire Wire Line 834 | 1800 3150 2150 3150 835 | $Comp 836 | L Device:Ferrite_Bead_Small L3 837 | U 1 1 5DEFCB26 838 | P 1700 3150 839 | F 0 "L3" V 1463 3150 50 0000 C CNN 840 | F 1 "Ferrite_Bead_Small" V 1554 3150 50 0000 C CNN 841 | F 2 "Inductor_SMD:L_0805_2012Metric_Pad1.15x1.40mm_HandSolder" V 1630 3150 50 0001 C CNN 842 | F 3 "~" H 1700 3150 50 0001 C CNN 843 | 1 1700 3150 844 | 0 1 1 0 845 | $EndComp 846 | Wire Wire Line 847 | 1350 3150 1600 3150 848 | Text Label 6100 5200 0 50 ~ 0 849 | PWM_FILT1 850 | Text Label 6100 4900 0 50 ~ 0 851 | PWM_FILT2 852 | Wire Wire Line 853 | 5100 5000 4950 5000 854 | $Comp 855 | L power:GND #PWR014 856 | U 1 1 5DF02AAE 857 | P 4950 5000 858 | F 0 "#PWR014" H 4950 4750 50 0001 C CNN 859 | F 1 "GND" V 4950 4800 50 0000 C CNN 860 | F 2 "" H 4950 5000 50 0001 C CNN 861 | F 3 "" H 4950 5000 50 0001 C CNN 862 | 1 4950 5000 863 | 0 1 1 0 864 | $EndComp 865 | Wire Wire Line 866 | 5100 5200 4500 5200 867 | $Comp 868 | L power:+5V #PWR021 869 | U 1 1 5DF14122 870 | P 5600 4450 871 | F 0 "#PWR021" H 5600 4300 50 0001 C CNN 872 | F 1 "+5V" H 5688 4487 50 0000 L CNN 873 | F 2 "" H 5600 4450 50 0001 C CNN 874 | F 3 "" H 5600 4450 50 0001 C CNN 875 | 1 5600 4450 876 | 1 0 0 -1 877 | $EndComp 878 | Wire Wire Line 879 | 5600 4600 5600 4450 880 | $Comp 881 | L power:GND #PWR022 882 | U 1 1 5DF16AB4 883 | P 5600 5600 884 | F 0 "#PWR022" H 5600 5350 50 0001 C CNN 885 | F 1 "GND" V 5600 5400 50 0000 C CNN 886 | F 2 "" H 5600 5600 50 0001 C CNN 887 | F 3 "" H 5600 5600 50 0001 C CNN 888 | 1 5600 5600 889 | 1 0 0 -1 890 | $EndComp 891 | Wire Wire Line 892 | 5600 5500 5600 5600 893 | Text Label 4500 4900 0 50 ~ 0 894 | PWM_IN1 895 | Text Label 4500 5200 0 50 ~ 0 896 | PWM_IN2 897 | Text Label 4500 5100 0 50 ~ 0 898 | SDI_IN 899 | Text Label 2450 4600 0 50 ~ 0 900 | SDI_IN 901 | Wire Wire Line 902 | 2400 4600 2450 4600 903 | Text Label 1900 4700 2 50 ~ 0 904 | GPIO1 905 | Text Label 1900 4800 2 50 ~ 0 906 | GPIO2 907 | Text Label 4050 6500 2 50 ~ 0 908 | GPIO1 909 | Text Label 4050 6600 2 50 ~ 0 910 | GPIO2 911 | $Comp 912 | L Connector_Generic:Conn_01x06 J6 913 | U 1 1 5DF20C03 914 | P 4250 6700 915 | F 0 "J6" H 4330 6692 50 0000 L CNN 916 | F 1 "Conn_01x04" H 4330 6601 50 0000 L CNN 917 | F 2 "Connector_PinHeader_2.54mm:PinHeader_1x06_P2.54mm_Vertical" H 4250 6700 50 0001 C CNN 918 | F 3 "~" H 4250 6700 50 0001 C CNN 919 | 1 4250 6700 920 | 1 0 0 -1 921 | $EndComp 922 | $Comp 923 | L Connector_Generic:Conn_01x05 J5 924 | U 1 1 5DF2137D 925 | P 2150 7250 926 | F 0 "J5" H 2230 7242 50 0000 L CNN 927 | F 1 "Conn_01x04" H 2230 7151 50 0000 L CNN 928 | F 2 "Connector_PinHeader_2.54mm:PinHeader_1x05_P2.54mm_Vertical" H 2150 7250 50 0001 C CNN 929 | F 3 "~" H 2150 7250 50 0001 C CNN 930 | 1 2150 7250 931 | 1 0 0 -1 932 | $EndComp 933 | Text Label 1950 7350 2 50 ~ 0 934 | SDI_IN 935 | $Comp 936 | L power:GND #PWR0110 937 | U 1 1 5DF21917 938 | P 1950 7450 939 | F 0 "#PWR0110" H 1950 7200 50 0001 C CNN 940 | F 1 "GND" V 1955 7322 50 0000 R CNN 941 | F 2 "" H 1950 7450 50 0001 C CNN 942 | F 3 "" H 1950 7450 50 0001 C CNN 943 | 1 1950 7450 944 | 0 1 1 0 945 | $EndComp 946 | Text Label 4050 6800 2 50 ~ 0 947 | SDI_IN 948 | $Comp 949 | L power:GND #PWR0111 950 | U 1 1 5DF22C5C 951 | P 4050 7000 952 | F 0 "#PWR0111" H 4050 6750 50 0001 C CNN 953 | F 1 "GND" V 4055 6872 50 0000 R CNN 954 | F 2 "" H 4050 7000 50 0001 C CNN 955 | F 3 "" H 4050 7000 50 0001 C CNN 956 | 1 4050 7000 957 | 0 1 1 0 958 | $EndComp 959 | Text Label 2450 4500 0 50 ~ 0 960 | GPIO3 961 | Wire Wire Line 962 | 2400 4500 2450 4500 963 | Text Label 4050 6700 2 50 ~ 0 964 | GPIO3 965 | $Comp 966 | L Analog_DAC:MCP4822 U3 967 | U 1 1 5DF29A02 968 | P 5600 5000 969 | F 0 "U3" H 5600 5578 50 0000 C CNN 970 | F 1 "MCP4822" H 5600 5487 50 0000 C CNN 971 | F 2 "Package_SO:SOIC-8_3.9x4.9mm_P1.27mm" H 6400 4700 50 0001 C CNN 972 | F 3 "http://ww1.microchip.com/downloads/en/DeviceDoc/20002249B.pdf" H 6400 4700 50 0001 C CNN 973 | 1 5600 5000 974 | 1 0 0 -1 975 | $EndComp 976 | Wire Wire Line 977 | 5100 5100 4500 5100 978 | Wire Wire Line 979 | 5100 4900 4500 4900 980 | $Comp 981 | L Device:R R5 982 | U 1 1 5DF500E8 983 | P 4100 1800 984 | F 0 "R5" V 4215 1800 50 0000 C CNN 985 | F 1 "R" V 4306 1800 50 0000 C CNN 986 | F 2 "Resistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolder" V 4030 1800 50 0001 C CNN 987 | F 3 "~" H 4100 1800 50 0001 C CNN 988 | 1 4100 1800 989 | 0 1 1 0 990 | $EndComp 991 | $Comp 992 | L Device:R R4 993 | U 1 1 5DF50158 994 | P 4100 1700 995 | F 0 "R4" V 3893 1700 50 0000 C CNN 996 | F 1 "R" V 3984 1700 50 0000 C CNN 997 | F 2 "Resistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolder" V 4030 1700 50 0001 C CNN 998 | F 3 "~" H 4100 1700 50 0001 C CNN 999 | 1 4100 1700 1000 | 0 1 1 0 1001 | $EndComp 1002 | Wire Wire Line 1003 | 4300 1700 4250 1700 1004 | Wire Wire Line 1005 | 4250 1800 4300 1800 1006 | Connection ~ 4300 1700 1007 | Connection ~ 4300 1800 1008 | Wire Notes Line 1009 | 2750 2500 4550 2500 1010 | Wire Notes Line 1011 | 2750 1000 4550 1000 1012 | $Comp 1013 | L pmod1:TS5A63157 U4 1014 | U 1 1 5DED97DD 1015 | P 9000 4050 1016 | F 0 "U4" H 8975 4200 50 0000 C CNN 1017 | F 1 "TS5A63157" H 8975 4291 50 0000 C CNN 1018 | F 2 "Package_TO_SOT_SMD:SOT-23-6" H 9000 3750 50 0001 C CNN 1019 | F 3 "" H 9000 4050 50 0001 C CNN 1020 | 1 9000 4050 1021 | -1 0 0 1 1022 | $EndComp 1023 | Text Label 7300 2150 0 50 ~ 0 1024 | PRESWITCH_1 1025 | Text Label 7300 2450 0 50 ~ 0 1026 | PRESWITCH_2 1027 | Text Label 8950 2200 2 50 ~ 0 1028 | PRESWITCH_1 1029 | Text Label 8950 2500 2 50 ~ 0 1030 | PRESWITCH_2 1031 | Text Label 8700 4050 2 50 ~ 0 1032 | PRESWITCH_1 1033 | Text Label 8700 3850 2 50 ~ 0 1034 | PRESWITCH_2 1035 | $Comp 1036 | L power:GND #PWR0113 1037 | U 1 1 5DEE3BEF 1038 | P 9350 3850 1039 | F 0 "#PWR0113" H 9350 3600 50 0001 C CNN 1040 | F 1 "GND" H 9355 3677 50 0000 C CNN 1041 | F 2 "" H 9350 3850 50 0001 C CNN 1042 | F 3 "" H 9350 3850 50 0001 C CNN 1043 | 1 9350 3850 1044 | 0 -1 -1 0 1045 | $EndComp 1046 | $Comp 1047 | L power:+5V #PWR0114 1048 | U 1 1 5DEE3FBA 1049 | P 9350 4050 1050 | F 0 "#PWR0114" H 9350 3900 50 0001 C CNN 1051 | F 1 "+5V" V 9365 4178 50 0000 L CNN 1052 | F 2 "" H 9350 4050 50 0001 C CNN 1053 | F 3 "" H 9350 4050 50 0001 C CNN 1054 | 1 9350 4050 1055 | 0 1 1 0 1056 | $EndComp 1057 | Text Label 9600 3950 0 50 ~ 0 1058 | POWER_PREOUT 1059 | Wire Wire Line 1060 | 9300 3950 9600 3950 1061 | Text Label 9000 3650 1 50 ~ 0 1062 | SWITCH_IN 1063 | $Comp 1064 | L pmod1:trigger U5 1065 | U 1 1 5DEEAACD 1066 | P 9850 5200 1067 | F 0 "U5" H 10191 5246 50 0000 L CNN 1068 | F 1 "trigger" H 10191 5155 50 0000 L CNN 1069 | F 2 "Package_TO_SOT_SMD:SOT-23-6" H 9850 5200 50 0001 C CNN 1070 | F 3 "" H 9850 5200 50 0001 C CNN 1071 | 1 9850 5200 1072 | 1 0 0 -1 1073 | $EndComp 1074 | Text Label 9550 5200 2 50 ~ 0 1075 | BUF1_IN 1076 | Text Label 10150 5200 0 50 ~ 0 1077 | BUF1_OUT 1078 | $Comp 1079 | L power:GND #PWR0115 1080 | U 1 1 5DEEAD36 1081 | P 9750 5500 1082 | F 0 "#PWR0115" H 9750 5250 50 0001 C CNN 1083 | F 1 "GND" V 9755 5372 50 0000 R CNN 1084 | F 2 "" H 9750 5500 50 0001 C CNN 1085 | F 3 "" H 9750 5500 50 0001 C CNN 1086 | 1 9750 5500 1087 | 1 0 0 -1 1088 | $EndComp 1089 | $Comp 1090 | L power:+3.3V #PWR0116 1091 | U 1 1 5DEEAE11 1092 | P 9750 4900 1093 | F 0 "#PWR0116" H 9750 4750 50 0001 C CNN 1094 | F 1 "+3.3V" V 9765 5028 50 0000 L CNN 1095 | F 2 "" H 9750 4900 50 0001 C CNN 1096 | F 3 "" H 9750 4900 50 0001 C CNN 1097 | 1 9750 4900 1098 | 1 0 0 -1 1099 | $EndComp 1100 | $Comp 1101 | L Connector_Generic:Conn_01x06 J7 1102 | U 1 1 5DEDB3E2 1103 | P 7450 5200 1104 | F 0 "J7" H 7530 5192 50 0000 L CNN 1105 | F 1 "Conn_01x04" H 7530 5101 50 0000 L CNN 1106 | F 2 "Connector_PinHeader_2.54mm:PinHeader_1x06_P2.54mm_Vertical" H 7450 5200 50 0001 C CNN 1107 | F 3 "~" H 7450 5200 50 0001 C CNN 1108 | 1 7450 5200 1109 | 1 0 0 -1 1110 | $EndComp 1111 | Text Label 7250 5200 2 50 ~ 0 1112 | BUF1_IN 1113 | Text Label 7250 5300 2 50 ~ 0 1114 | BUF1_OUT 1115 | $Comp 1116 | L pmod1:trigger U6 1117 | U 1 1 5DEDE98F 1118 | P 8900 5800 1119 | F 0 "U6" H 9241 5846 50 0000 L CNN 1120 | F 1 "trigger" H 9241 5755 50 0000 L CNN 1121 | F 2 "Package_TO_SOT_SMD:SOT-23-6" H 8900 5800 50 0001 C CNN 1122 | F 3 "" H 8900 5800 50 0001 C CNN 1123 | 1 8900 5800 1124 | 1 0 0 -1 1125 | $EndComp 1126 | Text Label 8600 5800 2 50 ~ 0 1127 | BUF2_IN 1128 | Text Label 9200 5800 0 50 ~ 0 1129 | BUF2_OUT 1130 | $Comp 1131 | L power:GND #PWR0117 1132 | U 1 1 5DEDE997 1133 | P 8800 6100 1134 | F 0 "#PWR0117" H 8800 5850 50 0001 C CNN 1135 | F 1 "GND" V 8805 5972 50 0000 R CNN 1136 | F 2 "" H 8800 6100 50 0001 C CNN 1137 | F 3 "" H 8800 6100 50 0001 C CNN 1138 | 1 8800 6100 1139 | 1 0 0 -1 1140 | $EndComp 1141 | $Comp 1142 | L power:+3.3V #PWR0118 1143 | U 1 1 5DEDE99D 1144 | P 8800 5500 1145 | F 0 "#PWR0118" H 8800 5350 50 0001 C CNN 1146 | F 1 "+3.3V" V 8815 5628 50 0000 L CNN 1147 | F 2 "" H 8800 5500 50 0001 C CNN 1148 | F 3 "" H 8800 5500 50 0001 C CNN 1149 | 1 8800 5500 1150 | 1 0 0 -1 1151 | $EndComp 1152 | Text Label 7250 5400 2 50 ~ 0 1153 | BUF2_IN 1154 | Text Label 7250 5500 2 50 ~ 0 1155 | BUF2_OUT 1156 | $Comp 1157 | L pmod1:MAX4232 U7 1158 | U 1 1 5DEE7C16 1159 | P 6750 3400 1160 | F 0 "U7" H 6750 3465 50 0000 C CNN 1161 | F 1 "MAX4232" H 6750 3374 50 0000 C CNN 1162 | F 2 "Package_TO_SOT_SMD:SOT-23-8" H 6750 3400 50 0001 C CNN 1163 | F 3 "" H 6750 3400 50 0001 C CNN 1164 | 1 6750 3400 1165 | 1 0 0 -1 1166 | $EndComp 1167 | $Comp 1168 | L power:GND #PWR0119 1169 | U 1 1 5DEE8240 1170 | P 6250 3900 1171 | F 0 "#PWR0119" H 6250 3650 50 0001 C CNN 1172 | F 1 "GND" V 6255 3772 50 0000 R CNN 1173 | F 2 "" H 6250 3900 50 0001 C CNN 1174 | F 3 "" H 6250 3900 50 0001 C CNN 1175 | 1 6250 3900 1176 | 0 1 1 0 1177 | $EndComp 1178 | $Comp 1179 | L power:+5V #PWR0120 1180 | U 1 1 5DEE8351 1181 | P 7250 3600 1182 | F 0 "#PWR0120" H 7250 3450 50 0001 C CNN 1183 | F 1 "+5V" V 7265 3728 50 0000 L CNN 1184 | F 2 "" H 7250 3600 50 0001 C CNN 1185 | F 3 "" H 7250 3600 50 0001 C CNN 1186 | 1 7250 3600 1187 | 0 1 1 0 1188 | $EndComp 1189 | Text Label 6250 3800 2 50 ~ 0 1190 | PWM_FILT1 1191 | Text Label 7250 3900 0 50 ~ 0 1192 | PWM_FILT2 1193 | $Comp 1194 | L pmod1:AP2210N-4.0 U8 1195 | U 1 1 5DEEFBA8 1196 | P 2650 3150 1197 | F 0 "U8" H 2650 3392 50 0000 C CNN 1198 | F 1 "AP2210N-4.0" H 2650 3301 50 0000 C CNN 1199 | F 2 "Package_TO_SOT_SMD:TSOT-23" H 2650 3375 50 0001 C CIN 1200 | F 3 "https://www.diodes.com/assets/Datasheets/AP2127.pdf" H 2650 3150 50 0001 C CNN 1201 | 1 2650 3150 1202 | 1 0 0 -1 1203 | $EndComp 1204 | Wire Wire Line 1205 | 2350 3150 2150 3150 1206 | Connection ~ 2150 3150 1207 | Wire Wire Line 1208 | 2950 3150 3250 3150 1209 | Connection ~ 3250 3150 1210 | Wire Wire Line 1211 | 3250 3150 3550 3150 1212 | $Comp 1213 | L power:GND #PWR0121 1214 | U 1 1 5DF0A6F0 1215 | P 2650 3450 1216 | F 0 "#PWR0121" H 2650 3200 50 0001 C CNN 1217 | F 1 "GND" H 2655 3277 50 0000 C CNN 1218 | F 2 "" H 2650 3450 50 0001 C CNN 1219 | F 3 "" H 2650 3450 50 0001 C CNN 1220 | 1 2650 3450 1221 | 1 0 0 -1 1222 | $EndComp 1223 | $Comp 1224 | L Device:C C8 1225 | U 1 1 5DF0B466 1226 | P 4150 4150 1227 | F 0 "C8" H 4035 4104 50 0000 R CNN 1228 | F 1 "C" H 4035 4195 50 0000 R CNN 1229 | F 2 "Capacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolder" H 4188 4000 50 0001 C CNN 1230 | F 3 "~" H 4150 4150 50 0001 C CNN 1231 | 1 4150 4150 1232 | -1 0 0 1 1233 | $EndComp 1234 | $Comp 1235 | L power:GND #PWR0122 1236 | U 1 1 5DF0B46C 1237 | P 4150 4300 1238 | F 0 "#PWR0122" H 4150 4050 50 0001 C CNN 1239 | F 1 "GND" H 4155 4127 50 0000 C CNN 1240 | F 2 "" H 4150 4300 50 0001 C CNN 1241 | F 3 "" H 4150 4300 50 0001 C CNN 1242 | 1 4150 4300 1243 | 1 0 0 -1 1244 | $EndComp 1245 | $Comp 1246 | L power:+5V #PWR0123 1247 | U 1 1 5DF0E3F0 1248 | P 4150 4000 1249 | F 0 "#PWR0123" H 4150 3850 50 0001 C CNN 1250 | F 1 "+5V" V 4165 4128 50 0000 L CNN 1251 | F 2 "" H 4150 4000 50 0001 C CNN 1252 | F 3 "" H 4150 4000 50 0001 C CNN 1253 | 1 4150 4000 1254 | 1 0 0 -1 1255 | $EndComp 1256 | Text Label 6850 2600 3 50 ~ 0 1257 | AMPOUT2 1258 | Text Label 6850 2000 1 50 ~ 0 1259 | AMPOUT1 1260 | Text Label 6000 1500 1 50 ~ 0 1261 | AMPFB1 1262 | Text Label 6000 2900 2 50 ~ 0 1263 | AMPFB2 1264 | Text Label 7250 3700 0 50 ~ 0 1265 | AMPOUT2 1266 | Text Label 6250 3600 2 50 ~ 0 1267 | AMPOUT1 1268 | Text Label 7250 3800 0 50 ~ 0 1269 | AMPFB2 1270 | Text Label 6250 3700 2 50 ~ 0 1271 | AMPFB1 1272 | $Comp 1273 | L power:GND #PWR0107 1274 | U 1 1 5DF1A0D4 1275 | P 4050 6900 1276 | F 0 "#PWR0107" H 4050 6650 50 0001 C CNN 1277 | F 1 "GND" V 4055 6772 50 0000 R CNN 1278 | F 2 "" H 4050 6900 50 0001 C CNN 1279 | F 3 "" H 4050 6900 50 0001 C CNN 1280 | 1 4050 6900 1281 | 0 1 1 0 1282 | $EndComp 1283 | $Comp 1284 | L power:+3.3V #PWR0112 1285 | U 1 1 5DF236D0 1286 | P 7250 5100 1287 | F 0 "#PWR0112" H 7250 4950 50 0001 C CNN 1288 | F 1 "+3.3V" V 7265 5228 50 0000 L CNN 1289 | F 2 "" H 7250 5100 50 0001 C CNN 1290 | F 3 "" H 7250 5100 50 0001 C CNN 1291 | 1 7250 5100 1292 | 0 -1 -1 0 1293 | $EndComp 1294 | $Comp 1295 | L power:+3.3V #PWR0124 1296 | U 1 1 5DF237EF 1297 | P 7250 5000 1298 | F 0 "#PWR0124" H 7250 4850 50 0001 C CNN 1299 | F 1 "+3.3V" V 7265 5128 50 0000 L CNN 1300 | F 2 "" H 7250 5000 50 0001 C CNN 1301 | F 3 "" H 7250 5000 50 0001 C CNN 1302 | 1 7250 5000 1303 | 0 -1 -1 0 1304 | $EndComp 1305 | $Comp 1306 | L Device:C C9 1307 | U 1 1 5DF246C4 1308 | P 5000 4150 1309 | F 0 "C9" H 4885 4104 50 0000 R CNN 1310 | F 1 "C" H 4885 4195 50 0000 R CNN 1311 | F 2 "Capacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolder" H 5038 4000 50 0001 C CNN 1312 | F 3 "~" H 5000 4150 50 0001 C CNN 1313 | 1 5000 4150 1314 | -1 0 0 1 1315 | $EndComp 1316 | $Comp 1317 | L power:GND #PWR0125 1318 | U 1 1 5DF246CA 1319 | P 5000 4300 1320 | F 0 "#PWR0125" H 5000 4050 50 0001 C CNN 1321 | F 1 "GND" H 5005 4127 50 0000 C CNN 1322 | F 2 "" H 5000 4300 50 0001 C CNN 1323 | F 3 "" H 5000 4300 50 0001 C CNN 1324 | 1 5000 4300 1325 | 1 0 0 -1 1326 | $EndComp 1327 | $Comp 1328 | L power:+5V #PWR0126 1329 | U 1 1 5DF246D0 1330 | P 5000 4000 1331 | F 0 "#PWR0126" H 5000 3850 50 0001 C CNN 1332 | F 1 "+5V" V 5015 4128 50 0000 L CNN 1333 | F 2 "" H 5000 4000 50 0001 C CNN 1334 | F 3 "" H 5000 4000 50 0001 C CNN 1335 | 1 5000 4000 1336 | 1 0 0 -1 1337 | $EndComp 1338 | $Comp 1339 | L Device:C C11 1340 | U 1 1 5DF27C12 1341 | P 3800 4150 1342 | F 0 "C11" H 3685 4104 50 0000 R CNN 1343 | F 1 "C" H 3685 4195 50 0000 R CNN 1344 | F 2 "Capacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolder" H 3838 4000 50 0001 C CNN 1345 | F 3 "~" H 3800 4150 50 0001 C CNN 1346 | 1 3800 4150 1347 | -1 0 0 1 1348 | $EndComp 1349 | $Comp 1350 | L power:GND #PWR0127 1351 | U 1 1 5DF27C18 1352 | P 3800 4300 1353 | F 0 "#PWR0127" H 3800 4050 50 0001 C CNN 1354 | F 1 "GND" H 3805 4127 50 0000 C CNN 1355 | F 2 "" H 3800 4300 50 0001 C CNN 1356 | F 3 "" H 3800 4300 50 0001 C CNN 1357 | 1 3800 4300 1358 | 1 0 0 -1 1359 | $EndComp 1360 | $Comp 1361 | L power:+5V #PWR0128 1362 | U 1 1 5DF27C1E 1363 | P 3800 4000 1364 | F 0 "#PWR0128" H 3800 3850 50 0001 C CNN 1365 | F 1 "+5V" V 3815 4128 50 0000 L CNN 1366 | F 2 "" H 3800 4000 50 0001 C CNN 1367 | F 3 "" H 3800 4000 50 0001 C CNN 1368 | 1 3800 4000 1369 | 1 0 0 -1 1370 | $EndComp 1371 | $Comp 1372 | L Device:C C10 1373 | U 1 1 5DF2AB8E 1374 | P 3450 4150 1375 | F 0 "C10" H 3335 4104 50 0000 R CNN 1376 | F 1 "C" H 3335 4195 50 0000 R CNN 1377 | F 2 "Capacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolder" H 3488 4000 50 0001 C CNN 1378 | F 3 "~" H 3450 4150 50 0001 C CNN 1379 | 1 3450 4150 1380 | -1 0 0 1 1381 | $EndComp 1382 | $Comp 1383 | L power:GND #PWR0129 1384 | U 1 1 5DF2AB94 1385 | P 3450 4300 1386 | F 0 "#PWR0129" H 3450 4050 50 0001 C CNN 1387 | F 1 "GND" H 3455 4127 50 0000 C CNN 1388 | F 2 "" H 3450 4300 50 0001 C CNN 1389 | F 3 "" H 3450 4300 50 0001 C CNN 1390 | 1 3450 4300 1391 | 1 0 0 -1 1392 | $EndComp 1393 | $Comp 1394 | L power:+5V #PWR0130 1395 | U 1 1 5DF2AB9A 1396 | P 3450 4000 1397 | F 0 "#PWR0130" H 3450 3850 50 0001 C CNN 1398 | F 1 "+5V" V 3465 4128 50 0000 L CNN 1399 | F 2 "" H 3450 4000 50 0001 C CNN 1400 | F 3 "" H 3450 4000 50 0001 C CNN 1401 | 1 3450 4000 1402 | 1 0 0 -1 1403 | $EndComp 1404 | $Comp 1405 | L Device:C C12 1406 | U 1 1 5DF30B03 1407 | P 4600 4150 1408 | F 0 "C12" H 4485 4104 50 0000 R CNN 1409 | F 1 "C" H 4485 4195 50 0000 R CNN 1410 | F 2 "Capacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolder" H 4638 4000 50 0001 C CNN 1411 | F 3 "~" H 4600 4150 50 0001 C CNN 1412 | 1 4600 4150 1413 | -1 0 0 1 1414 | $EndComp 1415 | $Comp 1416 | L power:GND #PWR0131 1417 | U 1 1 5DF30B09 1418 | P 4600 4300 1419 | F 0 "#PWR0131" H 4600 4050 50 0001 C CNN 1420 | F 1 "GND" H 4605 4127 50 0000 C CNN 1421 | F 2 "" H 4600 4300 50 0001 C CNN 1422 | F 3 "" H 4600 4300 50 0001 C CNN 1423 | 1 4600 4300 1424 | 1 0 0 -1 1425 | $EndComp 1426 | $Comp 1427 | L power:+5V #PWR0132 1428 | U 1 1 5DF30B0F 1429 | P 4600 4000 1430 | F 0 "#PWR0132" H 4600 3850 50 0001 C CNN 1431 | F 1 "+5V" V 4615 4128 50 0000 L CNN 1432 | F 2 "" H 4600 4000 50 0001 C CNN 1433 | F 3 "" H 4600 4000 50 0001 C CNN 1434 | 1 4600 4000 1435 | 1 0 0 -1 1436 | $EndComp 1437 | $Comp 1438 | L Amplifier_Operational:THS4631DDA U9 1439 | U 1 1 5DF33D77 1440 | P 5950 6750 1441 | F 0 "U9" H 6291 6796 50 0000 L CNN 1442 | F 1 "THS4631DDA" H 6291 6705 50 0000 L CNN 1443 | F 2 "Package_SO:SOIC-8_3.9x4.9mm_P1.27mm" H 5950 6750 50 0001 L CNN 1444 | F 3 "www.ti.com/lit/ds/symlink/ths4631.pdf" H 6100 6900 50 0001 C CNN 1445 | 1 5950 6750 1446 | 1 0 0 -1 1447 | $EndComp 1448 | Text Label 6250 6750 0 50 ~ 0 1449 | POWER_OUT 1450 | Text Label 5650 6650 2 50 ~ 0 1451 | POWER_PREOUT 1452 | $Comp 1453 | L power:GND #PWR0133 1454 | U 1 1 5DF35B59 1455 | P 5850 7050 1456 | F 0 "#PWR0133" H 5850 6800 50 0001 C CNN 1457 | F 1 "GND" V 5850 6850 50 0000 C CNN 1458 | F 2 "" H 5850 7050 50 0001 C CNN 1459 | F 3 "" H 5850 7050 50 0001 C CNN 1460 | 1 5850 7050 1461 | 1 0 0 -1 1462 | $EndComp 1463 | $Comp 1464 | L power:+5V #PWR0134 1465 | U 1 1 5DF36349 1466 | P 5850 6450 1467 | F 0 "#PWR0134" H 5850 6300 50 0001 C CNN 1468 | F 1 "+5V" H 5938 6487 50 0000 L CNN 1469 | F 2 "" H 5850 6450 50 0001 C CNN 1470 | F 3 "" H 5850 6450 50 0001 C CNN 1471 | 1 5850 6450 1472 | 1 0 0 -1 1473 | $EndComp 1474 | $Comp 1475 | L Device:C C13 1476 | U 1 1 5DF36CC9 1477 | P 3150 4150 1478 | F 0 "C13" H 3035 4104 50 0000 R CNN 1479 | F 1 "C" H 3035 4195 50 0000 R CNN 1480 | F 2 "Capacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolder" H 3188 4000 50 0001 C CNN 1481 | F 3 "~" H 3150 4150 50 0001 C CNN 1482 | 1 3150 4150 1483 | -1 0 0 1 1484 | $EndComp 1485 | $Comp 1486 | L power:GND #PWR0135 1487 | U 1 1 5DF36CCF 1488 | P 3150 4300 1489 | F 0 "#PWR0135" H 3150 4050 50 0001 C CNN 1490 | F 1 "GND" H 3155 4127 50 0000 C CNN 1491 | F 2 "" H 3150 4300 50 0001 C CNN 1492 | F 3 "" H 3150 4300 50 0001 C CNN 1493 | 1 3150 4300 1494 | 1 0 0 -1 1495 | $EndComp 1496 | $Comp 1497 | L power:+5V #PWR0136 1498 | U 1 1 5DF36CD5 1499 | P 3150 4000 1500 | F 0 "#PWR0136" H 3150 3850 50 0001 C CNN 1501 | F 1 "+5V" V 3165 4128 50 0000 L CNN 1502 | F 2 "" H 3150 4000 50 0001 C CNN 1503 | F 3 "" H 3150 4000 50 0001 C CNN 1504 | 1 3150 4000 1505 | 1 0 0 -1 1506 | $EndComp 1507 | Wire Wire Line 1508 | 6250 6750 6250 7400 1509 | Wire Wire Line 1510 | 6250 7400 5650 7400 1511 | Wire Wire Line 1512 | 5650 7400 5650 6850 1513 | Wire Wire Line 1514 | 7000 2450 7150 2450 1515 | Wire Wire Line 1516 | 7000 2150 7150 2150 1517 | Connection ~ 7150 2150 1518 | Wire Wire Line 1519 | 7150 2150 7300 2150 1520 | Connection ~ 7150 2450 1521 | Wire Wire Line 1522 | 7150 2450 7300 2450 1523 | $Comp 1524 | L power:GND #PWR0137 1525 | U 1 1 5DF4EE1C 1526 | P 7150 2750 1527 | F 0 "#PWR0137" H 7150 2500 50 0001 C CNN 1528 | F 1 "GND" H 7155 2577 50 0000 C CNN 1529 | F 2 "" H 7150 2750 50 0001 C CNN 1530 | F 3 "" H 7150 2750 50 0001 C CNN 1531 | 1 7150 2750 1532 | 1 0 0 -1 1533 | $EndComp 1534 | $Comp 1535 | L power:GND #PWR0138 1536 | U 1 1 5DF4EE7F 1537 | P 7150 1850 1538 | F 0 "#PWR0138" H 7150 1600 50 0001 C CNN 1539 | F 1 "GND" H 7155 1677 50 0000 C CNN 1540 | F 2 "" H 7150 1850 50 0001 C CNN 1541 | F 3 "" H 7150 1850 50 0001 C CNN 1542 | 1 7150 1850 1543 | -1 0 0 1 1544 | $EndComp 1545 | $EndSCHEMATC 1546 | -------------------------------------------------------------------------------- /pcb/pmod2/pmod2.sch: -------------------------------------------------------------------------------- 1 | EESchema Schematic File Version 4 2 | LIBS:pmod2-cache 3 | EELAYER 26 0 4 | EELAYER END 5 | $Descr A4 11693 8268 6 | encoding utf-8 7 | Sheet 1 1 8 | Title "" 9 | Date "" 10 | Rev "" 11 | Comp "" 12 | Comment1 "" 13 | Comment2 "" 14 | Comment3 "" 15 | Comment4 "" 16 | $EndDescr 17 | $Comp 18 | L Connector_Generic:Conn_02x06_Top_Bottom J2 19 | U 1 1 5D726350 20 | P 2100 4700 21 | F 0 "J2" H 2150 5117 50 0000 C CNN 22 | F 1 "PMOD" H 2150 5026 50 0000 C CNN 23 | F 2 "Connector_PinHeader_2.54mm:PinHeader_2x06_P2.54mm_Vertical" H 2100 4700 50 0001 C CNN 24 | F 3 "~" H 2100 4700 50 0001 C CNN 25 | 1 2100 4700 26 | 1 0 0 -1 27 | $EndComp 28 | $Comp 29 | L power:+3.3V #PWR07 30 | U 1 1 5D726405 31 | P 1900 5000 32 | F 0 "#PWR07" H 1900 4850 50 0001 C CNN 33 | F 1 "+3.3V" V 1915 5128 50 0000 L CNN 34 | F 2 "" H 1900 5000 50 0001 C CNN 35 | F 3 "" H 1900 5000 50 0001 C CNN 36 | 1 1900 5000 37 | 0 -1 -1 0 38 | $EndComp 39 | $Comp 40 | L power:+3.3V #PWR010 41 | U 1 1 5D72641D 42 | P 2400 5000 43 | F 0 "#PWR010" H 2400 4850 50 0001 C CNN 44 | F 1 "+3.3V" V 2415 5128 50 0000 L CNN 45 | F 2 "" H 2400 5000 50 0001 C CNN 46 | F 3 "" H 2400 5000 50 0001 C CNN 47 | 1 2400 5000 48 | 0 1 1 0 49 | $EndComp 50 | $Comp 51 | L power:GND #PWR09 52 | U 1 1 5D726474 53 | P 2400 4900 54 | F 0 "#PWR09" H 2400 4650 50 0001 C CNN 55 | F 1 "GND" V 2405 4772 50 0000 R CNN 56 | F 2 "" H 2400 4900 50 0001 C CNN 57 | F 3 "" H 2400 4900 50 0001 C CNN 58 | 1 2400 4900 59 | 0 -1 -1 0 60 | $EndComp 61 | $Comp 62 | L power:GND #PWR06 63 | U 1 1 5D72648B 64 | P 1900 4900 65 | F 0 "#PWR06" H 1900 4650 50 0001 C CNN 66 | F 1 "GND" V 1905 4772 50 0000 R CNN 67 | F 2 "" H 1900 4900 50 0001 C CNN 68 | F 3 "" H 1900 4900 50 0001 C CNN 69 | 1 1900 4900 70 | 0 1 1 0 71 | $EndComp 72 | $Comp 73 | L Device:L L1 74 | U 1 1 5D726529 75 | P 2950 1700 76 | F 0 "L1" V 2772 1700 50 0000 C CNN 77 | F 1 "L" V 2863 1700 50 0000 C CNN 78 | F 2 "Inductor_SMD:L_1210_3225Metric_Pad1.42x2.65mm_HandSolder" H 2950 1700 50 0001 C CNN 79 | F 3 "~" H 2950 1700 50 0001 C CNN 80 | 1 2950 1700 81 | 0 1 1 0 82 | $EndComp 83 | $Comp 84 | L Device:R R1 85 | U 1 1 5D726654 86 | P 3350 1700 87 | F 0 "R1" V 3143 1700 50 0000 C CNN 88 | F 1 "R" V 3234 1700 50 0000 C CNN 89 | F 2 "Resistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolder" V 3280 1700 50 0001 C CNN 90 | F 3 "~" H 3350 1700 50 0001 C CNN 91 | 1 3350 1700 92 | 0 1 1 0 93 | $EndComp 94 | Wire Wire Line 95 | 3100 1700 3200 1700 96 | $Comp 97 | L Device:C C2 98 | U 1 1 5D7267F4 99 | P 3600 1450 100 | F 0 "C2" H 3485 1404 50 0000 R CNN 101 | F 1 "C" H 3485 1495 50 0000 R CNN 102 | F 2 "Capacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolder" H 3638 1300 50 0001 C CNN 103 | F 3 "~" H 3600 1450 50 0001 C CNN 104 | 1 3600 1450 105 | -1 0 0 1 106 | $EndComp 107 | Wire Wire Line 108 | 3500 1700 3600 1700 109 | Wire Wire Line 110 | 3600 1700 3600 1600 111 | $Comp 112 | L power:GND #PWR011 113 | U 1 1 5D726888 114 | P 3600 1300 115 | F 0 "#PWR011" H 3600 1050 50 0001 C CNN 116 | F 1 "GND" H 3605 1127 50 0000 C CNN 117 | F 2 "" H 3600 1300 50 0001 C CNN 118 | F 3 "" H 3600 1300 50 0001 C CNN 119 | 1 3600 1300 120 | -1 0 0 1 121 | $EndComp 122 | $Comp 123 | L Device:L L2 124 | U 1 1 5D72720E 125 | P 2950 1800 126 | F 0 "L2" V 3048 1800 50 0000 C CNN 127 | F 1 "L" V 3139 1800 50 0000 C CNN 128 | F 2 "Inductor_SMD:L_1210_3225Metric_Pad1.42x2.65mm_HandSolder" H 2950 1800 50 0001 C CNN 129 | F 3 "~" H 2950 1800 50 0001 C CNN 130 | 1 2950 1800 131 | 0 1 1 0 132 | $EndComp 133 | $Comp 134 | L Device:R R2 135 | U 1 1 5D727214 136 | P 3350 1800 137 | F 0 "R2" V 3465 1800 50 0000 C CNN 138 | F 1 "R" V 3556 1800 50 0000 C CNN 139 | F 2 "Resistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolder" V 3280 1800 50 0001 C CNN 140 | F 3 "~" H 3350 1800 50 0001 C CNN 141 | 1 3350 1800 142 | 0 1 1 0 143 | $EndComp 144 | Wire Wire Line 145 | 3100 1800 3200 1800 146 | Connection ~ 3600 1700 147 | Text Label 2450 4700 0 50 ~ 0 148 | PWM_IN1 149 | Text Label 2450 4800 0 50 ~ 0 150 | PWM_IN2 151 | Text Label 1850 4500 2 50 ~ 0 152 | TRIGGER_OUT 153 | Text Label 1850 4600 2 50 ~ 0 154 | SWITCH_IN 155 | Wire Wire Line 156 | 1900 4500 1250 4500 157 | Wire Wire Line 158 | 1900 4600 1250 4600 159 | $Comp 160 | L Amplifier_Operational:L272M U1 161 | U 1 1 5D727EDB 162 | P 6300 2000 163 | F 0 "U1" H 6300 1633 50 0000 C CNN 164 | F 1 "L272M" H 6300 1724 50 0000 C CNN 165 | F 2 "Package_DIP:DIP-8_W7.62mm_LongPads" H 6300 2000 50 0001 C CNN 166 | F 3 "www.st.com/resource/en/datasheet/l272.pdf" H 6300 2000 50 0001 C CNN 167 | 1 6300 2000 168 | 1 0 0 1 169 | $EndComp 170 | $Comp 171 | L Amplifier_Operational:L272M U1 172 | U 2 1 5D727FAF 173 | P 6300 2600 174 | F 0 "U1" H 6300 2967 50 0000 C CNN 175 | F 1 "L272M" H 6300 2876 50 0000 C CNN 176 | F 2 "Package_DIP:DIP-8_W7.62mm_LongPads" H 6300 2600 50 0001 C CNN 177 | F 3 "www.st.com/resource/en/datasheet/l272.pdf" H 6300 2600 50 0001 C CNN 178 | 2 6300 2600 179 | 1 0 0 -1 180 | $EndComp 181 | $Comp 182 | L Amplifier_Operational:L272M U1 183 | U 3 1 5D7280CF 184 | P 6300 1000 185 | F 0 "U1" V 6303 1000 50 0000 C CNN 186 | F 1 "L272M" V 6394 1000 50 0000 C CNN 187 | F 2 "Package_DIP:DIP-8_W7.62mm_LongPads" H 6300 1000 50 0001 C CNN 188 | F 3 "www.st.com/resource/en/datasheet/l272.pdf" H 6300 1000 50 0001 C CNN 189 | 3 6300 1000 190 | 0 1 1 0 191 | $EndComp 192 | $Comp 193 | L power:+5V #PWR016 194 | U 1 1 5D7282C0 195 | P 6600 900 196 | F 0 "#PWR016" H 6600 750 50 0001 C CNN 197 | F 1 "+5V" V 6615 1028 50 0000 L CNN 198 | F 2 "" H 6600 900 50 0001 C CNN 199 | F 3 "" H 6600 900 50 0001 C CNN 200 | 1 6600 900 201 | 0 1 1 0 202 | $EndComp 203 | $Comp 204 | L power:GND #PWR015 205 | U 1 1 5D728318 206 | P 6000 900 207 | F 0 "#PWR015" H 6000 650 50 0001 C CNN 208 | F 1 "GND" V 6005 772 50 0000 R CNN 209 | F 2 "" H 6000 900 50 0001 C CNN 210 | F 3 "" H 6000 900 50 0001 C CNN 211 | 1 6000 900 212 | 0 1 1 0 213 | $EndComp 214 | Wire Wire Line 215 | 6000 2500 5900 2500 216 | Wire Wire Line 217 | 5900 2500 5900 2350 218 | Wire Wire Line 219 | 5900 2250 5900 2100 220 | Wire Wire Line 221 | 6000 2100 5900 2100 222 | $Comp 223 | L Device:R Rfb1 224 | U 1 1 5D72A7D6 225 | P 6300 1500 226 | F 0 "Rfb1" V 6093 1500 50 0000 C CNN 227 | F 1 "0" V 6184 1500 50 0000 C CNN 228 | F 2 "Resistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolder" V 6230 1500 50 0001 C CNN 229 | F 3 "~" H 6300 1500 50 0001 C CNN 230 | 1 6300 1500 231 | 0 1 1 0 232 | $EndComp 233 | $Comp 234 | L Device:R Rfb2 235 | U 1 1 5D72A826 236 | P 6300 2950 237 | F 0 "Rfb2" V 6415 2950 50 0000 C CNN 238 | F 1 "0" V 6506 2950 50 0000 C CNN 239 | F 2 "Resistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolder" V 6230 2950 50 0001 C CNN 240 | F 3 "~" H 6300 2950 50 0001 C CNN 241 | 1 6300 2950 242 | 0 1 1 0 243 | $EndComp 244 | Wire Wire Line 245 | 6000 2950 6150 2950 246 | Wire Wire Line 247 | 6450 2950 6600 2950 248 | Wire Wire Line 249 | 6000 1500 6150 1500 250 | Wire Wire Line 251 | 6000 1500 6000 1900 252 | Wire Wire Line 253 | 6450 1500 6600 1500 254 | Wire Wire Line 255 | 6600 1500 6600 2000 256 | Wire Wire Line 257 | 6000 2950 6000 2700 258 | Wire Wire Line 259 | 6600 2950 6600 2600 260 | $Comp 261 | L Device:R Rld2 262 | U 1 1 5D72C66E 263 | P 7150 2600 264 | F 0 "Rld2" H 7080 2554 50 0000 R CNN 265 | F 1 "R" H 7080 2645 50 0000 R CNN 266 | F 2 "Resistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolder" V 7080 2600 50 0001 C CNN 267 | F 3 "~" H 7150 2600 50 0001 C CNN 268 | 1 7150 2600 269 | -1 0 0 1 270 | $EndComp 271 | $Comp 272 | L Device:R Rld1 273 | U 1 1 5D72C6F2 274 | P 7150 2000 275 | F 0 "Rld1" H 7080 1954 50 0000 R CNN 276 | F 1 "R" H 7080 2045 50 0000 R CNN 277 | F 2 "Resistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolder" V 7080 2000 50 0001 C CNN 278 | F 3 "~" H 7150 2000 50 0001 C CNN 279 | 1 7150 2000 280 | -1 0 0 1 281 | $EndComp 282 | Wire Wire Line 283 | 7000 2150 7000 2000 284 | Wire Wire Line 285 | 7000 2600 7000 2450 286 | $Comp 287 | L pmod1:MAX4619 U2 288 | U 1 1 5D72E384 289 | P 9650 2200 290 | F 0 "U2" H 9650 2637 60 0000 C CNN 291 | F 1 "MAX4619" H 9650 2531 60 0000 C CNN 292 | F 2 "Package_DIP:DIP-16_W7.62mm_LongPads" H 9650 2200 60 0001 C CNN 293 | F 3 "" H 9650 2200 60 0000 C CNN 294 | 1 9650 2200 295 | 1 0 0 -1 296 | $EndComp 297 | Wire Wire Line 298 | 9050 2200 8950 2200 299 | Wire Wire Line 300 | 9100 2500 8950 2500 301 | Wire Wire Line 302 | 10000 2600 10200 2600 303 | Wire Wire Line 304 | 9300 2550 9150 2550 305 | Wire Wire Line 306 | 9150 2550 9150 2650 307 | Wire Wire Line 308 | 9300 2650 9150 2650 309 | $Comp 310 | L power:GND #PWR017 311 | U 1 1 5D72FE59 312 | P 9150 2750 313 | F 0 "#PWR017" H 9150 2500 50 0001 C CNN 314 | F 1 "GND" H 9155 2577 50 0000 C CNN 315 | F 2 "" H 9150 2750 50 0001 C CNN 316 | F 3 "" H 9150 2750 50 0001 C CNN 317 | 1 9150 2750 318 | 1 0 0 -1 319 | $EndComp 320 | Wire Wire Line 321 | 9150 2750 9150 2650 322 | Connection ~ 9150 2650 323 | $Comp 324 | L power:+5V #PWR018 325 | U 1 1 5D732EAB 326 | P 10100 2000 327 | F 0 "#PWR018" H 10100 1850 50 0001 C CNN 328 | F 1 "+5V" H 10115 2173 50 0000 C CNN 329 | F 2 "" H 10100 2000 50 0001 C CNN 330 | F 3 "" H 10100 2000 50 0001 C CNN 331 | 1 10100 2000 332 | 1 0 0 -1 333 | $EndComp 334 | Wire Wire Line 335 | 10100 2000 10000 2000 336 | $Comp 337 | L Device:R R7 338 | U 1 1 5D73465F 339 | P 10200 2850 340 | F 0 "R7" H 10130 2804 50 0000 R CNN 341 | F 1 "R" H 10130 2895 50 0000 R CNN 342 | F 2 "Resistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolder" V 10130 2850 50 0001 C CNN 343 | F 3 "~" H 10200 2850 50 0001 C CNN 344 | 1 10200 2850 345 | -1 0 0 1 346 | $EndComp 347 | Wire Wire Line 348 | 10200 2700 10200 2600 349 | $Comp 350 | L power:GND #PWR019 351 | U 1 1 5D734D41 352 | P 10200 3000 353 | F 0 "#PWR019" H 10200 2750 50 0001 C CNN 354 | F 1 "GND" H 10205 2827 50 0000 C CNN 355 | F 2 "" H 10200 3000 50 0001 C CNN 356 | F 3 "" H 10200 3000 50 0001 C CNN 357 | 1 10200 3000 358 | 1 0 0 -1 359 | $EndComp 360 | Text Label 10550 2600 0 50 ~ 0 361 | SWITCH_IN 362 | Text Label 10800 2100 0 50 ~ 0 363 | POWER_PREOUT 364 | Wire Wire Line 365 | 10200 2600 10550 2600 366 | Connection ~ 10200 2600 367 | Wire Wire Line 368 | 10000 2100 10550 2100 369 | $Comp 370 | L Device:C C1 371 | U 1 1 5D73789D 372 | P 1350 3300 373 | F 0 "C1" H 1235 3254 50 0000 R CNN 374 | F 1 "C" H 1235 3345 50 0000 R CNN 375 | F 2 "Capacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolder" H 1388 3150 50 0001 C CNN 376 | F 3 "~" H 1350 3300 50 0001 C CNN 377 | 1 1350 3300 378 | -1 0 0 1 379 | $EndComp 380 | $Comp 381 | L Connector:USB_B_Micro J1 382 | U 1 1 5D737A9D 383 | P 850 3350 384 | F 0 "J1" H 905 3817 50 0000 C CNN 385 | F 1 "USB_B_Micro" H 905 3726 50 0000 C CNN 386 | F 2 "custom:USB_Micro-B_Amphenol_hax" H 1000 3300 50 0001 C CNN 387 | F 3 "~" H 1000 3300 50 0001 C CNN 388 | 1 850 3350 389 | 1 0 0 -1 390 | $EndComp 391 | $Comp 392 | L power:GND #PWR01 393 | U 1 1 5D737B64 394 | P 850 3750 395 | F 0 "#PWR01" H 850 3500 50 0001 C CNN 396 | F 1 "GND" H 855 3577 50 0000 C CNN 397 | F 2 "" H 850 3750 50 0001 C CNN 398 | F 3 "" H 850 3750 50 0001 C CNN 399 | 1 850 3750 400 | 1 0 0 -1 401 | $EndComp 402 | Wire Wire Line 403 | 1150 3150 1350 3150 404 | $Comp 405 | L power:+5V #PWR08 406 | U 1 1 5D739175 407 | P 3550 3150 408 | F 0 "#PWR08" H 3550 3000 50 0001 C CNN 409 | F 1 "+5V" V 3565 3278 50 0000 L CNN 410 | F 2 "" H 3550 3150 50 0001 C CNN 411 | F 3 "" H 3550 3150 50 0001 C CNN 412 | 1 3550 3150 413 | 0 1 1 0 414 | $EndComp 415 | NoConn ~ 750 3750 416 | NoConn ~ 1150 3550 417 | NoConn ~ 1150 3450 418 | NoConn ~ 1150 3350 419 | Wire Wire Line 420 | 6600 2000 7000 2000 421 | Connection ~ 6600 2000 422 | Wire Wire Line 423 | 6600 2600 7000 2600 424 | Connection ~ 6600 2600 425 | Wire Notes Line 426 | 5600 750 5600 3250 427 | Wire Notes Line 428 | 5600 750 6950 750 429 | Wire Notes Line 430 | 6950 750 6950 3250 431 | Wire Notes Line 432 | 5600 3250 6950 3250 433 | Wire Notes Line 434 | 4550 1000 4550 2500 435 | Wire Notes Line 436 | 2750 2500 2750 1000 437 | Text Notes 2800 2450 0 50 ~ 0 438 | PWM filter/caps 439 | Text Notes 5650 3200 0 50 ~ 0 440 | pre-switch\nopamp 441 | $Comp 442 | L Connector_Generic:Conn_01x06 J3 443 | U 1 1 5D745A80 444 | P 2150 5600 445 | F 0 "J3" H 2230 5592 50 0000 L CNN 446 | F 1 "Conn_01x04" H 2230 5501 50 0000 L CNN 447 | F 2 "Connector_PinHeader_2.54mm:PinHeader_1x06_P2.54mm_Vertical" H 2150 5600 50 0001 C CNN 448 | F 3 "~" H 2150 5600 50 0001 C CNN 449 | 1 2150 5600 450 | 1 0 0 -1 451 | $EndComp 452 | Text Label 1950 6350 2 50 ~ 0 453 | TRIGGER_OUT 454 | Text Label 1950 5600 2 50 ~ 0 455 | POWER_OUT 456 | Wire Wire Line 457 | 1950 5500 1400 5500 458 | Wire Wire Line 459 | 1950 5800 1400 5800 460 | Wire Wire Line 461 | 1950 5900 1400 5900 462 | Wire Wire Line 463 | 1950 5400 1400 5400 464 | $Comp 465 | L power:GND #PWR02 466 | U 1 1 5D748B3E 467 | P 1400 5400 468 | F 0 "#PWR02" H 1400 5150 50 0001 C CNN 469 | F 1 "GND" V 1405 5272 50 0000 R CNN 470 | F 2 "" H 1400 5400 50 0001 C CNN 471 | F 3 "" H 1400 5400 50 0001 C CNN 472 | 1 1400 5400 473 | 0 1 1 0 474 | $EndComp 475 | $Comp 476 | L power:PWR_FLAG #FLG01 477 | U 1 1 5D74BD45 478 | P 1900 5000 479 | F 0 "#FLG01" H 1900 5075 50 0001 C CNN 480 | F 1 "PWR_FLAG" H 1900 5173 50 0000 C CNN 481 | F 2 "" H 1900 5000 50 0001 C CNN 482 | F 3 "~" H 1900 5000 50 0001 C CNN 483 | 1 1900 5000 484 | -1 0 0 1 485 | $EndComp 486 | Connection ~ 1900 5000 487 | $Comp 488 | L power:GND #PWR05 489 | U 1 1 5D74D073 490 | P 1350 3450 491 | F 0 "#PWR05" H 1350 3200 50 0001 C CNN 492 | F 1 "GND" H 1355 3277 50 0000 C CNN 493 | F 2 "" H 1350 3450 50 0001 C CNN 494 | F 3 "" H 1350 3450 50 0001 C CNN 495 | 1 1350 3450 496 | 1 0 0 -1 497 | $EndComp 498 | Text Label 1950 6450 2 50 ~ 0 499 | TRIGGER_OUT 500 | $Comp 501 | L Connector_Generic:Conn_01x06 J4 502 | U 1 1 5D74F30C 503 | P 2150 6550 504 | F 0 "J4" H 2230 6542 50 0000 L CNN 505 | F 1 "Conn_01x04" H 2230 6451 50 0000 L CNN 506 | F 2 "Connector_PinHeader_2.54mm:PinHeader_1x06_P2.54mm_Vertical" H 2150 6550 50 0001 C CNN 507 | F 3 "~" H 2150 6550 50 0001 C CNN 508 | 1 2150 6550 509 | 1 0 0 -1 510 | $EndComp 511 | $Comp 512 | L power:GND #PWR03 513 | U 1 1 5D74F811 514 | P 1400 5800 515 | F 0 "#PWR03" H 1400 5550 50 0001 C CNN 516 | F 1 "GND" V 1405 5672 50 0000 R CNN 517 | F 2 "" H 1400 5800 50 0001 C CNN 518 | F 3 "" H 1400 5800 50 0001 C CNN 519 | 1 1400 5800 520 | 0 1 1 0 521 | $EndComp 522 | Text Label 1950 6550 2 50 ~ 0 523 | TRIGGER_OUT 524 | Text Notes 2250 7150 0 50 ~ 0 525 | debug/extras 526 | Text Notes 2250 5850 0 50 ~ 0 527 | interface 528 | $Comp 529 | L power:+5V #PWR04 530 | U 1 1 5D752721 531 | P 1400 5900 532 | F 0 "#PWR04" H 1400 5750 50 0001 C CNN 533 | F 1 "+5V" V 1415 6028 50 0000 L CNN 534 | F 2 "" H 1400 5900 50 0001 C CNN 535 | F 3 "" H 1400 5900 50 0001 C CNN 536 | 1 1400 5900 537 | 0 -1 -1 0 538 | $EndComp 539 | Wire Wire Line 540 | 1400 6450 1950 6450 541 | Wire Wire Line 542 | 1400 6550 1950 6550 543 | Wire Wire Line 544 | 2800 1800 2400 1800 545 | Wire Wire Line 546 | 2800 1700 2400 1700 547 | Text Label 2400 1700 0 50 ~ 0 548 | PWM_IN1 549 | Text Label 2400 1800 0 50 ~ 0 550 | PWM_IN2 551 | Wire Wire Line 552 | 2400 4700 2450 4700 553 | Wire Wire Line 554 | 2400 4800 2450 4800 555 | Wire Wire Line 556 | 5900 2250 5550 2250 557 | Wire Wire Line 558 | 5900 2350 5550 2350 559 | Text Label 5000 1700 2 50 ~ 0 560 | PWM_FILT1 561 | Text Label 5000 1800 2 50 ~ 0 562 | PWM_FILT2 563 | $Comp 564 | L Device:C C4 565 | U 1 1 5D764D01 566 | P 3600 2050 567 | F 0 "C4" H 3715 2096 50 0000 L CNN 568 | F 1 "C" H 3715 2005 50 0000 L CNN 569 | F 2 "Capacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolder" H 3638 1900 50 0001 C CNN 570 | F 3 "~" H 3600 2050 50 0001 C CNN 571 | 1 3600 2050 572 | 1 0 0 -1 573 | $EndComp 574 | $Comp 575 | L power:GND #PWR013 576 | U 1 1 5D764D07 577 | P 3600 2200 578 | F 0 "#PWR013" H 3600 1950 50 0001 C CNN 579 | F 1 "GND" H 3605 2027 50 0000 C CNN 580 | F 2 "" H 3600 2200 50 0001 C CNN 581 | F 3 "" H 3600 2200 50 0001 C CNN 582 | 1 3600 2200 583 | 1 0 0 -1 584 | $EndComp 585 | Wire Wire Line 586 | 3600 1900 3600 1800 587 | Text Label 5550 2250 2 50 ~ 0 588 | PWM_FILT1 589 | Text Label 5550 2350 2 50 ~ 0 590 | PWM_FILT2 591 | $Comp 592 | L Device:C C6 593 | U 1 1 5D7751F7 594 | P 3250 3300 595 | F 0 "C6" H 3135 3254 50 0000 R CNN 596 | F 1 "C" H 3135 3345 50 0000 R CNN 597 | F 2 "Capacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolder" H 3288 3150 50 0001 C CNN 598 | F 3 "~" H 3250 3300 50 0001 C CNN 599 | 1 3250 3300 600 | -1 0 0 1 601 | $EndComp 602 | $Comp 603 | L power:GND #PWR020 604 | U 1 1 5D7751FD 605 | P 3250 3450 606 | F 0 "#PWR020" H 3250 3200 50 0001 C CNN 607 | F 1 "GND" H 3255 3277 50 0000 C CNN 608 | F 2 "" H 3250 3450 50 0001 C CNN 609 | F 3 "" H 3250 3450 50 0001 C CNN 610 | 1 3250 3450 611 | 1 0 0 -1 612 | $EndComp 613 | Wire Wire Line 614 | 3600 1700 3950 1700 615 | Wire Wire Line 616 | 3500 1800 3600 1800 617 | Connection ~ 3600 1800 618 | Wire Wire Line 619 | 3600 1800 3950 1800 620 | $Comp 621 | L Device:C C3 622 | U 1 1 5D781A63 623 | P 4300 1450 624 | F 0 "C3" H 4185 1404 50 0000 R CNN 625 | F 1 "C" H 4185 1495 50 0000 R CNN 626 | F 2 "Capacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolder" H 4338 1300 50 0001 C CNN 627 | F 3 "~" H 4300 1450 50 0001 C CNN 628 | 1 4300 1450 629 | -1 0 0 1 630 | $EndComp 631 | Wire Wire Line 632 | 4300 1700 4300 1600 633 | $Comp 634 | L power:GND #PWR0101 635 | U 1 1 5D781A6A 636 | P 4300 1300 637 | F 0 "#PWR0101" H 4300 1050 50 0001 C CNN 638 | F 1 "GND" H 4305 1127 50 0000 C CNN 639 | F 2 "" H 4300 1300 50 0001 C CNN 640 | F 3 "" H 4300 1300 50 0001 C CNN 641 | 1 4300 1300 642 | -1 0 0 1 643 | $EndComp 644 | Wire Wire Line 645 | 4300 1700 5000 1700 646 | $Comp 647 | L Device:C C5 648 | U 1 1 5D782C02 649 | P 4300 2050 650 | F 0 "C5" H 4415 2096 50 0000 L CNN 651 | F 1 "C" H 4415 2005 50 0000 L CNN 652 | F 2 "Capacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolder" H 4338 1900 50 0001 C CNN 653 | F 3 "~" H 4300 2050 50 0001 C CNN 654 | 1 4300 2050 655 | 1 0 0 -1 656 | $EndComp 657 | $Comp 658 | L power:GND #PWR0102 659 | U 1 1 5D782C08 660 | P 4300 2200 661 | F 0 "#PWR0102" H 4300 1950 50 0001 C CNN 662 | F 1 "GND" H 4305 2027 50 0000 C CNN 663 | F 2 "" H 4300 2200 50 0001 C CNN 664 | F 3 "" H 4300 2200 50 0001 C CNN 665 | 1 4300 2200 666 | 1 0 0 -1 667 | $EndComp 668 | Wire Wire Line 669 | 4300 1900 4300 1800 670 | Wire Wire Line 671 | 4300 1800 5000 1800 672 | $Comp 673 | L power:GND #PWR0103 674 | U 1 1 5D756549 675 | P 1950 6750 676 | F 0 "#PWR0103" H 1950 6500 50 0001 C CNN 677 | F 1 "GND" V 1955 6622 50 0000 R CNN 678 | F 2 "" H 1950 6750 50 0001 C CNN 679 | F 3 "" H 1950 6750 50 0001 C CNN 680 | 1 1950 6750 681 | 0 1 1 0 682 | $EndComp 683 | $Comp 684 | L power:GND #PWR0104 685 | U 1 1 5D756582 686 | P 1950 6650 687 | F 0 "#PWR0104" H 1950 6400 50 0001 C CNN 688 | F 1 "GND" V 1955 6522 50 0000 R CNN 689 | F 2 "" H 1950 6650 50 0001 C CNN 690 | F 3 "" H 1950 6650 50 0001 C CNN 691 | 1 1950 6650 692 | 0 1 1 0 693 | $EndComp 694 | $Comp 695 | L power:GND #PWR0105 696 | U 1 1 5D756884 697 | P 1950 6850 698 | F 0 "#PWR0105" H 1950 6600 50 0001 C CNN 699 | F 1 "GND" V 1955 6722 50 0000 R CNN 700 | F 2 "" H 1950 6850 50 0001 C CNN 701 | F 3 "" H 1950 6850 50 0001 C CNN 702 | 1 1950 6850 703 | 0 1 1 0 704 | $EndComp 705 | Text Label 1950 5700 2 50 ~ 0 706 | POWER_OUT 707 | Wire Wire Line 708 | 1950 5700 1400 5700 709 | Wire Wire Line 710 | 1950 5600 1400 5600 711 | $Comp 712 | L power:GND #PWR0106 713 | U 1 1 5D75B3CD 714 | P 1400 5500 715 | F 0 "#PWR0106" H 1400 5250 50 0001 C CNN 716 | F 1 "GND" V 1405 5372 50 0000 R CNN 717 | F 2 "" H 1400 5500 50 0001 C CNN 718 | F 3 "" H 1400 5500 50 0001 C CNN 719 | 1 1400 5500 720 | 0 1 1 0 721 | $EndComp 722 | Wire Wire Line 723 | 9100 2000 9200 2000 724 | Wire Wire Line 725 | 9100 2000 9100 2500 726 | Wire Wire Line 727 | 9050 2200 9050 2100 728 | Wire Wire Line 729 | 9050 2100 9150 2100 730 | Text Label 1950 7050 2 50 ~ 0 731 | SWITCH_IN 732 | Text Label 1950 7250 2 50 ~ 0 733 | PWM_IN1 734 | Text Label 1950 7150 2 50 ~ 0 735 | PWM_IN2 736 | Wire Wire Line 737 | 10000 2700 10000 2600 738 | Connection ~ 10000 2600 739 | Wire Wire Line 740 | 10000 2600 10000 2500 741 | Wire Wire Line 742 | 9300 2300 9250 2300 743 | Wire Wire Line 744 | 9250 2300 9250 1700 745 | Wire Wire Line 746 | 9250 1700 10550 1700 747 | Wire Wire Line 748 | 10550 1700 10550 2100 749 | Wire Wire Line 750 | 10000 2200 10550 2200 751 | Wire Wire Line 752 | 10550 2200 10550 2100 753 | Connection ~ 10550 2100 754 | Wire Wire Line 755 | 9200 2000 9200 2200 756 | Wire Wire Line 757 | 9200 2200 9300 2200 758 | Connection ~ 9200 2000 759 | Wire Wire Line 760 | 9200 2000 9300 2000 761 | Wire Wire Line 762 | 9200 2000 9200 1650 763 | Wire Wire Line 764 | 9200 1650 10600 1650 765 | Wire Wire Line 766 | 10600 1650 10600 2300 767 | Wire Wire Line 768 | 10600 2300 10000 2300 769 | Wire Wire Line 770 | 9300 2400 9150 2400 771 | Wire Wire Line 772 | 9150 2400 9150 2100 773 | Connection ~ 9150 2100 774 | Wire Wire Line 775 | 9150 2100 9300 2100 776 | Wire Wire Line 777 | 9150 2100 9150 1600 778 | Wire Wire Line 779 | 9150 1600 10650 1600 780 | Wire Wire Line 781 | 10650 1600 10650 2400 782 | Wire Wire Line 783 | 10650 2400 10000 2400 784 | $Comp 785 | L power:GND #PWR0108 786 | U 1 1 5DEE7BE0 787 | P 3900 5300 788 | F 0 "#PWR0108" H 3900 5050 50 0001 C CNN 789 | F 1 "GND" V 3905 5172 50 0000 R CNN 790 | F 2 "" H 3900 5300 50 0001 C CNN 791 | F 3 "" H 3900 5300 50 0001 C CNN 792 | 1 3900 5300 793 | 0 -1 -1 0 794 | $EndComp 795 | $Comp 796 | L Device:R R3 797 | U 1 1 5DEEBB20 798 | P 3750 5300 799 | F 0 "R3" V 3543 5300 50 0000 C CNN 800 | F 1 "R" V 3634 5300 50 0000 C CNN 801 | F 2 "Resistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolder" V 3680 5300 50 0001 C CNN 802 | F 3 "~" H 3750 5300 50 0001 C CNN 803 | 1 3750 5300 804 | 0 1 1 0 805 | $EndComp 806 | Text Label 3600 5300 2 50 ~ 0 807 | TRIGGER_OUT 808 | Wire Wire Line 809 | 10550 2100 10800 2100 810 | Connection ~ 1350 3150 811 | $Comp 812 | L Device:C C7 813 | U 1 1 5DEF82A1 814 | P 2150 3300 815 | F 0 "C7" H 2035 3254 50 0000 R CNN 816 | F 1 "C" H 2035 3345 50 0000 R CNN 817 | F 2 "Capacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolder" H 2188 3150 50 0001 C CNN 818 | F 3 "~" H 2150 3300 50 0001 C CNN 819 | 1 2150 3300 820 | -1 0 0 1 821 | $EndComp 822 | $Comp 823 | L power:GND #PWR0109 824 | U 1 1 5DEF82F3 825 | P 2150 3450 826 | F 0 "#PWR0109" H 2150 3200 50 0001 C CNN 827 | F 1 "GND" H 2155 3277 50 0000 C CNN 828 | F 2 "" H 2150 3450 50 0001 C CNN 829 | F 3 "" H 2150 3450 50 0001 C CNN 830 | 1 2150 3450 831 | 1 0 0 -1 832 | $EndComp 833 | Wire Wire Line 834 | 1800 3150 2150 3150 835 | $Comp 836 | L Device:Ferrite_Bead_Small L3 837 | U 1 1 5DEFCB26 838 | P 1700 3150 839 | F 0 "L3" V 1463 3150 50 0000 C CNN 840 | F 1 "Ferrite_Bead_Small" V 1554 3150 50 0000 C CNN 841 | F 2 "Inductor_SMD:L_0805_2012Metric_Pad1.15x1.40mm_HandSolder" V 1630 3150 50 0001 C CNN 842 | F 3 "~" H 1700 3150 50 0001 C CNN 843 | 1 1700 3150 844 | 0 1 1 0 845 | $EndComp 846 | Wire Wire Line 847 | 1350 3150 1600 3150 848 | Text Label 6100 5200 0 50 ~ 0 849 | PWM_FILT1 850 | Text Label 6100 4900 0 50 ~ 0 851 | PWM_FILT2 852 | Wire Wire Line 853 | 5100 5000 4950 5000 854 | $Comp 855 | L power:GND #PWR014 856 | U 1 1 5DF02AAE 857 | P 4950 5000 858 | F 0 "#PWR014" H 4950 4750 50 0001 C CNN 859 | F 1 "GND" V 4950 4800 50 0000 C CNN 860 | F 2 "" H 4950 5000 50 0001 C CNN 861 | F 3 "" H 4950 5000 50 0001 C CNN 862 | 1 4950 5000 863 | 0 1 1 0 864 | $EndComp 865 | Wire Wire Line 866 | 5100 5200 4500 5200 867 | $Comp 868 | L power:+5V #PWR021 869 | U 1 1 5DF14122 870 | P 5600 4450 871 | F 0 "#PWR021" H 5600 4300 50 0001 C CNN 872 | F 1 "+5V" H 5688 4487 50 0000 L CNN 873 | F 2 "" H 5600 4450 50 0001 C CNN 874 | F 3 "" H 5600 4450 50 0001 C CNN 875 | 1 5600 4450 876 | 1 0 0 -1 877 | $EndComp 878 | Wire Wire Line 879 | 5600 4600 5600 4450 880 | $Comp 881 | L power:GND #PWR022 882 | U 1 1 5DF16AB4 883 | P 5600 5600 884 | F 0 "#PWR022" H 5600 5350 50 0001 C CNN 885 | F 1 "GND" V 5600 5400 50 0000 C CNN 886 | F 2 "" H 5600 5600 50 0001 C CNN 887 | F 3 "" H 5600 5600 50 0001 C CNN 888 | 1 5600 5600 889 | 1 0 0 -1 890 | $EndComp 891 | Wire Wire Line 892 | 5600 5500 5600 5600 893 | Text Label 4500 4900 0 50 ~ 0 894 | PWM_IN1 895 | Text Label 4500 5200 0 50 ~ 0 896 | PWM_IN2 897 | Text Label 4500 5100 0 50 ~ 0 898 | SDI_IN 899 | Text Label 2450 4600 0 50 ~ 0 900 | SDI_IN 901 | Wire Wire Line 902 | 2400 4600 2450 4600 903 | Text Label 1900 4700 2 50 ~ 0 904 | GPIO1 905 | Text Label 1900 4800 2 50 ~ 0 906 | GPIO2 907 | Text Label 4050 6500 2 50 ~ 0 908 | GPIO1 909 | Text Label 4050 6600 2 50 ~ 0 910 | GPIO2 911 | $Comp 912 | L Connector_Generic:Conn_01x06 J6 913 | U 1 1 5DF20C03 914 | P 4250 6700 915 | F 0 "J6" H 4330 6692 50 0000 L CNN 916 | F 1 "Conn_01x04" H 4330 6601 50 0000 L CNN 917 | F 2 "Connector_PinHeader_2.54mm:PinHeader_1x06_P2.54mm_Vertical" H 4250 6700 50 0001 C CNN 918 | F 3 "~" H 4250 6700 50 0001 C CNN 919 | 1 4250 6700 920 | 1 0 0 -1 921 | $EndComp 922 | $Comp 923 | L Connector_Generic:Conn_01x05 J5 924 | U 1 1 5DF2137D 925 | P 2150 7250 926 | F 0 "J5" H 2230 7242 50 0000 L CNN 927 | F 1 "Conn_01x04" H 2230 7151 50 0000 L CNN 928 | F 2 "Connector_PinHeader_2.54mm:PinHeader_1x05_P2.54mm_Vertical" H 2150 7250 50 0001 C CNN 929 | F 3 "~" H 2150 7250 50 0001 C CNN 930 | 1 2150 7250 931 | 1 0 0 -1 932 | $EndComp 933 | Text Label 1950 7350 2 50 ~ 0 934 | SDI_IN 935 | $Comp 936 | L power:GND #PWR0110 937 | U 1 1 5DF21917 938 | P 1950 7450 939 | F 0 "#PWR0110" H 1950 7200 50 0001 C CNN 940 | F 1 "GND" V 1955 7322 50 0000 R CNN 941 | F 2 "" H 1950 7450 50 0001 C CNN 942 | F 3 "" H 1950 7450 50 0001 C CNN 943 | 1 1950 7450 944 | 0 1 1 0 945 | $EndComp 946 | Text Label 4050 6800 2 50 ~ 0 947 | SDI_IN 948 | $Comp 949 | L power:GND #PWR0111 950 | U 1 1 5DF22C5C 951 | P 4050 7000 952 | F 0 "#PWR0111" H 4050 6750 50 0001 C CNN 953 | F 1 "GND" V 4055 6872 50 0000 R CNN 954 | F 2 "" H 4050 7000 50 0001 C CNN 955 | F 3 "" H 4050 7000 50 0001 C CNN 956 | 1 4050 7000 957 | 0 1 1 0 958 | $EndComp 959 | Text Label 2450 4500 0 50 ~ 0 960 | GPIO3 961 | Wire Wire Line 962 | 2400 4500 2450 4500 963 | Text Label 4050 6700 2 50 ~ 0 964 | GPIO3 965 | $Comp 966 | L Analog_DAC:MCP4822 U3 967 | U 1 1 5DF29A02 968 | P 5600 5000 969 | F 0 "U3" H 5600 5578 50 0000 C CNN 970 | F 1 "MCP4822" H 5600 5487 50 0000 C CNN 971 | F 2 "Package_SO:SOIC-8_3.9x4.9mm_P1.27mm" H 6400 4700 50 0001 C CNN 972 | F 3 "http://ww1.microchip.com/downloads/en/DeviceDoc/20002249B.pdf" H 6400 4700 50 0001 C CNN 973 | 1 5600 5000 974 | 1 0 0 -1 975 | $EndComp 976 | Wire Wire Line 977 | 5100 5100 4500 5100 978 | Wire Wire Line 979 | 5100 4900 4500 4900 980 | $Comp 981 | L Device:R R5 982 | U 1 1 5DF500E8 983 | P 4100 1800 984 | F 0 "R5" V 4215 1800 50 0000 C CNN 985 | F 1 "R" V 4306 1800 50 0000 C CNN 986 | F 2 "Resistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolder" V 4030 1800 50 0001 C CNN 987 | F 3 "~" H 4100 1800 50 0001 C CNN 988 | 1 4100 1800 989 | 0 1 1 0 990 | $EndComp 991 | $Comp 992 | L Device:R R4 993 | U 1 1 5DF50158 994 | P 4100 1700 995 | F 0 "R4" V 3893 1700 50 0000 C CNN 996 | F 1 "R" V 3984 1700 50 0000 C CNN 997 | F 2 "Resistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolder" V 4030 1700 50 0001 C CNN 998 | F 3 "~" H 4100 1700 50 0001 C CNN 999 | 1 4100 1700 1000 | 0 1 1 0 1001 | $EndComp 1002 | Wire Wire Line 1003 | 4300 1700 4250 1700 1004 | Wire Wire Line 1005 | 4250 1800 4300 1800 1006 | Connection ~ 4300 1700 1007 | Connection ~ 4300 1800 1008 | Wire Notes Line 1009 | 2750 2500 4550 2500 1010 | Wire Notes Line 1011 | 2750 1000 4550 1000 1012 | $Comp 1013 | L pmod1:TS5A63157 U4 1014 | U 1 1 5DED97DD 1015 | P 9000 4050 1016 | F 0 "U4" H 8975 4200 50 0000 C CNN 1017 | F 1 "TS5A63157" H 8975 4291 50 0000 C CNN 1018 | F 2 "Package_TO_SOT_SMD:SOT-23-6" H 9000 3750 50 0001 C CNN 1019 | F 3 "" H 9000 4050 50 0001 C CNN 1020 | 1 9000 4050 1021 | -1 0 0 1 1022 | $EndComp 1023 | Text Label 7300 2150 0 50 ~ 0 1024 | PRESWITCH_1 1025 | Text Label 7300 2450 0 50 ~ 0 1026 | PRESWITCH_2 1027 | Text Label 8950 2200 2 50 ~ 0 1028 | PRESWITCH_1 1029 | Text Label 8950 2500 2 50 ~ 0 1030 | PRESWITCH_2 1031 | Text Label 8700 4050 2 50 ~ 0 1032 | PRESWITCH_1 1033 | Text Label 8700 3850 2 50 ~ 0 1034 | PRESWITCH_2 1035 | $Comp 1036 | L power:GND #PWR0113 1037 | U 1 1 5DEE3BEF 1038 | P 9350 3850 1039 | F 0 "#PWR0113" H 9350 3600 50 0001 C CNN 1040 | F 1 "GND" H 9355 3677 50 0000 C CNN 1041 | F 2 "" H 9350 3850 50 0001 C CNN 1042 | F 3 "" H 9350 3850 50 0001 C CNN 1043 | 1 9350 3850 1044 | 0 -1 -1 0 1045 | $EndComp 1046 | $Comp 1047 | L power:+5V #PWR0114 1048 | U 1 1 5DEE3FBA 1049 | P 9350 4050 1050 | F 0 "#PWR0114" H 9350 3900 50 0001 C CNN 1051 | F 1 "+5V" V 9365 4178 50 0000 L CNN 1052 | F 2 "" H 9350 4050 50 0001 C CNN 1053 | F 3 "" H 9350 4050 50 0001 C CNN 1054 | 1 9350 4050 1055 | 0 1 1 0 1056 | $EndComp 1057 | Text Label 9600 3950 0 50 ~ 0 1058 | POWER_PREOUT 1059 | Wire Wire Line 1060 | 9300 3950 9600 3950 1061 | Text Label 9000 3650 1 50 ~ 0 1062 | SWITCH_IN 1063 | $Comp 1064 | L pmod1:trigger U5 1065 | U 1 1 5DEEAACD 1066 | P 9850 5200 1067 | F 0 "U5" H 10191 5246 50 0000 L CNN 1068 | F 1 "trigger" H 10191 5155 50 0000 L CNN 1069 | F 2 "Package_TO_SOT_SMD:SOT-23-6" H 9850 5200 50 0001 C CNN 1070 | F 3 "" H 9850 5200 50 0001 C CNN 1071 | 1 9850 5200 1072 | 1 0 0 -1 1073 | $EndComp 1074 | Text Label 9550 5200 2 50 ~ 0 1075 | BUF1_IN 1076 | Text Label 10150 5200 0 50 ~ 0 1077 | BUF1_OUT 1078 | $Comp 1079 | L power:GND #PWR0115 1080 | U 1 1 5DEEAD36 1081 | P 9750 5500 1082 | F 0 "#PWR0115" H 9750 5250 50 0001 C CNN 1083 | F 1 "GND" V 9755 5372 50 0000 R CNN 1084 | F 2 "" H 9750 5500 50 0001 C CNN 1085 | F 3 "" H 9750 5500 50 0001 C CNN 1086 | 1 9750 5500 1087 | 1 0 0 -1 1088 | $EndComp 1089 | $Comp 1090 | L power:+3.3V #PWR0116 1091 | U 1 1 5DEEAE11 1092 | P 9750 4900 1093 | F 0 "#PWR0116" H 9750 4750 50 0001 C CNN 1094 | F 1 "+3.3V" V 9765 5028 50 0000 L CNN 1095 | F 2 "" H 9750 4900 50 0001 C CNN 1096 | F 3 "" H 9750 4900 50 0001 C CNN 1097 | 1 9750 4900 1098 | 1 0 0 -1 1099 | $EndComp 1100 | $Comp 1101 | L Connector_Generic:Conn_01x06 J7 1102 | U 1 1 5DEDB3E2 1103 | P 7450 5200 1104 | F 0 "J7" H 7530 5192 50 0000 L CNN 1105 | F 1 "Conn_01x04" H 7530 5101 50 0000 L CNN 1106 | F 2 "Connector_PinHeader_2.54mm:PinHeader_1x06_P2.54mm_Vertical" H 7450 5200 50 0001 C CNN 1107 | F 3 "~" H 7450 5200 50 0001 C CNN 1108 | 1 7450 5200 1109 | 1 0 0 -1 1110 | $EndComp 1111 | Text Label 7250 5200 2 50 ~ 0 1112 | BUF1_IN 1113 | Text Label 7250 5300 2 50 ~ 0 1114 | BUF1_OUT 1115 | $Comp 1116 | L pmod1:trigger U6 1117 | U 1 1 5DEDE98F 1118 | P 8900 5800 1119 | F 0 "U6" H 9241 5846 50 0000 L CNN 1120 | F 1 "trigger" H 9241 5755 50 0000 L CNN 1121 | F 2 "Package_TO_SOT_SMD:SOT-23-6" H 8900 5800 50 0001 C CNN 1122 | F 3 "" H 8900 5800 50 0001 C CNN 1123 | 1 8900 5800 1124 | 1 0 0 -1 1125 | $EndComp 1126 | Text Label 8600 5800 2 50 ~ 0 1127 | BUF2_IN 1128 | Text Label 9200 5800 0 50 ~ 0 1129 | BUF2_OUT 1130 | $Comp 1131 | L power:GND #PWR0117 1132 | U 1 1 5DEDE997 1133 | P 8800 6100 1134 | F 0 "#PWR0117" H 8800 5850 50 0001 C CNN 1135 | F 1 "GND" V 8805 5972 50 0000 R CNN 1136 | F 2 "" H 8800 6100 50 0001 C CNN 1137 | F 3 "" H 8800 6100 50 0001 C CNN 1138 | 1 8800 6100 1139 | 1 0 0 -1 1140 | $EndComp 1141 | $Comp 1142 | L power:+3.3V #PWR0118 1143 | U 1 1 5DEDE99D 1144 | P 8800 5500 1145 | F 0 "#PWR0118" H 8800 5350 50 0001 C CNN 1146 | F 1 "+3.3V" V 8815 5628 50 0000 L CNN 1147 | F 2 "" H 8800 5500 50 0001 C CNN 1148 | F 3 "" H 8800 5500 50 0001 C CNN 1149 | 1 8800 5500 1150 | 1 0 0 -1 1151 | $EndComp 1152 | Text Label 7250 5400 2 50 ~ 0 1153 | BUF2_IN 1154 | Text Label 7250 5500 2 50 ~ 0 1155 | BUF2_OUT 1156 | $Comp 1157 | L pmod1:MAX4232 U7 1158 | U 1 1 5DEE7C16 1159 | P 6750 3400 1160 | F 0 "U7" H 6750 3465 50 0000 C CNN 1161 | F 1 "MAX4232" H 6750 3374 50 0000 C CNN 1162 | F 2 "Package_TO_SOT_SMD:SOT-23-8" H 6750 3400 50 0001 C CNN 1163 | F 3 "" H 6750 3400 50 0001 C CNN 1164 | 1 6750 3400 1165 | 1 0 0 -1 1166 | $EndComp 1167 | $Comp 1168 | L power:GND #PWR0119 1169 | U 1 1 5DEE8240 1170 | P 6250 3900 1171 | F 0 "#PWR0119" H 6250 3650 50 0001 C CNN 1172 | F 1 "GND" V 6255 3772 50 0000 R CNN 1173 | F 2 "" H 6250 3900 50 0001 C CNN 1174 | F 3 "" H 6250 3900 50 0001 C CNN 1175 | 1 6250 3900 1176 | 0 1 1 0 1177 | $EndComp 1178 | $Comp 1179 | L power:+5V #PWR0120 1180 | U 1 1 5DEE8351 1181 | P 7250 3600 1182 | F 0 "#PWR0120" H 7250 3450 50 0001 C CNN 1183 | F 1 "+5V" V 7265 3728 50 0000 L CNN 1184 | F 2 "" H 7250 3600 50 0001 C CNN 1185 | F 3 "" H 7250 3600 50 0001 C CNN 1186 | 1 7250 3600 1187 | 0 1 1 0 1188 | $EndComp 1189 | Text Label 6250 3800 2 50 ~ 0 1190 | PWM_FILT1 1191 | Text Label 7250 3900 0 50 ~ 0 1192 | PWM_FILT2 1193 | $Comp 1194 | L pmod1:AP2210N-4.0 U8 1195 | U 1 1 5DEEFBA8 1196 | P 2650 3150 1197 | F 0 "U8" H 2650 3392 50 0000 C CNN 1198 | F 1 "AP2210N-4.0" H 2650 3301 50 0000 C CNN 1199 | F 2 "Package_TO_SOT_SMD:TSOT-23" H 2650 3375 50 0001 C CIN 1200 | F 3 "https://www.diodes.com/assets/Datasheets/AP2127.pdf" H 2650 3150 50 0001 C CNN 1201 | 1 2650 3150 1202 | 1 0 0 -1 1203 | $EndComp 1204 | Wire Wire Line 1205 | 2350 3150 2150 3150 1206 | Connection ~ 2150 3150 1207 | Wire Wire Line 1208 | 2950 3150 3250 3150 1209 | Connection ~ 3250 3150 1210 | Wire Wire Line 1211 | 3250 3150 3550 3150 1212 | $Comp 1213 | L power:GND #PWR0121 1214 | U 1 1 5DF0A6F0 1215 | P 2650 3450 1216 | F 0 "#PWR0121" H 2650 3200 50 0001 C CNN 1217 | F 1 "GND" H 2655 3277 50 0000 C CNN 1218 | F 2 "" H 2650 3450 50 0001 C CNN 1219 | F 3 "" H 2650 3450 50 0001 C CNN 1220 | 1 2650 3450 1221 | 1 0 0 -1 1222 | $EndComp 1223 | $Comp 1224 | L Device:C C8 1225 | U 1 1 5DF0B466 1226 | P 4150 4150 1227 | F 0 "C8" H 4035 4104 50 0000 R CNN 1228 | F 1 "C" H 4035 4195 50 0000 R CNN 1229 | F 2 "Capacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolder" H 4188 4000 50 0001 C CNN 1230 | F 3 "~" H 4150 4150 50 0001 C CNN 1231 | 1 4150 4150 1232 | -1 0 0 1 1233 | $EndComp 1234 | $Comp 1235 | L power:GND #PWR0122 1236 | U 1 1 5DF0B46C 1237 | P 4150 4300 1238 | F 0 "#PWR0122" H 4150 4050 50 0001 C CNN 1239 | F 1 "GND" H 4155 4127 50 0000 C CNN 1240 | F 2 "" H 4150 4300 50 0001 C CNN 1241 | F 3 "" H 4150 4300 50 0001 C CNN 1242 | 1 4150 4300 1243 | 1 0 0 -1 1244 | $EndComp 1245 | $Comp 1246 | L power:+5V #PWR0123 1247 | U 1 1 5DF0E3F0 1248 | P 4150 4000 1249 | F 0 "#PWR0123" H 4150 3850 50 0001 C CNN 1250 | F 1 "+5V" V 4165 4128 50 0000 L CNN 1251 | F 2 "" H 4150 4000 50 0001 C CNN 1252 | F 3 "" H 4150 4000 50 0001 C CNN 1253 | 1 4150 4000 1254 | 1 0 0 -1 1255 | $EndComp 1256 | Text Label 6850 2600 3 50 ~ 0 1257 | AMPOUT2 1258 | Text Label 6850 2000 1 50 ~ 0 1259 | AMPOUT1 1260 | Text Label 6000 1650 2 50 ~ 0 1261 | AMPFB1 1262 | Text Label 6000 2900 2 50 ~ 0 1263 | AMPFB2 1264 | Text Label 7250 3700 0 50 ~ 0 1265 | AMPOUT2 1266 | Text Label 6250 3600 2 50 ~ 0 1267 | AMPOUT1 1268 | Text Label 7250 3800 0 50 ~ 0 1269 | AMPFB2 1270 | Text Label 6250 3700 2 50 ~ 0 1271 | AMPFB1 1272 | $Comp 1273 | L power:GND #PWR0107 1274 | U 1 1 5DF1A0D4 1275 | P 4050 6900 1276 | F 0 "#PWR0107" H 4050 6650 50 0001 C CNN 1277 | F 1 "GND" V 4055 6772 50 0000 R CNN 1278 | F 2 "" H 4050 6900 50 0001 C CNN 1279 | F 3 "" H 4050 6900 50 0001 C CNN 1280 | 1 4050 6900 1281 | 0 1 1 0 1282 | $EndComp 1283 | $Comp 1284 | L power:+3.3V #PWR0112 1285 | U 1 1 5DF236D0 1286 | P 7250 5100 1287 | F 0 "#PWR0112" H 7250 4950 50 0001 C CNN 1288 | F 1 "+3.3V" V 7265 5228 50 0000 L CNN 1289 | F 2 "" H 7250 5100 50 0001 C CNN 1290 | F 3 "" H 7250 5100 50 0001 C CNN 1291 | 1 7250 5100 1292 | 0 -1 -1 0 1293 | $EndComp 1294 | $Comp 1295 | L power:+3.3V #PWR0124 1296 | U 1 1 5DF237EF 1297 | P 7250 5000 1298 | F 0 "#PWR0124" H 7250 4850 50 0001 C CNN 1299 | F 1 "+3.3V" V 7265 5128 50 0000 L CNN 1300 | F 2 "" H 7250 5000 50 0001 C CNN 1301 | F 3 "" H 7250 5000 50 0001 C CNN 1302 | 1 7250 5000 1303 | 0 -1 -1 0 1304 | $EndComp 1305 | $Comp 1306 | L Device:C C9 1307 | U 1 1 5DF246C4 1308 | P 5000 4150 1309 | F 0 "C9" H 4885 4104 50 0000 R CNN 1310 | F 1 "C" H 4885 4195 50 0000 R CNN 1311 | F 2 "Capacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolder" H 5038 4000 50 0001 C CNN 1312 | F 3 "~" H 5000 4150 50 0001 C CNN 1313 | 1 5000 4150 1314 | -1 0 0 1 1315 | $EndComp 1316 | $Comp 1317 | L power:GND #PWR0125 1318 | U 1 1 5DF246CA 1319 | P 5000 4300 1320 | F 0 "#PWR0125" H 5000 4050 50 0001 C CNN 1321 | F 1 "GND" H 5005 4127 50 0000 C CNN 1322 | F 2 "" H 5000 4300 50 0001 C CNN 1323 | F 3 "" H 5000 4300 50 0001 C CNN 1324 | 1 5000 4300 1325 | 1 0 0 -1 1326 | $EndComp 1327 | $Comp 1328 | L power:+5V #PWR0126 1329 | U 1 1 5DF246D0 1330 | P 5000 4000 1331 | F 0 "#PWR0126" H 5000 3850 50 0001 C CNN 1332 | F 1 "+5V" V 5015 4128 50 0000 L CNN 1333 | F 2 "" H 5000 4000 50 0001 C CNN 1334 | F 3 "" H 5000 4000 50 0001 C CNN 1335 | 1 5000 4000 1336 | 1 0 0 -1 1337 | $EndComp 1338 | $Comp 1339 | L Device:C C11 1340 | U 1 1 5DF27C12 1341 | P 3800 4150 1342 | F 0 "C11" H 3685 4104 50 0000 R CNN 1343 | F 1 "C" H 3685 4195 50 0000 R CNN 1344 | F 2 "Capacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolder" H 3838 4000 50 0001 C CNN 1345 | F 3 "~" H 3800 4150 50 0001 C CNN 1346 | 1 3800 4150 1347 | -1 0 0 1 1348 | $EndComp 1349 | $Comp 1350 | L power:GND #PWR0127 1351 | U 1 1 5DF27C18 1352 | P 3800 4300 1353 | F 0 "#PWR0127" H 3800 4050 50 0001 C CNN 1354 | F 1 "GND" H 3805 4127 50 0000 C CNN 1355 | F 2 "" H 3800 4300 50 0001 C CNN 1356 | F 3 "" H 3800 4300 50 0001 C CNN 1357 | 1 3800 4300 1358 | 1 0 0 -1 1359 | $EndComp 1360 | $Comp 1361 | L power:+5V #PWR0128 1362 | U 1 1 5DF27C1E 1363 | P 3800 4000 1364 | F 0 "#PWR0128" H 3800 3850 50 0001 C CNN 1365 | F 1 "+5V" V 3815 4128 50 0000 L CNN 1366 | F 2 "" H 3800 4000 50 0001 C CNN 1367 | F 3 "" H 3800 4000 50 0001 C CNN 1368 | 1 3800 4000 1369 | 1 0 0 -1 1370 | $EndComp 1371 | $Comp 1372 | L Device:C C10 1373 | U 1 1 5DF2AB8E 1374 | P 3450 4150 1375 | F 0 "C10" H 3335 4104 50 0000 R CNN 1376 | F 1 "C" H 3335 4195 50 0000 R CNN 1377 | F 2 "Capacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolder" H 3488 4000 50 0001 C CNN 1378 | F 3 "~" H 3450 4150 50 0001 C CNN 1379 | 1 3450 4150 1380 | -1 0 0 1 1381 | $EndComp 1382 | $Comp 1383 | L power:GND #PWR0129 1384 | U 1 1 5DF2AB94 1385 | P 3450 4300 1386 | F 0 "#PWR0129" H 3450 4050 50 0001 C CNN 1387 | F 1 "GND" H 3455 4127 50 0000 C CNN 1388 | F 2 "" H 3450 4300 50 0001 C CNN 1389 | F 3 "" H 3450 4300 50 0001 C CNN 1390 | 1 3450 4300 1391 | 1 0 0 -1 1392 | $EndComp 1393 | $Comp 1394 | L power:+5V #PWR0130 1395 | U 1 1 5DF2AB9A 1396 | P 3450 4000 1397 | F 0 "#PWR0130" H 3450 3850 50 0001 C CNN 1398 | F 1 "+5V" V 3465 4128 50 0000 L CNN 1399 | F 2 "" H 3450 4000 50 0001 C CNN 1400 | F 3 "" H 3450 4000 50 0001 C CNN 1401 | 1 3450 4000 1402 | 1 0 0 -1 1403 | $EndComp 1404 | $Comp 1405 | L Device:C C12 1406 | U 1 1 5DF30B03 1407 | P 4600 4150 1408 | F 0 "C12" H 4485 4104 50 0000 R CNN 1409 | F 1 "C" H 4485 4195 50 0000 R CNN 1410 | F 2 "Capacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolder" H 4638 4000 50 0001 C CNN 1411 | F 3 "~" H 4600 4150 50 0001 C CNN 1412 | 1 4600 4150 1413 | -1 0 0 1 1414 | $EndComp 1415 | $Comp 1416 | L power:GND #PWR0131 1417 | U 1 1 5DF30B09 1418 | P 4600 4300 1419 | F 0 "#PWR0131" H 4600 4050 50 0001 C CNN 1420 | F 1 "GND" H 4605 4127 50 0000 C CNN 1421 | F 2 "" H 4600 4300 50 0001 C CNN 1422 | F 3 "" H 4600 4300 50 0001 C CNN 1423 | 1 4600 4300 1424 | 1 0 0 -1 1425 | $EndComp 1426 | $Comp 1427 | L power:+5V #PWR0132 1428 | U 1 1 5DF30B0F 1429 | P 4600 4000 1430 | F 0 "#PWR0132" H 4600 3850 50 0001 C CNN 1431 | F 1 "+5V" V 4615 4128 50 0000 L CNN 1432 | F 2 "" H 4600 4000 50 0001 C CNN 1433 | F 3 "" H 4600 4000 50 0001 C CNN 1434 | 1 4600 4000 1435 | 1 0 0 -1 1436 | $EndComp 1437 | $Comp 1438 | L Amplifier_Operational:THS4631DDA U9 1439 | U 1 1 5DF33D77 1440 | P 5950 6750 1441 | F 0 "U9" H 6291 6796 50 0000 L CNN 1442 | F 1 "THS4631DDA" H 6291 6705 50 0000 L CNN 1443 | F 2 "Package_SO:SOIC-8_3.9x4.9mm_P1.27mm" H 5950 6750 50 0001 L CNN 1444 | F 3 "www.ti.com/lit/ds/symlink/ths4631.pdf" H 6100 6900 50 0001 C CNN 1445 | 1 5950 6750 1446 | 1 0 0 -1 1447 | $EndComp 1448 | Text Label 6250 6750 0 50 ~ 0 1449 | POWER_OUT 1450 | Text Label 5650 6650 2 50 ~ 0 1451 | POWER_PREOUT 1452 | $Comp 1453 | L power:GND #PWR0133 1454 | U 1 1 5DF35B59 1455 | P 5850 7050 1456 | F 0 "#PWR0133" H 5850 6800 50 0001 C CNN 1457 | F 1 "GND" V 5850 6850 50 0000 C CNN 1458 | F 2 "" H 5850 7050 50 0001 C CNN 1459 | F 3 "" H 5850 7050 50 0001 C CNN 1460 | 1 5850 7050 1461 | 1 0 0 -1 1462 | $EndComp 1463 | $Comp 1464 | L power:+5V #PWR0134 1465 | U 1 1 5DF36349 1466 | P 5850 6450 1467 | F 0 "#PWR0134" H 5850 6300 50 0001 C CNN 1468 | F 1 "+5V" H 5938 6487 50 0000 L CNN 1469 | F 2 "" H 5850 6450 50 0001 C CNN 1470 | F 3 "" H 5850 6450 50 0001 C CNN 1471 | 1 5850 6450 1472 | 1 0 0 -1 1473 | $EndComp 1474 | $Comp 1475 | L Device:C C13 1476 | U 1 1 5DF36CC9 1477 | P 3150 4150 1478 | F 0 "C13" H 3035 4104 50 0000 R CNN 1479 | F 1 "C" H 3035 4195 50 0000 R CNN 1480 | F 2 "Capacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolder" H 3188 4000 50 0001 C CNN 1481 | F 3 "~" H 3150 4150 50 0001 C CNN 1482 | 1 3150 4150 1483 | -1 0 0 1 1484 | $EndComp 1485 | $Comp 1486 | L power:GND #PWR0135 1487 | U 1 1 5DF36CCF 1488 | P 3150 4300 1489 | F 0 "#PWR0135" H 3150 4050 50 0001 C CNN 1490 | F 1 "GND" H 3155 4127 50 0000 C CNN 1491 | F 2 "" H 3150 4300 50 0001 C CNN 1492 | F 3 "" H 3150 4300 50 0001 C CNN 1493 | 1 3150 4300 1494 | 1 0 0 -1 1495 | $EndComp 1496 | $Comp 1497 | L power:+5V #PWR0136 1498 | U 1 1 5DF36CD5 1499 | P 3150 4000 1500 | F 0 "#PWR0136" H 3150 3850 50 0001 C CNN 1501 | F 1 "+5V" V 3165 4128 50 0000 L CNN 1502 | F 2 "" H 3150 4000 50 0001 C CNN 1503 | F 3 "" H 3150 4000 50 0001 C CNN 1504 | 1 3150 4000 1505 | 1 0 0 -1 1506 | $EndComp 1507 | Wire Wire Line 1508 | 6250 6750 6250 7400 1509 | Wire Wire Line 1510 | 6250 7400 5650 7400 1511 | Wire Wire Line 1512 | 5650 7400 5650 6850 1513 | Wire Wire Line 1514 | 7000 2450 7150 2450 1515 | Wire Wire Line 1516 | 7000 2150 7150 2150 1517 | Connection ~ 7150 2150 1518 | Wire Wire Line 1519 | 7150 2150 7300 2150 1520 | Connection ~ 7150 2450 1521 | Wire Wire Line 1522 | 7150 2450 7300 2450 1523 | $Comp 1524 | L power:GND #PWR0137 1525 | U 1 1 5DF4EE1C 1526 | P 7150 2750 1527 | F 0 "#PWR0137" H 7150 2500 50 0001 C CNN 1528 | F 1 "GND" H 7155 2577 50 0000 C CNN 1529 | F 2 "" H 7150 2750 50 0001 C CNN 1530 | F 3 "" H 7150 2750 50 0001 C CNN 1531 | 1 7150 2750 1532 | 1 0 0 -1 1533 | $EndComp 1534 | $Comp 1535 | L power:GND #PWR0138 1536 | U 1 1 5DF4EE7F 1537 | P 7150 1850 1538 | F 0 "#PWR0138" H 7150 1600 50 0001 C CNN 1539 | F 1 "GND" H 7155 1677 50 0000 C CNN 1540 | F 2 "" H 7150 1850 50 0001 C CNN 1541 | F 3 "" H 7150 1850 50 0001 C CNN 1542 | 1 7150 1850 1543 | -1 0 0 1 1544 | $EndComp 1545 | $Comp 1546 | L Device:R Rfb4 1547 | U 1 1 5DF50268 1548 | P 6000 3100 1549 | F 0 "Rfb4" V 6115 3100 50 0000 C CNN 1550 | F 1 "0" V 6206 3100 50 0000 C CNN 1551 | F 2 "Resistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolder" V 5930 3100 50 0001 C CNN 1552 | F 3 "~" H 6000 3100 50 0001 C CNN 1553 | 1 6000 3100 1554 | -1 0 0 1 1555 | $EndComp 1556 | Connection ~ 6000 2950 1557 | $Comp 1558 | L power:GND #PWR023 1559 | U 1 1 5DF53AA8 1560 | P 6000 3250 1561 | F 0 "#PWR023" H 6000 3000 50 0001 C CNN 1562 | F 1 "GND" H 6005 3077 50 0000 C CNN 1563 | F 2 "" H 6000 3250 50 0001 C CNN 1564 | F 3 "" H 6000 3250 50 0001 C CNN 1565 | 1 6000 3250 1566 | 1 0 0 -1 1567 | $EndComp 1568 | $Comp 1569 | L Device:R Rfb3 1570 | U 1 1 5DF53B67 1571 | P 6000 1350 1572 | F 0 "Rfb3" V 6115 1350 50 0000 C CNN 1573 | F 1 "0" V 6206 1350 50 0000 C CNN 1574 | F 2 "Resistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolder" V 5930 1350 50 0001 C CNN 1575 | F 3 "~" H 6000 1350 50 0001 C CNN 1576 | 1 6000 1350 1577 | -1 0 0 1 1578 | $EndComp 1579 | Connection ~ 6000 1500 1580 | $Comp 1581 | L power:GND #PWR012 1582 | U 1 1 5DF541FD 1583 | P 6000 1200 1584 | F 0 "#PWR012" H 6000 950 50 0001 C CNN 1585 | F 1 "GND" H 6005 1027 50 0000 C CNN 1586 | F 2 "" H 6000 1200 50 0001 C CNN 1587 | F 3 "" H 6000 1200 50 0001 C CNN 1588 | 1 6000 1200 1589 | -1 0 0 1 1590 | $EndComp 1591 | $EndSCHEMATC 1592 | --------------------------------------------------------------------------------