diff --git a/F1:F103/shutter/code/Makefile b/F1:F103/shutter/Makefile similarity index 100% rename from F1:F103/shutter/code/Makefile rename to F1:F103/shutter/Makefile diff --git a/F1:F103/shutter/Readme.md b/F1:F103/shutter/Readme.md new file mode 100644 index 0000000..f61bfa6 --- /dev/null +++ b/F1:F103/shutter/Readme.md @@ -0,0 +1,75 @@ +Shutter control +=============== + +Works with bi-stable shutter. +You can find the device in `/dev/shutterX` (symlink to `/dev/ttyUSBX`). + +## Pinout + +**PB0** (pullup in) - hall (or reed switch) sensor input (active low) - opened shutter detector + +**PB11** (pullup in) - CCD or button input: open at low signal, close at high + +**PA3** (ADC in) - shutter voltage (approx 1/12 U) + +**PA5** (PP out) - TLE5205 IN2 + +**PA6** (PP out) - TLE5205 IN1 + +**PA7** (pullup in) - TLE5205 FB + +**PA10** (PP out) - USB pullup (active low) + +**PA11**, **PA12** - USB + +**PA13**, **PA14** - SWD + +## Commands + +* '0' - shutter CLO +* '1' - shutter OPE +* '2' - shutter HIZ +* 'A' - get raw ADC values +* 'C' - close shutter / abort exposition +* 'E n' - expose for n milliseconds +* 'O' - open shutter +* 'R' - software reset +* 'S' - get shutter state; also hall and ccd inputs state (1 - active) +* 't' - get MCU temperature (/10degC) +* 'T' - get Tms +* 'v' - get Vdd (/100V) +* 'V' - get shutter voltage (/100V) +* 'W' - test watchdog + +If you will enter wrong long message, will receive its echo back. Any wrong short command will show help list. + +### Shutter control +Commands '0', '1' and '2' should be used only for debugging purposes. +To open/close shutter use only 'O', 'C' and 'E' commands. + +When opening or closing shutter you will first receive an answer: `OK` if command could be done or `ERR` if there's insufficient voltage on capacitor or shutter is absent. +After opened the message `shutter=opened` will appear. After closing you will receive messages `exptime=xxx` (when `xxx` is approx. exp. time in milliseconds) and `shutter=closed`. + +Command 'E' could return `OK`, `ERR` or `ERRNUM`/`I32OVERFLOW` in wrong number format (number could be decimal, 0x.. - hexadecimal, b.. - binary or 0.. - octal). + +When exposition starts you will receive message `OK` and `shutter=opened`. After its end you'll got `exptime=...`, `shutter=closed`. +If shutter can't be closed, you will give a lots of "exp=cantclose" and different error messages until problem be solved. To stop this error messages give command 'O'. + +### Different commands +* 'A' will show raw values for all ADC channels: 0. - capacitor voltage, 1 - MCU temperature, 2 - MCU Vdd. You will give messages like `adcX=val`. + +* 't' - `mcut=val`, where val = T*10 degrC. + +* 'T' - `tms=val`, val in ms. + +* 'v' - `vdd=val`, val in V*100 + +* 'V' - "voltage=val", val in V*100 + +* 'S' - several answers: + * `shutter=`: `closed`, `opened`, `error`, `process`, `wait` or `exposing` - shutter state + * `exptime=...` (only when shutter is opened) - show time since opening + * `regstate=`: `open`, `close`, `off` or `hiZ` - TLE5205 outputs state + * `fbstate=`: `0` or `1` - TLE5205 FB out state (1 - error) + * `hall=`: `0` or `1` - 1 for opened shutter, 0 for closed + * `ccd=`: `0` or `1` - 1 for active (closed contacts) state of "CCD" input diff --git a/F1:F103/shutter/code/adc.c b/F1:F103/shutter/adc.c similarity index 100% rename from F1:F103/shutter/code/adc.c rename to F1:F103/shutter/adc.c diff --git a/F1:F103/shutter/code/adc.h b/F1:F103/shutter/adc.h similarity index 100% rename from F1:F103/shutter/code/adc.h rename to F1:F103/shutter/adc.h diff --git a/F1:F103/shutter/code/Readme.md b/F1:F103/shutter/code/Readme.md deleted file mode 100644 index f1881a9..0000000 --- a/F1:F103/shutter/code/Readme.md +++ /dev/null @@ -1,19 +0,0 @@ -Shutter control -=============== - -Works with bi-stable shutter. - -Pinout: -PB0 (pullup in) - hall (or reed switch) sensor input (active low) - opened shutter detector -PB11 (pullup in) - CCD or button input: open at low signal, close at high - -PA3 (ADC in) - shutter voltage (approx 1/12 U) -PA5 (PP out) - TLE5205 IN2 -PA6 (PP out) - TLE5205 IN1 -PA7 (pullup in) - TLE5205 FB -PA10 (PP out) - USB pullup (active low) -PA11,12 - USB -PA13,14 - SWD - - -Commands: diff --git a/F1:F103/shutter/code/kicad b/F1:F103/shutter/code/kicad deleted file mode 120000 index 6e6d4f0..0000000 --- a/F1:F103/shutter/code/kicad +++ /dev/null @@ -1 +0,0 @@ -/home/eddy/Docs/SAO/Zeiss-1000/Small_photometer/shutter/kicad/shutter \ No newline at end of file diff --git a/F1:F103/shutter/code/shutter.bin b/F1:F103/shutter/code/shutter.bin deleted file mode 100755 index c66aa66..0000000 Binary files a/F1:F103/shutter/code/shutter.bin and /dev/null differ diff --git a/F1:F103/shutter/code/version.inc b/F1:F103/shutter/code/version.inc deleted file mode 100644 index 46f5d70..0000000 --- a/F1:F103/shutter/code/version.inc +++ /dev/null @@ -1,2 +0,0 @@ -#define BUILD_NUMBER "70" -#define BUILD_DATE "2023-09-21" diff --git a/F1:F103/shutter/code/hardware.c b/F1:F103/shutter/hardware.c similarity index 100% rename from F1:F103/shutter/code/hardware.c rename to F1:F103/shutter/hardware.c diff --git a/F1:F103/shutter/code/hardware.h b/F1:F103/shutter/hardware.h similarity index 100% rename from F1:F103/shutter/code/hardware.h rename to F1:F103/shutter/hardware.h diff --git a/F1:F103/shutter/3d.png b/F1:F103/shutter/kicad/3d.png similarity index 100% rename from F1:F103/shutter/3d.png rename to F1:F103/shutter/kicad/3d.png diff --git a/F1:F103/shutter/fp-info-cache b/F1:F103/shutter/kicad/fp-info-cache similarity index 100% rename from F1:F103/shutter/fp-info-cache rename to F1:F103/shutter/kicad/fp-info-cache diff --git a/F1:F103/shutter/gerbers/shutter-B_Cu.gbr b/F1:F103/shutter/kicad/gerbers/shutter-B_Cu.gbr similarity index 100% rename from F1:F103/shutter/gerbers/shutter-B_Cu.gbr rename to F1:F103/shutter/kicad/gerbers/shutter-B_Cu.gbr diff --git a/F1:F103/shutter/gerbers/shutter-Edge_Cuts.gbr b/F1:F103/shutter/kicad/gerbers/shutter-Edge_Cuts.gbr similarity index 100% rename from F1:F103/shutter/gerbers/shutter-Edge_Cuts.gbr rename to F1:F103/shutter/kicad/gerbers/shutter-Edge_Cuts.gbr diff --git a/F1:F103/shutter/gerbers/shutter-F_Cu.gbr b/F1:F103/shutter/kicad/gerbers/shutter-F_Cu.gbr similarity index 100% rename from F1:F103/shutter/gerbers/shutter-F_Cu.gbr rename to F1:F103/shutter/kicad/gerbers/shutter-F_Cu.gbr diff --git a/F1:F103/shutter/gerbers/shutter-drl.rpt b/F1:F103/shutter/kicad/gerbers/shutter-drl.rpt similarity index 100% rename from F1:F103/shutter/gerbers/shutter-drl.rpt rename to F1:F103/shutter/kicad/gerbers/shutter-drl.rpt diff --git a/F1:F103/shutter/gerbers/shutter-drl_map.gbr b/F1:F103/shutter/kicad/gerbers/shutter-drl_map.gbr similarity index 100% rename from F1:F103/shutter/gerbers/shutter-drl_map.gbr rename to F1:F103/shutter/kicad/gerbers/shutter-drl_map.gbr diff --git a/F1:F103/shutter/gerbers/shutter-job.gbrjob b/F1:F103/shutter/kicad/gerbers/shutter-job.gbrjob similarity index 100% rename from F1:F103/shutter/gerbers/shutter-job.gbrjob rename to F1:F103/shutter/kicad/gerbers/shutter-job.gbrjob diff --git a/F1:F103/shutter/gerbers/shutter.drl b/F1:F103/shutter/kicad/gerbers/shutter.drl similarity index 100% rename from F1:F103/shutter/gerbers/shutter.drl rename to F1:F103/shutter/kicad/gerbers/shutter.drl diff --git a/F1:F103/shutter/kicad/shutter.csv b/F1:F103/shutter/kicad/shutter.csv new file mode 100644 index 0000000..844c502 --- /dev/null +++ b/F1:F103/shutter/kicad/shutter.csv @@ -0,0 +1,38 @@ +"Source:","/home/eddy/Docs/SAO/Zeiss-1000/Small_photometer/shutter/kicad/shutter/shutter.kicad_sch" +"Date:","Вт 12 сен 2023 17:34:36" +"Tool:","Eeschema 7.0.5" +"Generator:","/usr/local/share/kicad/plugins/bom_csv_grouped_by_value.py" +"Component Count:","44" + +"Collated Components:" + +"Item","Qty","Reference(s)","Value","LibPart","Footprint","Datasheet","DNP" +"1","1","C1","2200u, 40V","ALL-rescue:CP1","Capacitor_THT:CP_Radial_D17.0mm_P7.50mm","","" +"2","1","C2","1u","Device:C","Capacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolder","~","" +"3","5","C3, C5, C6, C7, C8","0.1","Device:C","Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder","~","" +"4","1","C4","47u","Device:C_Polarized","Capacitor_Tantalum_SMD:CP_EIA-6032-28_Kemet-C_Pad2.25x2.35mm_HandSolder","~","" +"5","2","C9, C10","6","Device:C","Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder","~","" +"6","5","D1, D2, D3, D4, D5","1N5819","Device:D_Schottky","Diode_SMD:D_SOD-323_HandSoldering","~","" +"7","1","DA1","TLE5205","my_elements:TLE5205","Package_TO_SOT_THT:TO-220-7_P2.54x3.8mm_StaggerEven_Lead5.85mm_TabDown","","" +"8","4","H1, H2, H3, H4","MountingHole","Mechanical:MountingHole","MountingHole:MountingHole_3.2mm_M3","~","" +"9","1","J1","shutter","Connector:Conn_01x02_Female","TerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-2-5.08_1x02_P5.08mm_Horizontal","~","" +"10","1","J2","power","Connector:Conn_01x02_Female","TerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-2-5.08_1x02_P5.08mm_Horizontal","~","" +"11","1","J3","SWD","Connector:Conn_01x06_Female","Connector_PinHeader_1.27mm:PinHeader_1x06_P1.27mm_Vertical","~","" +"12","1","J4","5v","Connector_Generic:Conn_01x01","Connector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm_Vertical","~","" +"13","1","J5","GND","Connector_Generic:Conn_01x01","Connector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm_Vertical","~","" +"14","1","J6","3v3","Connector_Generic:Conn_01x01","Connector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm_Vertical","~","" +"15","1","J7","USB_B","Connector:USB_B","Connector_USB:USB_B_Lumberg_2411_02_Horizontal"," ~","" +"16","1","J8","hall","Connector:Conn_01x02_Female","Connector_JST:JST_PH_B2B-PH-K_1x02_P2.00mm_Vertical","~","" +"17","1","J9","ccd","Connector:Conn_01x02_Female","Connector_JST:JST_PH_B2B-PH-K_1x02_P2.00mm_Vertical","~","" +"18","1","Q1","DTA114Y","Transistor_BJT:DTA114Y","Package_TO_SOT_SMD:SOT-323_SC-70_Handsoldering","","" +"19","1","R1","6.9","Device:R","Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder","~","" +"20","1","R2","56k","Device:R","Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder","~","" +"21","3","R3, R5, R6","4k7","Device:R","Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder","~","" +"22","1","R4","300 II","Device:R","Resistor_THT:R_Axial_Power_L20.0mm_W6.4mm_P22.40mm","~","" +"23","1","R7","10k","Device:R","Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder","~","" +"24","2","R8, R9","22","Device:R","Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder","~","" +"25","1","R10","1k5","Device:R","Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder","~","" +"26","1","U1","LM1117-3.3","Regulator_Linear:LM1117-3.3","Package_TO_SOT_SMD:SOT-223-3_TabPin2","http://www.ti.com/lit/ds/symlink/lm1117.pdf","" +"27","1","U2","STM32F103C6Tx","MCU_ST_STM32F1:STM32F103C6Tx","Package_QFP:LQFP-48_7x7mm_P0.5mm","http://www.st.com/st-web-ui/static/active/en/resource/technical/document/datasheet/CD00210843.pdf","" +"28","1","U3","USBLC6-2SC6","Power_Protection:USBLC6-2SC6","Package_TO_SOT_SMD:SOT-23-6_Handsoldering","http://www2.st.com/resource/en/datasheet/CD00050750.pdf","" +"29","1","Y1","NX5032GA-8MHz","Device:Crystal","Crystal:Crystal_SMD_5032-2Pin_5.0x3.2mm","~","" diff --git a/F1:F103/shutter/shutter.kicad_pcb b/F1:F103/shutter/kicad/shutter.kicad_pcb similarity index 99% rename from F1:F103/shutter/shutter.kicad_pcb rename to F1:F103/shutter/kicad/shutter.kicad_pcb index 25b5f83..bf7ea3e 100644 --- a/F1:F103/shutter/shutter.kicad_pcb +++ b/F1:F103/shutter/kicad/shutter.kicad_pcb @@ -53,8 +53,8 @@ ) (pad_to_mask_clearance 0) (pcbplotparams - (layerselection 0x0001000_ffffffff) - (plot_on_all_layers_selection 0x0000000_00000000) + (layerselection 0x0000020_7ffffffe) + (plot_on_all_layers_selection 0x0001080_00000000) (disableapertmacros false) (usegerberextensions false) (usegerberattributes true) @@ -80,11 +80,11 @@ (plotinvisibletext false) (sketchpadsonfab false) (subtractmaskfromsilk false) - (outputformat 1) + (outputformat 5) (mirror false) - (drillshape 0) + (drillshape 2) (scaleselection 1) - (outputdirectory "gerbers/") + (outputdirectory "svgs") ) ) diff --git a/F1:F103/shutter/shutter.kicad_prl b/F1:F103/shutter/kicad/shutter.kicad_prl similarity index 97% rename from F1:F103/shutter/shutter.kicad_prl rename to F1:F103/shutter/kicad/shutter.kicad_prl index 06bd56a..1d51924 100644 --- a/F1:F103/shutter/shutter.kicad_prl +++ b/F1:F103/shutter/kicad/shutter.kicad_prl @@ -65,7 +65,7 @@ 40 ], "visible_layers": "fffffff_ffffffff", - "zone_display_mode": 0 + "zone_display_mode": 1 }, "meta": { "filename": "shutter.kicad_prl", diff --git a/F1:F103/shutter/shutter.kicad_pro b/F1:F103/shutter/kicad/shutter.kicad_pro similarity index 100% rename from F1:F103/shutter/shutter.kicad_pro rename to F1:F103/shutter/kicad/shutter.kicad_pro diff --git a/F1:F103/shutter/shutter.kicad_sch b/F1:F103/shutter/kicad/shutter.kicad_sch similarity index 99% rename from F1:F103/shutter/shutter.kicad_sch rename to F1:F103/shutter/kicad/shutter.kicad_sch index 0bde5d8..8abac2a 100644 --- a/F1:F103/shutter/shutter.kicad_sch +++ b/F1:F103/shutter/kicad/shutter.kicad_sch @@ -3920,7 +3920,7 @@ (property "Reference" "R4" (at 51.054 123.9774 90) (effects (font (size 1.27 1.27)) (justify left)) ) - (property "Value" "300 II" (at 52.451 128.27 90) + (property "Value" "150 II" (at 52.451 128.27 90) (effects (font (size 1.27 1.27)) (justify left)) ) (property "Footprint" "Resistor_THT:R_Axial_Power_L20.0mm_W6.4mm_P22.40mm" (at 49.53 127.889 90) diff --git a/F1:F103/shutter/kicad/shutter.pdf b/F1:F103/shutter/kicad/shutter.pdf new file mode 100644 index 0000000..af3a47c Binary files /dev/null and b/F1:F103/shutter/kicad/shutter.pdf differ diff --git a/F1:F103/shutter/kicad/shutter.xml b/F1:F103/shutter/kicad/shutter.xml new file mode 100644 index 0000000..35e351b --- /dev/null +++ b/F1:F103/shutter/kicad/shutter.xml @@ -0,0 +1,1105 @@ + + + + /home/eddy/Docs/SAO/Zeiss-1000/Small_photometer/shutter/kicad/shutter/shutter.kicad_sch + Вт 12 сен 2023 17:34:36 + Eeschema 7.0.5 + + + + <company/> + <rev/> + <date/> + <source>shutter.kicad_sch</source> + <comment number="1" value=""/> + <comment number="2" value=""/> + <comment number="3" value=""/> + <comment number="4" value=""/> + <comment number="5" value=""/> + <comment number="6" value=""/> + <comment number="7" value=""/> + <comment number="8" value=""/> + <comment number="9" value=""/> + </title_block> + </sheet> + </design> + <components> + <comp ref="C1"> + <value>2200u, 40V</value> + <footprint>Capacitor_THT:CP_Radial_D17.0mm_P7.50mm</footprint> + <libsource lib="ALL-rescue" part="CP1" description=""/> + <property name="Sheetname" value=""/> + <property name="Sheetfile" value="shutter.kicad_sch"/> + <sheetpath names="/" tstamps="/"/> + <tstamps>7cafc48e-d805-4dad-9acc-954a0ae1cf67</tstamps> + </comp> + <comp ref="C2"> + <value>1u</value> + <footprint>Capacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolder</footprint> + <libsource lib="Device" part="C" description="Unpolarized capacitor"/> + <property name="Sheetname" value=""/> + <property name="Sheetfile" value="shutter.kicad_sch"/> + <property name="ki_description" value="Unpolarized capacitor"/> + <property name="ki_keywords" value="cap capacitor"/> + <sheetpath names="/" tstamps="/"/> + <tstamps>20a72a8b-49f7-4dbd-86d8-088c0a093651</tstamps> + </comp> + <comp ref="C3"> + <value>0.1</value> + <footprint>Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder</footprint> + <libsource lib="Device" part="C" description="Unpolarized capacitor"/> + <property name="Sheetname" value=""/> + <property name="Sheetfile" value="shutter.kicad_sch"/> + <property name="ki_description" value="Unpolarized capacitor"/> + <property name="ki_keywords" value="cap capacitor"/> + <sheetpath names="/" tstamps="/"/> + <tstamps>f8ee89a8-d538-45ca-bc61-031426795c3d</tstamps> + </comp> + <comp ref="C4"> + <value>47u</value> + <footprint>Capacitor_Tantalum_SMD:CP_EIA-6032-28_Kemet-C_Pad2.25x2.35mm_HandSolder</footprint> + <libsource lib="Device" part="C_Polarized" description="Polarized capacitor"/> + <property name="Sheetname" value=""/> + <property name="Sheetfile" value="shutter.kicad_sch"/> + <property name="ki_description" value="Polarized capacitor"/> + <property name="ki_keywords" value="cap capacitor"/> + <sheetpath names="/" tstamps="/"/> + <tstamps>eaa8f35a-9082-4836-9d53-0c16f77ccf09</tstamps> + </comp> + <comp ref="C5"> + <value>0.1</value> + <footprint>Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder</footprint> + <libsource lib="Device" part="C" description="Unpolarized capacitor"/> + <property name="Sheetname" value=""/> + <property name="Sheetfile" value="shutter.kicad_sch"/> + <property name="ki_description" value="Unpolarized capacitor"/> + <property name="ki_keywords" value="cap capacitor"/> + <sheetpath names="/" tstamps="/"/> + <tstamps>8ae7c88d-a928-4e73-acd8-44041733f182</tstamps> + </comp> + <comp ref="C6"> + <value>0.1</value> + <footprint>Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder</footprint> + <libsource lib="Device" part="C" description="Unpolarized capacitor"/> + <property name="Sheetname" value=""/> + <property name="Sheetfile" value="shutter.kicad_sch"/> + <property name="ki_description" value="Unpolarized capacitor"/> + <property name="ki_keywords" value="cap capacitor"/> + <sheetpath names="/" tstamps="/"/> + <tstamps>be2976f4-62a1-4517-b2c4-5bf5330ff1b4</tstamps> + </comp> + <comp ref="C7"> + <value>0.1</value> + <footprint>Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder</footprint> + <libsource lib="Device" part="C" description="Unpolarized capacitor"/> + <property name="Sheetname" value=""/> + <property name="Sheetfile" value="shutter.kicad_sch"/> + <property name="ki_description" value="Unpolarized capacitor"/> + <property name="ki_keywords" value="cap capacitor"/> + <sheetpath names="/" tstamps="/"/> + <tstamps>399d86de-1cb9-447a-a5ce-b3ddf75a8edc</tstamps> + </comp> + <comp ref="C8"> + <value>0.1</value> + <footprint>Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder</footprint> + <libsource lib="Device" part="C" description="Unpolarized capacitor"/> + <property name="Sheetname" value=""/> + <property name="Sheetfile" value="shutter.kicad_sch"/> + <property name="ki_description" value="Unpolarized capacitor"/> + <property name="ki_keywords" value="cap capacitor"/> + <sheetpath names="/" tstamps="/"/> + <tstamps>b1dfd575-70b8-4792-af40-9cfa6f28a6ba</tstamps> + </comp> + <comp ref="C9"> + <value>6</value> + <footprint>Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder</footprint> + <libsource lib="Device" part="C" description="Unpolarized capacitor"/> + <property name="Sheetname" value=""/> + <property name="Sheetfile" value="shutter.kicad_sch"/> + <property name="ki_description" value="Unpolarized capacitor"/> + <property name="ki_keywords" value="cap capacitor"/> + <sheetpath names="/" tstamps="/"/> + <tstamps>d66ecc3c-78a9-4638-a80d-9eb56407e476</tstamps> + </comp> + <comp ref="C10"> + <value>6</value> + <footprint>Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder</footprint> + <libsource lib="Device" part="C" description="Unpolarized capacitor"/> + <property name="Sheetname" value=""/> + <property name="Sheetfile" value="shutter.kicad_sch"/> + <property name="ki_description" value="Unpolarized capacitor"/> + <property name="ki_keywords" value="cap capacitor"/> + <sheetpath names="/" tstamps="/"/> + <tstamps>d2ddc8d7-1a60-451c-bab3-dbe9df581ae9</tstamps> + </comp> + <comp ref="D1"> + <value>1N5819</value> + <footprint>Diode_SMD:D_SOD-323_HandSoldering</footprint> + <libsource lib="Device" part="D_Schottky" description="Schottky diode"/> + <property name="Sheetname" value=""/> + <property name="Sheetfile" value="shutter.kicad_sch"/> + <property name="ki_description" value="Schottky diode"/> + <property name="ki_keywords" value="diode Schottky"/> + <sheetpath names="/" tstamps="/"/> + <tstamps>3ddcb342-b864-437a-a032-0d9652191485</tstamps> + </comp> + <comp ref="D2"> + <value>1N5819</value> + <footprint>Diode_SMD:D_SOD-323_HandSoldering</footprint> + <libsource lib="Device" part="D_Schottky" description="Schottky diode"/> + <property name="Sheetname" value=""/> + <property name="Sheetfile" value="shutter.kicad_sch"/> + <property name="ki_description" value="Schottky diode"/> + <property name="ki_keywords" value="diode Schottky"/> + <sheetpath names="/" tstamps="/"/> + <tstamps>60a630f7-a59e-4e9d-82cc-0c1b48429a9e</tstamps> + </comp> + <comp ref="D3"> + <value>1N5819</value> + <footprint>Diode_SMD:D_SOD-323_HandSoldering</footprint> + <libsource lib="Device" part="D_Schottky" description="Schottky diode"/> + <property name="Sheetname" value=""/> + <property name="Sheetfile" value="shutter.kicad_sch"/> + <property name="ki_description" value="Schottky diode"/> + <property name="ki_keywords" value="diode Schottky"/> + <sheetpath names="/" tstamps="/"/> + <tstamps>37c85700-9297-41a9-9a27-64c9d4149995</tstamps> + </comp> + <comp ref="D4"> + <value>1N5819</value> + <footprint>Diode_SMD:D_SOD-323_HandSoldering</footprint> + <libsource lib="Device" part="D_Schottky" description="Schottky diode"/> + <property name="Sheetname" value=""/> + <property name="Sheetfile" value="shutter.kicad_sch"/> + <property name="ki_description" value="Schottky diode"/> + <property name="ki_keywords" value="diode Schottky"/> + <sheetpath names="/" tstamps="/"/> + <tstamps>7698fe80-9b6d-44d9-8dca-468e95006009</tstamps> + </comp> + <comp ref="D5"> + <value>1N5819</value> + <footprint>Diode_SMD:D_SOD-323_HandSoldering</footprint> + <libsource lib="Device" part="D_Schottky" description="Schottky diode"/> + <property name="Sheetname" value=""/> + <property name="Sheetfile" value="shutter.kicad_sch"/> + <property name="ki_description" value="Schottky diode"/> + <property name="ki_keywords" value="diode Schottky"/> + <sheetpath names="/" tstamps="/"/> + <tstamps>69a101ce-200a-4178-9fe5-656aa100d28c</tstamps> + </comp> + <comp ref="DA1"> + <value>TLE5205</value> + <footprint>Package_TO_SOT_THT:TO-220-7_P2.54x3.8mm_StaggerEven_Lead5.85mm_TabDown</footprint> + <libsource lib="my_elements" part="TLE5205" description=""/> + <property name="Sheetname" value=""/> + <property name="Sheetfile" value="shutter.kicad_sch"/> + <sheetpath names="/" tstamps="/"/> + <tstamps>97c8a242-cdb4-4863-a99c-45b9a3d670a1</tstamps> + </comp> + <comp ref="H1"> + <value>MountingHole</value> + <footprint>MountingHole:MountingHole_3.2mm_M3</footprint> + <libsource lib="Mechanical" part="MountingHole" description="Mounting Hole without connection"/> + <property name="Sheetname" value=""/> + <property name="Sheetfile" value="shutter.kicad_sch"/> + <property name="ki_description" value="Mounting Hole without connection"/> + <property name="ki_keywords" value="mounting hole"/> + <sheetpath names="/" tstamps="/"/> + <tstamps>11860121-6def-4ab6-aa2f-f26a04c131d6</tstamps> + </comp> + <comp ref="H2"> + <value>MountingHole</value> + <footprint>MountingHole:MountingHole_3.2mm_M3</footprint> + <libsource lib="Mechanical" part="MountingHole" description="Mounting Hole without connection"/> + <property name="Sheetname" value=""/> + <property name="Sheetfile" value="shutter.kicad_sch"/> + <property name="ki_description" value="Mounting Hole without connection"/> + <property name="ki_keywords" value="mounting hole"/> + <sheetpath names="/" tstamps="/"/> + <tstamps>3610868b-e95c-44b4-bf02-081f0985ef75</tstamps> + </comp> + <comp ref="H3"> + <value>MountingHole</value> + <footprint>MountingHole:MountingHole_3.2mm_M3</footprint> + <libsource lib="Mechanical" part="MountingHole" description="Mounting Hole without connection"/> + <property name="Sheetname" value=""/> + <property name="Sheetfile" value="shutter.kicad_sch"/> + <property name="ki_description" value="Mounting Hole without connection"/> + <property name="ki_keywords" value="mounting hole"/> + <sheetpath names="/" tstamps="/"/> + <tstamps>b0fd44e4-226f-432f-9e56-49eeb34dc815</tstamps> + </comp> + <comp ref="H4"> + <value>MountingHole</value> + <footprint>MountingHole:MountingHole_3.2mm_M3</footprint> + <libsource lib="Mechanical" part="MountingHole" description="Mounting Hole without connection"/> + <property name="Sheetname" value=""/> + <property name="Sheetfile" value="shutter.kicad_sch"/> + <property name="ki_description" value="Mounting Hole without connection"/> + <property name="ki_keywords" value="mounting hole"/> + <sheetpath names="/" tstamps="/"/> + <tstamps>f8faa37e-a805-42e4-a0e4-c0da40c94816</tstamps> + </comp> + <comp ref="J1"> + <value>shutter</value> + <footprint>TerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-2-5.08_1x02_P5.08mm_Horizontal</footprint> + <libsource lib="Connector" part="Conn_01x02_Female" description="Generic connector, single row, 01x02, script generated (kicad-library-utils/schlib/autogen/connector/)"/> + <property name="Sheetname" value=""/> + <property name="Sheetfile" value="shutter.kicad_sch"/> + <property name="ki_description" value="Generic connector, single row, 01x02, script generated (kicad-library-utils/schlib/autogen/connector/)"/> + <property name="ki_keywords" value="connector"/> + <sheetpath names="/" tstamps="/"/> + <tstamps>5bd9f636-efbf-4daf-bfde-a7afb874d687</tstamps> + </comp> + <comp ref="J2"> + <value>power</value> + <footprint>TerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-2-5.08_1x02_P5.08mm_Horizontal</footprint> + <libsource lib="Connector" part="Conn_01x02_Female" description="Generic connector, single row, 01x02, script generated (kicad-library-utils/schlib/autogen/connector/)"/> + <property name="Sheetname" value=""/> + <property name="Sheetfile" value="shutter.kicad_sch"/> + <property name="ki_description" value="Generic connector, single row, 01x02, script generated (kicad-library-utils/schlib/autogen/connector/)"/> + <property name="ki_keywords" value="connector"/> + <sheetpath names="/" tstamps="/"/> + <tstamps>ae66468f-e721-4060-96f1-db9d8d781954</tstamps> + </comp> + <comp ref="J3"> + <value>SWD</value> + <footprint>Connector_PinHeader_1.27mm:PinHeader_1x06_P1.27mm_Vertical</footprint> + <libsource lib="Connector" part="Conn_01x06_Female" description="Generic connector, single row, 01x06, script generated (kicad-library-utils/schlib/autogen/connector/)"/> + <property name="Sheetname" value=""/> + <property name="Sheetfile" value="shutter.kicad_sch"/> + <property name="ki_description" value="Generic connector, single row, 01x06, script generated (kicad-library-utils/schlib/autogen/connector/)"/> + <property name="ki_keywords" value="connector"/> + <sheetpath names="/" tstamps="/"/> + <tstamps>cf4190cb-e894-4cb7-a066-e1fddb54d81d</tstamps> + </comp> + <comp ref="J4"> + <value>5v</value> + <footprint>Connector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm_Vertical</footprint> + <libsource lib="Connector_Generic" part="Conn_01x01" description="Generic connector, single row, 01x01, script generated (kicad-library-utils/schlib/autogen/connector/)"/> + <property name="Sheetname" value=""/> + <property name="Sheetfile" value="shutter.kicad_sch"/> + <property name="ki_description" value="Generic connector, single row, 01x01, script generated (kicad-library-utils/schlib/autogen/connector/)"/> + <property name="ki_keywords" value="connector"/> + <sheetpath names="/" tstamps="/"/> + <tstamps>f510a2d4-5933-4be0-ab8f-369fe764d46e</tstamps> + </comp> + <comp ref="J5"> + <value>GND</value> + <footprint>Connector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm_Vertical</footprint> + <libsource lib="Connector_Generic" part="Conn_01x01" description="Generic connector, single row, 01x01, script generated (kicad-library-utils/schlib/autogen/connector/)"/> + <property name="Sheetname" value=""/> + <property name="Sheetfile" value="shutter.kicad_sch"/> + <property name="ki_description" value="Generic connector, single row, 01x01, script generated (kicad-library-utils/schlib/autogen/connector/)"/> + <property name="ki_keywords" value="connector"/> + <sheetpath names="/" tstamps="/"/> + <tstamps>0e6a2462-6232-4c0c-921f-6a66478b0db9</tstamps> + </comp> + <comp ref="J6"> + <value>3v3</value> + <footprint>Connector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm_Vertical</footprint> + <libsource lib="Connector_Generic" part="Conn_01x01" description="Generic connector, single row, 01x01, script generated (kicad-library-utils/schlib/autogen/connector/)"/> + <property name="Sheetname" value=""/> + <property name="Sheetfile" value="shutter.kicad_sch"/> + <property name="ki_description" value="Generic connector, single row, 01x01, script generated (kicad-library-utils/schlib/autogen/connector/)"/> + <property name="ki_keywords" value="connector"/> + <sheetpath names="/" tstamps="/"/> + <tstamps>6e902ff7-ed64-4be4-a620-dcbec0005084</tstamps> + </comp> + <comp ref="J7"> + <value>USB_B</value> + <footprint>Connector_USB:USB_B_Lumberg_2411_02_Horizontal</footprint> + <datasheet> ~</datasheet> + <libsource lib="Connector" part="USB_B" description="USB Type B connector"/> + <property name="Sheetname" value=""/> + <property name="Sheetfile" value="shutter.kicad_sch"/> + <property name="ki_description" value="USB Type B connector"/> + <property name="ki_keywords" value="connector USB"/> + <sheetpath names="/" tstamps="/"/> + <tstamps>ec0c36b0-9030-4188-a3fd-6445c337e863</tstamps> + </comp> + <comp ref="J8"> + <value>hall</value> + <footprint>Connector_JST:JST_PH_B2B-PH-K_1x02_P2.00mm_Vertical</footprint> + <libsource lib="Connector" part="Conn_01x02_Female" description="Generic connector, single row, 01x02, script generated (kicad-library-utils/schlib/autogen/connector/)"/> + <property name="Sheetname" value=""/> + <property name="Sheetfile" value="shutter.kicad_sch"/> + <property name="ki_description" value="Generic connector, single row, 01x02, script generated (kicad-library-utils/schlib/autogen/connector/)"/> + <property name="ki_keywords" value="connector"/> + <sheetpath names="/" tstamps="/"/> + <tstamps>2cdf4672-8bc0-4c80-a467-2be0b8fc7083</tstamps> + </comp> + <comp ref="J9"> + <value>ccd</value> + <footprint>Connector_JST:JST_PH_B2B-PH-K_1x02_P2.00mm_Vertical</footprint> + <libsource lib="Connector" part="Conn_01x02_Female" description="Generic connector, single row, 01x02, script generated (kicad-library-utils/schlib/autogen/connector/)"/> + <property name="Sheetname" value=""/> + <property name="Sheetfile" value="shutter.kicad_sch"/> + <property name="ki_description" value="Generic connector, single row, 01x02, script generated (kicad-library-utils/schlib/autogen/connector/)"/> + <property name="ki_keywords" value="connector"/> + <sheetpath names="/" tstamps="/"/> + <tstamps>e91a1ceb-d5ae-4a13-b9ce-026bff51d405</tstamps> + </comp> + <comp ref="Q1"> + <value>DTA114Y</value> + <footprint>Package_TO_SOT_SMD:SOT-323_SC-70_Handsoldering</footprint> + <libsource lib="Transistor_BJT" part="DTA114Y" description="Digital PNP Transistor, 10k/47k, SOT-23"/> + <property name="Sheetname" value=""/> + <property name="Sheetfile" value="shutter.kicad_sch"/> + <property name="ki_description" value="Digital PNP Transistor, 10k/47k, SOT-23"/> + <property name="ki_keywords" value="ROHM Digital PNP Transistor"/> + <sheetpath names="/" tstamps="/"/> + <tstamps>7e23f7fd-4944-4efe-b398-4293e78bbe15</tstamps> + </comp> + <comp ref="R1"> + <value>6.9</value> + <footprint>Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder</footprint> + <libsource lib="Device" part="R" description="Resistor"/> + <property name="Sheetname" value=""/> + <property name="Sheetfile" value="shutter.kicad_sch"/> + <property name="ki_description" value="Resistor"/> + <property name="ki_keywords" value="R res resistor"/> + <sheetpath names="/" tstamps="/"/> + <tstamps>f50757df-fee6-46fb-96ff-c0d6200c9fcf</tstamps> + </comp> + <comp ref="R2"> + <value>56k</value> + <footprint>Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder</footprint> + <libsource lib="Device" part="R" description="Resistor"/> + <property name="Sheetname" value=""/> + <property name="Sheetfile" value="shutter.kicad_sch"/> + <property name="ki_description" value="Resistor"/> + <property name="ki_keywords" value="R res resistor"/> + <sheetpath names="/" tstamps="/"/> + <tstamps>9ea77273-01ce-4ded-8876-1ca813b38755</tstamps> + </comp> + <comp ref="R3"> + <value>4k7</value> + <footprint>Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder</footprint> + <libsource lib="Device" part="R" description="Resistor"/> + <property name="Sheetname" value=""/> + <property name="Sheetfile" value="shutter.kicad_sch"/> + <property name="ki_description" value="Resistor"/> + <property name="ki_keywords" value="R res resistor"/> + <sheetpath names="/" tstamps="/"/> + <tstamps>71e9b536-445c-4f6e-b268-0eb5bf33f7b7</tstamps> + </comp> + <comp ref="R4"> + <value>300 II</value> + <footprint>Resistor_THT:R_Axial_Power_L20.0mm_W6.4mm_P22.40mm</footprint> + <libsource lib="Device" part="R" description="Resistor"/> + <property name="Sheetname" value=""/> + <property name="Sheetfile" value="shutter.kicad_sch"/> + <property name="ki_description" value="Resistor"/> + <property name="ki_keywords" value="R res resistor"/> + <sheetpath names="/" tstamps="/"/> + <tstamps>d8e1f451-5fce-416a-b423-7be37c0c9bfb</tstamps> + </comp> + <comp ref="R5"> + <value>4k7</value> + <footprint>Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder</footprint> + <libsource lib="Device" part="R" description="Resistor"/> + <property name="Sheetname" value=""/> + <property name="Sheetfile" value="shutter.kicad_sch"/> + <property name="ki_description" value="Resistor"/> + <property name="ki_keywords" value="R res resistor"/> + <sheetpath names="/" tstamps="/"/> + <tstamps>3314803a-6684-4479-a876-1bef9b756677</tstamps> + </comp> + <comp ref="R6"> + <value>4k7</value> + <footprint>Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder</footprint> + <libsource lib="Device" part="R" description="Resistor"/> + <property name="Sheetname" value=""/> + <property name="Sheetfile" value="shutter.kicad_sch"/> + <property name="ki_description" value="Resistor"/> + <property name="ki_keywords" value="R res resistor"/> + <sheetpath names="/" tstamps="/"/> + <tstamps>980f7aac-c760-4fac-8c67-6077682c43f4</tstamps> + </comp> + <comp ref="R7"> + <value>10k</value> + <footprint>Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder</footprint> + <libsource lib="Device" part="R" description="Resistor"/> + <property name="Sheetname" value=""/> + <property name="Sheetfile" value="shutter.kicad_sch"/> + <property name="ki_description" value="Resistor"/> + <property name="ki_keywords" value="R res resistor"/> + <sheetpath names="/" tstamps="/"/> + <tstamps>7a2b2697-d23b-461c-a18b-db32fdd2ebce</tstamps> + </comp> + <comp ref="R8"> + <value>22</value> + <footprint>Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder</footprint> + <libsource lib="Device" part="R" description="Resistor"/> + <property name="Sheetname" value=""/> + <property name="Sheetfile" value="shutter.kicad_sch"/> + <property name="ki_description" value="Resistor"/> + <property name="ki_keywords" value="R res resistor"/> + <sheetpath names="/" tstamps="/"/> + <tstamps>d478ffc1-49d5-4f85-92c3-899e784760e3</tstamps> + </comp> + <comp ref="R9"> + <value>22</value> + <footprint>Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder</footprint> + <libsource lib="Device" part="R" description="Resistor"/> + <property name="Sheetname" value=""/> + <property name="Sheetfile" value="shutter.kicad_sch"/> + <property name="ki_description" value="Resistor"/> + <property name="ki_keywords" value="R res resistor"/> + <sheetpath names="/" tstamps="/"/> + <tstamps>e1625402-a7a5-40c8-99fe-f8e9d81decf2</tstamps> + </comp> + <comp ref="R10"> + <value>1k5</value> + <footprint>Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder</footprint> + <libsource lib="Device" part="R" description="Resistor"/> + <property name="Sheetname" value=""/> + <property name="Sheetfile" value="shutter.kicad_sch"/> + <property name="ki_description" value="Resistor"/> + <property name="ki_keywords" value="R res resistor"/> + <sheetpath names="/" tstamps="/"/> + <tstamps>0dd3bdf9-b3e9-4248-b191-433d2726416c</tstamps> + </comp> + <comp ref="U1"> + <value>LM1117-3.3</value> + <footprint>Package_TO_SOT_SMD:SOT-223-3_TabPin2</footprint> + <datasheet>http://www.ti.com/lit/ds/symlink/lm1117.pdf</datasheet> + <libsource lib="Regulator_Linear" part="LM1117-3.3" description="800mA Low-Dropout Linear Regulator, 3.3V fixed output, TO-220/TO-252/TO-263/SOT-223"/> + <property name="Sheetname" value=""/> + <property name="Sheetfile" value="shutter.kicad_sch"/> + <property name="ki_description" value="800mA Low-Dropout Linear Regulator, 3.3V fixed output, TO-220/TO-252/TO-263/SOT-223"/> + <property name="ki_keywords" value="linear regulator ldo fixed positive"/> + <sheetpath names="/" tstamps="/"/> + <tstamps>610c83b0-fe12-4592-b310-23f731d13bc6</tstamps> + </comp> + <comp ref="U2"> + <value>STM32F103C6Tx</value> + <footprint>Package_QFP:LQFP-48_7x7mm_P0.5mm</footprint> + <datasheet>http://www.st.com/st-web-ui/static/active/en/resource/technical/document/datasheet/CD00210843.pdf</datasheet> + <libsource lib="MCU_ST_STM32F1" part="STM32F103C6Tx" description="ARM Cortex-M3 MCU, 32KB flash, 10KB RAM, 72MHz, 2-3.6V, 37 GPIO, LQFP-48"/> + <property name="Sheetname" value=""/> + <property name="Sheetfile" value="shutter.kicad_sch"/> + <property name="ki_description" value="ARM Cortex-M3 MCU, 32KB flash, 10KB RAM, 72MHz, 2-3.6V, 37 GPIO, LQFP-48"/> + <property name="ki_keywords" value="ARM Cortex-M3 STM32F1 STM32F103"/> + <sheetpath names="/" tstamps="/"/> + <tstamps>29a25600-08b3-4abd-8f27-6743d84ba2cf</tstamps> + </comp> + <comp ref="U3"> + <value>USBLC6-2SC6</value> + <footprint>Package_TO_SOT_SMD:SOT-23-6_Handsoldering</footprint> + <datasheet>http://www2.st.com/resource/en/datasheet/CD00050750.pdf</datasheet> + <libsource lib="Power_Protection" part="USBLC6-2SC6" description="Very low capacitance ESD protection diode, 2 data-line, SOT-23-6"/> + <property name="Sheetname" value=""/> + <property name="Sheetfile" value="shutter.kicad_sch"/> + <property name="ki_description" value="Very low capacitance ESD protection diode, 2 data-line, SOT-23-6"/> + <property name="ki_keywords" value="usb ethernet video"/> + <sheetpath names="/" tstamps="/"/> + <tstamps>88f9b783-65fa-4190-83e6-8920b0786838</tstamps> + </comp> + <comp ref="Y1"> + <value>NX5032GA-8MHz</value> + <footprint>Crystal:Crystal_SMD_5032-2Pin_5.0x3.2mm</footprint> + <libsource lib="Device" part="Crystal" description="Two pin crystal"/> + <property name="Sheetname" value=""/> + <property name="Sheetfile" value="shutter.kicad_sch"/> + <property name="ki_description" value="Two pin crystal"/> + <property name="ki_keywords" value="quartz ceramic resonator oscillator"/> + <sheetpath names="/" tstamps="/"/> + <tstamps>be73e1b2-57bc-49db-a6c9-a6c6f7b2ed34</tstamps> + </comp> + </components> + <libparts> + <libpart lib="ALL-rescue" part="CP1"> + <footprints> + <fp>CP*</fp> + <fp>SM*</fp> + </footprints> + <fields> + <field name="Reference">C</field> + <field name="Value">CP1</field> + </fields> + <pins> + <pin num="1" name="" type="passive"/> + <pin num="2" name="" type="passive"/> + </pins> + </libpart> + <libpart lib="Connector" part="Conn_01x02_Female"> + <description>Generic connector, single row, 01x02, script generated (kicad-library-utils/schlib/autogen/connector/)</description> + <docs>~</docs> + <footprints> + <fp>Connector*:*_1x??_*</fp> + </footprints> + <fields> + <field name="Reference">J</field> + <field name="Value">Conn_01x02_Female</field> + <field name="Datasheet">~</field> + </fields> + <pins> + <pin num="1" name="Pin_1" type="passive"/> + <pin num="2" name="Pin_2" type="passive"/> + </pins> + </libpart> + <libpart lib="Connector" part="Conn_01x06_Female"> + <description>Generic connector, single row, 01x06, script generated (kicad-library-utils/schlib/autogen/connector/)</description> + <docs>~</docs> + <footprints> + <fp>Connector*:*_1x??_*</fp> + </footprints> + <fields> + <field name="Reference">J</field> + <field name="Value">Conn_01x06_Female</field> + <field name="Datasheet">~</field> + </fields> + <pins> + <pin num="1" name="Pin_1" type="passive"/> + <pin num="2" name="Pin_2" type="passive"/> + <pin num="3" name="Pin_3" type="passive"/> + <pin num="4" name="Pin_4" type="passive"/> + <pin num="5" name="Pin_5" type="passive"/> + <pin num="6" name="Pin_6" type="passive"/> + </pins> + </libpart> + <libpart lib="Connector" part="USB_B"> + <description>USB Type B connector</description> + <docs> ~</docs> + <footprints> + <fp>USB*</fp> + </footprints> + <fields> + <field name="Reference">J</field> + <field name="Value">USB_B</field> + <field name="Datasheet"> ~</field> + </fields> + <pins> + <pin num="1" name="VBUS" type="power_out"/> + <pin num="2" name="D-" type="bidirectional"/> + <pin num="3" name="D+" type="bidirectional"/> + <pin num="4" name="GND" type="power_out"/> + <pin num="5" name="Shield" type="passive"/> + </pins> + </libpart> + <libpart lib="Connector_Generic" part="Conn_01x01"> + <description>Generic connector, single row, 01x01, script generated (kicad-library-utils/schlib/autogen/connector/)</description> + <docs>~</docs> + <footprints> + <fp>Connector*:*_1x??_*</fp> + </footprints> + <fields> + <field name="Reference">J</field> + <field name="Value">Conn_01x01</field> + <field name="Datasheet">~</field> + </fields> + <pins> + <pin num="1" name="Pin_1" type="passive"/> + </pins> + </libpart> + <libpart lib="Device" part="C"> + <description>Unpolarized capacitor</description> + <docs>~</docs> + <footprints> + <fp>C_*</fp> + </footprints> + <fields> + <field name="Reference">C</field> + <field name="Value">C</field> + <field name="Datasheet">~</field> + </fields> + <pins> + <pin num="1" name="" type="passive"/> + <pin num="2" name="" type="passive"/> + </pins> + </libpart> + <libpart lib="Device" part="C_Polarized"> + <description>Polarized capacitor</description> + <docs>~</docs> + <footprints> + <fp>CP_*</fp> + </footprints> + <fields> + <field name="Reference">C</field> + <field name="Value">C_Polarized</field> + <field name="Datasheet">~</field> + </fields> + <pins> + <pin num="1" name="" type="passive"/> + <pin num="2" name="" type="passive"/> + </pins> + </libpart> + <libpart lib="Device" part="Crystal"> + <description>Two pin crystal</description> + <docs>~</docs> + <footprints> + <fp>Crystal*</fp> + </footprints> + <fields> + <field name="Reference">Y</field> + <field name="Value">Crystal</field> + <field name="Datasheet">~</field> + </fields> + <pins> + <pin num="1" name="1" type="passive"/> + <pin num="2" name="2" type="passive"/> + </pins> + </libpart> + <libpart lib="Device" part="D_Schottky"> + <description>Schottky diode</description> + <docs>~</docs> + <footprints> + <fp>TO-???*</fp> + <fp>*_Diode_*</fp> + <fp>*SingleDiode*</fp> + <fp>D_*</fp> + </footprints> + <fields> + <field name="Reference">D</field> + <field name="Value">D_Schottky</field> + <field name="Datasheet">~</field> + </fields> + <pins> + <pin num="1" name="K" type="passive"/> + <pin num="2" name="A" type="passive"/> + </pins> + </libpart> + <libpart lib="Device" part="R"> + <description>Resistor</description> + <docs>~</docs> + <footprints> + <fp>R_*</fp> + </footprints> + <fields> + <field name="Reference">R</field> + <field name="Value">R</field> + <field name="Datasheet">~</field> + </fields> + <pins> + <pin num="1" name="" type="passive"/> + <pin num="2" name="" type="passive"/> + </pins> + </libpart> + <libpart lib="MCU_ST_STM32F1" part="STM32F103C6Tx"> + <description>ARM Cortex-M3 MCU, 32KB flash, 10KB RAM, 72MHz, 2-3.6V, 37 GPIO, LQFP-48</description> + <docs>http://www.st.com/st-web-ui/static/active/en/resource/technical/document/datasheet/CD00210843.pdf</docs> + <footprints> + <fp>LQFP*7x7mm*P0.5mm*</fp> + </footprints> + <fields> + <field name="Reference">U</field> + <field name="Value">STM32F103C6Tx</field> + <field name="Footprint">Package_QFP:LQFP-48_7x7mm_P0.5mm</field> + <field name="Datasheet">http://www.st.com/st-web-ui/static/active/en/resource/technical/document/datasheet/CD00210843.pdf</field> + </fields> + <pins> + <pin num="1" name="VBAT" type="power_in"/> + <pin num="2" name="PC13" type="bidirectional"/> + <pin num="3" name="PC14" type="bidirectional"/> + <pin num="4" name="PC15" type="bidirectional"/> + <pin num="5" name="PD0" type="input"/> + <pin num="6" name="PD1" type="input"/> + <pin num="7" name="NRST" type="input"/> + <pin num="8" name="VSSA" type="power_in"/> + <pin num="9" name="VDDA" type="power_in"/> + <pin num="10" name="PA0" type="bidirectional"/> + <pin num="11" name="PA1" type="bidirectional"/> + <pin num="12" name="PA2" type="bidirectional"/> + <pin num="13" name="PA3" type="bidirectional"/> + <pin num="14" name="PA4" type="bidirectional"/> + <pin num="15" name="PA5" type="bidirectional"/> + <pin num="16" name="PA6" type="bidirectional"/> + <pin num="17" name="PA7" type="bidirectional"/> + <pin num="18" name="PB0" type="bidirectional"/> + <pin num="19" name="PB1" type="bidirectional"/> + <pin num="20" name="PB2" type="bidirectional"/> + <pin num="21" name="PB10" type="bidirectional"/> + <pin num="22" name="PB11" type="bidirectional"/> + <pin num="23" name="VSS" type="power_in"/> + <pin num="24" name="VDD" type="power_in"/> + <pin num="25" name="PB12" type="bidirectional"/> + <pin num="26" name="PB13" type="bidirectional"/> + <pin num="27" name="PB14" type="bidirectional"/> + <pin num="28" name="PB15" type="bidirectional"/> + <pin num="29" name="PA8" type="bidirectional"/> + <pin num="30" name="PA9" type="bidirectional"/> + <pin num="31" name="PA10" type="bidirectional"/> + <pin num="32" name="PA11" type="bidirectional"/> + <pin num="33" name="PA12" type="bidirectional"/> + <pin num="34" name="PA13" type="bidirectional"/> + <pin num="35" name="VSS" type="power_in"/> + <pin num="36" name="VDD" type="power_in"/> + <pin num="37" name="PA14" type="bidirectional"/> + <pin num="38" name="PA15" type="bidirectional"/> + <pin num="39" name="PB3" type="bidirectional"/> + <pin num="40" name="PB4" type="bidirectional"/> + <pin num="41" name="PB5" type="bidirectional"/> + <pin num="42" name="PB6" type="bidirectional"/> + <pin num="43" name="PB7" type="bidirectional"/> + <pin num="44" name="BOOT0" type="input"/> + <pin num="45" name="PB8" type="bidirectional"/> + <pin num="46" name="PB9" type="bidirectional"/> + <pin num="47" name="VSS" type="power_in"/> + <pin num="48" name="VDD" type="power_in"/> + </pins> + </libpart> + <libpart lib="Mechanical" part="MountingHole"> + <description>Mounting Hole without connection</description> + <docs>~</docs> + <footprints> + <fp>MountingHole*</fp> + </footprints> + <fields> + <field name="Reference">H</field> + <field name="Value">MountingHole</field> + <field name="Datasheet">~</field> + </fields> + </libpart> + <libpart lib="Power_Protection" part="USBLC6-2SC6"> + <description>Very low capacitance ESD protection diode, 2 data-line, SOT-23-6</description> + <docs>https://www.st.com/resource/en/datasheet/usblc6-2.pdf</docs> + <footprints> + <fp>SOT?23*</fp> + </footprints> + <fields> + <field name="Reference">U</field> + <field name="Value">USBLC6-2SC6</field> + <field name="Footprint">Package_TO_SOT_SMD:SOT-23-6</field> + <field name="Datasheet">https://www.st.com/resource/en/datasheet/usblc6-2.pdf</field> + </fields> + <pins> + <pin num="1" name="I/O1" type="passive"/> + <pin num="2" name="GND" type="passive"/> + <pin num="3" name="I/O2" type="passive"/> + <pin num="4" name="I/O2" type="passive"/> + <pin num="5" name="VBUS" type="passive"/> + <pin num="6" name="I/O1" type="passive"/> + </pins> + </libpart> + <libpart lib="Regulator_Linear" part="LM1117-3.3"> + <description>800mA Low-Dropout Linear Regulator, 3.3V fixed output, TO-220/TO-252/TO-263/SOT-223</description> + <docs>http://www.ti.com/lit/ds/symlink/lm1117.pdf</docs> + <footprints> + <fp>SOT?223*</fp> + <fp>TO?263*</fp> + <fp>TO?252*</fp> + <fp>TO?220*</fp> + </footprints> + <fields> + <field name="Reference">U</field> + <field name="Value">LM1117-3.3</field> + <field name="Datasheet">http://www.ti.com/lit/ds/symlink/lm1117.pdf</field> + </fields> + <pins> + <pin num="1" name="GND" type="power_in"/> + <pin num="2" name="VO" type="power_out"/> + <pin num="3" name="VI" type="power_in"/> + </pins> + </libpart> + <libpart lib="Transistor_BJT" part="DTA114Y"> + <description>Digital PNP Transistor, 10k/47k, SOT-23</description> + <footprints> + <fp>SOT?23*</fp> + <fp>SC?59*</fp> + </footprints> + <fields> + <field name="Reference">Q</field> + <field name="Value">DTA114Y</field> + </fields> + <pins> + <pin num="1" name="B" type="input"/> + <pin num="2" name="E" type="passive"/> + <pin num="3" name="C" type="passive"/> + </pins> + </libpart> + <libpart lib="my_elements" part="TLE5205"> + <footprints> + <fp>TO220*</fp> + <fp>TO-220*</fp> + </footprints> + <fields> + <field name="Reference">U</field> + <field name="Value">TLE5205</field> + </fields> + <pins> + <pin num="1" name="OUT1" type="power_out"/> + <pin num="2" name="EF" type="output"/> + <pin num="3" name="IN1" type="input"/> + <pin num="4" name="GND" type="power_in"/> + <pin num="5" name="IN2" type="input"/> + <pin num="6" name="Vs" type="power_in"/> + <pin num="7" name="OUT2" type="power_out"/> + </pins> + </libpart> + </libparts> + <libraries> + <library logical="Connector"> + <uri>/usr/share/kicad/kicad-symbols/Connector.kicad_sym</uri> + </library> + <library logical="Connector_Generic"> + <uri>/usr/share/kicad/kicad-symbols/Connector_Generic.kicad_sym</uri> + </library> + <library logical="Device"> + <uri>/usr/share/kicad/kicad-symbols/Device.kicad_sym</uri> + </library> + <library logical="MCU_ST_STM32F1"> + <uri>/usr/share/kicad/kicad-symbols/MCU_ST_STM32F1.kicad_sym</uri> + </library> + <library logical="Mechanical"> + <uri>/usr/share/kicad/kicad-symbols/Mechanical.kicad_sym</uri> + </library> + <library logical="Power_Protection"> + <uri>/usr/share/kicad/kicad-symbols/Power_Protection.kicad_sym</uri> + </library> + <library logical="Regulator_Linear"> + <uri>/usr/share/kicad/kicad-symbols/Regulator_Linear.kicad_sym</uri> + </library> + <library logical="Transistor_BJT"> + <uri>/usr/share/kicad/kicad-symbols/Transistor_BJT.kicad_sym</uri> + </library> + </libraries> + <nets> + <net code="1" name="+3V3"> + <node ref="C3" pin="1" pintype="passive"/> + <node ref="C4" pin="1" pintype="passive"/> + <node ref="C5" pin="1" pintype="passive"/> + <node ref="C6" pin="1" pintype="passive"/> + <node ref="C7" pin="1" pintype="passive"/> + <node ref="C8" pin="1" pintype="passive"/> + <node ref="D3" pin="1" pinfunction="K" pintype="passive"/> + <node ref="J6" pin="1" pinfunction="Pin_1" pintype="passive"/> + <node ref="Q1" pin="2" pinfunction="E" pintype="passive"/> + <node ref="R1" pin="1" pintype="passive"/> + <node ref="R5" pin="2" pintype="passive"/> + <node ref="R6" pin="2" pintype="passive"/> + <node ref="U1" pin="2" pinfunction="VO" pintype="power_out"/> + <node ref="U2" pin="1" pinfunction="VBAT" pintype="power_in"/> + <node ref="U2" pin="24" pinfunction="VDD" pintype="power_in"/> + <node ref="U2" pin="36" pinfunction="VDD" pintype="power_in"/> + <node ref="U2" pin="48" pinfunction="VDD" pintype="power_in"/> + <node ref="U2" pin="9" pinfunction="VDDA" pintype="power_in"/> + </net> + <net code="2" name="/BOOT0"> + <node ref="J3" pin="5" pinfunction="Pin_5" pintype="passive"/> + <node ref="R7" pin="1" pintype="passive"/> + <node ref="U2" pin="44" pinfunction="BOOT0" pintype="input"/> + </net> + <net code="3" name="/NRST"> + <node ref="J3" pin="6" pinfunction="Pin_6" pintype="passive"/> + <node ref="U2" pin="7" pinfunction="NRST" pintype="input"/> + </net> + <net code="4" name="/OSC_IN"> + <node ref="C9" pin="1" pintype="passive"/> + <node ref="U2" pin="5" pinfunction="PD0" pintype="input"/> + <node ref="Y1" pin="1" pinfunction="1" pintype="passive"/> + </net> + <net code="5" name="/OSC_OUT"> + <node ref="C10" pin="1" pintype="passive"/> + <node ref="U2" pin="6" pinfunction="PD1" pintype="input"/> + <node ref="Y1" pin="2" pinfunction="2" pintype="passive"/> + </net> + <net code="6" name="/SHTR_A"> + <node ref="DA1" pin="3" pinfunction="IN1" pintype="input"/> + <node ref="R6" pin="1" pintype="passive"/> + <node ref="U2" pin="16" pinfunction="PA6" pintype="bidirectional"/> + </net> + <net code="7" name="/SHTR_B"> + <node ref="DA1" pin="5" pinfunction="IN2" pintype="input"/> + <node ref="R5" pin="1" pintype="passive"/> + <node ref="U2" pin="15" pinfunction="PA5" pintype="bidirectional"/> + </net> + <net code="8" name="/SHTR_FB"> + <node ref="DA1" pin="2" pinfunction="EF" pintype="output"/> + <node ref="U2" pin="17" pinfunction="PA7" pintype="bidirectional"/> + </net> + <net code="9" name="/SHTR_V"> + <node ref="D3" pin="2" pinfunction="A" pintype="passive"/> + <node ref="R2" pin="2" pintype="passive"/> + <node ref="R3" pin="1" pintype="passive"/> + <node ref="U2" pin="13" pinfunction="PA3" pintype="bidirectional"/> + </net> + <net code="10" name="/SWCLK"> + <node ref="J3" pin="1" pinfunction="Pin_1" pintype="passive"/> + <node ref="U2" pin="37" pinfunction="PA14" pintype="bidirectional"/> + </net> + <net code="11" name="/SWDIO"> + <node ref="J3" pin="2" pinfunction="Pin_2" pintype="passive"/> + <node ref="U2" pin="34" pinfunction="PA13" pintype="bidirectional"/> + </net> + <net code="12" name="/USBDM"> + <node ref="U2" pin="32" pinfunction="PA11" pintype="bidirectional"/> + <node ref="U3" pin="6" pinfunction="I/O1" pintype="passive"/> + </net> + <net code="13" name="/USBDP"> + <node ref="R10" pin="1" pintype="passive"/> + <node ref="U2" pin="33" pinfunction="PA12" pintype="bidirectional"/> + <node ref="U3" pin="4" pinfunction="I/O2" pintype="passive"/> + </net> + <net code="14" name="/USB_PU"> + <node ref="Q1" pin="1" pinfunction="B" pintype="input"/> + <node ref="U2" pin="31" pinfunction="PA10" pintype="bidirectional"/> + </net> + <net code="15" name="/Uin"> + <node ref="D1" pin="1" pinfunction="K" pintype="passive"/> + <node ref="D4" pin="1" pinfunction="K" pintype="passive"/> + <node ref="J2" pin="2" pinfunction="Pin_2" pintype="passive"/> + <node ref="R4" pin="1" pintype="passive"/> + </net> + <net code="16" name="/VBUS"> + <node ref="C2" pin="1" pintype="passive"/> + <node ref="J4" pin="1" pinfunction="Pin_1" pintype="passive"/> + <node ref="J7" pin="1" pinfunction="VBUS" pintype="power_out"/> + <node ref="U1" pin="3" pinfunction="VI" pintype="power_in"/> + <node ref="U3" pin="5" pinfunction="VBUS" pintype="passive"/> + </net> + <net code="17" name="GND"> + <node ref="C1" pin="2" pintype="passive"/> + <node ref="C10" pin="2" pintype="passive"/> + <node ref="C2" pin="2" pintype="passive"/> + <node ref="C3" pin="2" pintype="passive"/> + <node ref="C4" pin="2" pintype="passive"/> + <node ref="C5" pin="2" pintype="passive"/> + <node ref="C6" pin="2" pintype="passive"/> + <node ref="C7" pin="2" pintype="passive"/> + <node ref="C8" pin="2" pintype="passive"/> + <node ref="C9" pin="2" pintype="passive"/> + <node ref="D2" pin="2" pinfunction="A" pintype="passive"/> + <node ref="D5" pin="2" pinfunction="A" pintype="passive"/> + <node ref="DA1" pin="4" pinfunction="GND" pintype="power_in"/> + <node ref="J2" pin="1" pinfunction="Pin_1" pintype="passive"/> + <node ref="J3" pin="3" pinfunction="Pin_3" pintype="passive"/> + <node ref="J5" pin="1" pinfunction="Pin_1" pintype="passive"/> + <node ref="J7" pin="4" pinfunction="GND" pintype="power_out"/> + <node ref="J7" pin="5" pinfunction="Shield" pintype="passive"/> + <node ref="J8" pin="1" pinfunction="Pin_1" pintype="passive"/> + <node ref="J9" pin="1" pinfunction="Pin_1" pintype="passive"/> + <node ref="R3" pin="2" pintype="passive"/> + <node ref="R7" pin="2" pintype="passive"/> + <node ref="U1" pin="1" pinfunction="GND" pintype="power_in"/> + <node ref="U2" pin="23" pinfunction="VSS" pintype="power_in"/> + <node ref="U2" pin="35" pinfunction="VSS" pintype="power_in"/> + <node ref="U2" pin="47" pinfunction="VSS" pintype="power_in"/> + <node ref="U2" pin="8" pinfunction="VSSA" pintype="power_in"/> + <node ref="U3" pin="2" pinfunction="GND" pintype="passive"/> + </net> + <net code="18" name="Net-(D1-A)"> + <node ref="D1" pin="2" pinfunction="A" pintype="passive"/> + <node ref="D2" pin="1" pinfunction="K" pintype="passive"/> + <node ref="DA1" pin="1" pinfunction="OUT1" pintype="power_out"/> + <node ref="J1" pin="2" pinfunction="Pin_2" pintype="passive"/> + </net> + <net code="19" name="Net-(D4-A)"> + <node ref="D4" pin="2" pinfunction="A" pintype="passive"/> + <node ref="D5" pin="1" pinfunction="K" pintype="passive"/> + <node ref="DA1" pin="7" pinfunction="OUT2" pintype="power_out"/> + <node ref="J1" pin="1" pinfunction="Pin_1" pintype="passive"/> + </net> + <net code="20" name="Net-(DA1-Vs)"> + <node ref="C1" pin="1" pintype="passive"/> + <node ref="DA1" pin="6" pinfunction="Vs" pintype="power_in"/> + <node ref="R2" pin="1" pintype="passive"/> + <node ref="R4" pin="2" pintype="passive"/> + </net> + <net code="21" name="Net-(J3-Pin_4)"> + <node ref="J3" pin="4" pinfunction="Pin_4" pintype="passive"/> + <node ref="R1" pin="2" pintype="passive"/> + </net> + <net code="22" name="Net-(J7-D+)"> + <node ref="J7" pin="3" pinfunction="D+" pintype="bidirectional"/> + <node ref="R8" pin="1" pintype="passive"/> + </net> + <net code="23" name="Net-(J7-D-)"> + <node ref="J7" pin="2" pinfunction="D-" pintype="bidirectional"/> + <node ref="R9" pin="1" pintype="passive"/> + </net> + <net code="24" name="Net-(J8-Pin_2)"> + <node ref="J8" pin="2" pinfunction="Pin_2" pintype="passive"/> + <node ref="U2" pin="18" pinfunction="PB0" pintype="bidirectional"/> + </net> + <net code="25" name="Net-(J9-Pin_2)"> + <node ref="J9" pin="2" pinfunction="Pin_2" pintype="passive"/> + <node ref="U2" pin="22" pinfunction="PB11" pintype="bidirectional"/> + </net> + <net code="26" name="Net-(Q1-C)"> + <node ref="Q1" pin="3" pinfunction="C" pintype="passive"/> + <node ref="R10" pin="2" pintype="passive"/> + </net> + <net code="27" name="Net-(R8-Pad2)"> + <node ref="R8" pin="2" pintype="passive"/> + <node ref="U3" pin="3" pinfunction="I/O2" pintype="passive"/> + </net> + <net code="28" name="Net-(R9-Pad2)"> + <node ref="R9" pin="2" pintype="passive"/> + <node ref="U3" pin="1" pinfunction="I/O1" pintype="passive"/> + </net> + <net code="29" name="unconnected-(U2-PA0-Pad10)"> + <node ref="U2" pin="10" pinfunction="PA0" pintype="bidirectional+no_connect"/> + </net> + <net code="30" name="unconnected-(U2-PA1-Pad11)"> + <node ref="U2" pin="11" pinfunction="PA1" pintype="bidirectional+no_connect"/> + </net> + <net code="31" name="unconnected-(U2-PA2-Pad12)"> + <node ref="U2" pin="12" pinfunction="PA2" pintype="bidirectional+no_connect"/> + </net> + <net code="32" name="unconnected-(U2-PA4-Pad14)"> + <node ref="U2" pin="14" pinfunction="PA4" pintype="bidirectional+no_connect"/> + </net> + <net code="33" name="unconnected-(U2-PA8-Pad29)"> + <node ref="U2" pin="29" pinfunction="PA8" pintype="bidirectional+no_connect"/> + </net> + <net code="34" name="unconnected-(U2-PA9-Pad30)"> + <node ref="U2" pin="30" pinfunction="PA9" pintype="bidirectional+no_connect"/> + </net> + <net code="35" name="unconnected-(U2-PA15-Pad38)"> + <node ref="U2" pin="38" pinfunction="PA15" pintype="bidirectional+no_connect"/> + </net> + <net code="36" name="unconnected-(U2-PB1-Pad19)"> + <node ref="U2" pin="19" pinfunction="PB1" pintype="bidirectional+no_connect"/> + </net> + <net code="37" name="unconnected-(U2-PB2-Pad20)"> + <node ref="U2" pin="20" pinfunction="PB2" pintype="bidirectional+no_connect"/> + </net> + <net code="38" name="unconnected-(U2-PB3-Pad39)"> + <node ref="U2" pin="39" pinfunction="PB3" pintype="bidirectional+no_connect"/> + </net> + <net code="39" name="unconnected-(U2-PB4-Pad40)"> + <node ref="U2" pin="40" pinfunction="PB4" pintype="bidirectional+no_connect"/> + </net> + <net code="40" name="unconnected-(U2-PB5-Pad41)"> + <node ref="U2" pin="41" pinfunction="PB5" pintype="bidirectional+no_connect"/> + </net> + <net code="41" name="unconnected-(U2-PB6-Pad42)"> + <node ref="U2" pin="42" pinfunction="PB6" pintype="bidirectional+no_connect"/> + </net> + <net code="42" name="unconnected-(U2-PB7-Pad43)"> + <node ref="U2" pin="43" pinfunction="PB7" pintype="bidirectional+no_connect"/> + </net> + <net code="43" name="unconnected-(U2-PB8-Pad45)"> + <node ref="U2" pin="45" pinfunction="PB8" pintype="bidirectional+no_connect"/> + </net> + <net code="44" name="unconnected-(U2-PB9-Pad46)"> + <node ref="U2" pin="46" pinfunction="PB9" pintype="bidirectional+no_connect"/> + </net> + <net code="45" name="unconnected-(U2-PB10-Pad21)"> + <node ref="U2" pin="21" pinfunction="PB10" pintype="bidirectional+no_connect"/> + </net> + <net code="46" name="unconnected-(U2-PB12-Pad25)"> + <node ref="U2" pin="25" pinfunction="PB12" pintype="bidirectional+no_connect"/> + </net> + <net code="47" name="unconnected-(U2-PB13-Pad26)"> + <node ref="U2" pin="26" pinfunction="PB13" pintype="bidirectional+no_connect"/> + </net> + <net code="48" name="unconnected-(U2-PB14-Pad27)"> + <node ref="U2" pin="27" pinfunction="PB14" pintype="bidirectional+no_connect"/> + </net> + <net code="49" name="unconnected-(U2-PB15-Pad28)"> + <node ref="U2" pin="28" pinfunction="PB15" pintype="bidirectional+no_connect"/> + </net> + <net code="50" name="unconnected-(U2-PC13-Pad2)"> + <node ref="U2" pin="2" pinfunction="PC13" pintype="bidirectional+no_connect"/> + </net> + <net code="51" name="unconnected-(U2-PC14-Pad3)"> + <node ref="U2" pin="3" pinfunction="PC14" pintype="bidirectional+no_connect"/> + </net> + <net code="52" name="unconnected-(U2-PC15-Pad4)"> + <node ref="U2" pin="4" pinfunction="PC15" pintype="bidirectional+no_connect"/> + </net> + </nets> +</export> diff --git a/F1:F103/shutter/code/main.c b/F1:F103/shutter/main.c similarity index 100% rename from F1:F103/shutter/code/main.c rename to F1:F103/shutter/main.c diff --git a/F1:F103/shutter/code/openocd.cfg b/F1:F103/shutter/openocd.cfg similarity index 100% rename from F1:F103/shutter/code/openocd.cfg rename to F1:F103/shutter/openocd.cfg diff --git a/F1:F103/shutter/code/proto.c b/F1:F103/shutter/proto.c similarity index 87% rename from F1:F103/shutter/code/proto.c rename to F1:F103/shutter/proto.c index ee85953..f441fc9 100644 --- a/F1:F103/shutter/code/proto.c +++ b/F1:F103/shutter/proto.c @@ -21,6 +21,7 @@ #include "proto.h" #include "shutter.h" #include "usb.h" +#include "version.inc" char *omit_spaces(const char *buf){ while(*buf){ @@ -153,12 +154,13 @@ char *getnum(const char *txt, uint32_t *N){ } const char* helpmsg = + "https://github.com/eddyem/stm32samples/tree/master/F1:F103/shutter build#" BUILD_NUMBER " @ " BUILD_DATE "\n" "'0' - shutter CLO\n" "'1' - shutter OPE\n" "'2' - shutter HIZ\n" "'A' - get raw ADC values\n" - "'C' - close shutter\n" - //"'N' - read number (dec, 0xhex, 0oct, bbin) and show it in decimal\n" + "'C' - close shutter / abort exposition\n" + "'E n' - expose for n milliseconds\n" "'O' - open shutter\n" "'R' - software reset\n" "'S' - get shutter state; also hall and ccd inputs state (1 - active)\n" @@ -186,7 +188,7 @@ void bufputchar(char c){ *bptr = 0; } -extern uint8_t usbON; +static const char *OK = "OK", *ERR = "ERR"; const char *parse_cmd(const char *buf){ uint32_t u3; initbuf(); @@ -213,12 +215,12 @@ const char *parse_cmd(const char *buf){ } break; case 'C': - if(close_shutter()) add2buf("OK"); - else add2buf("ERR"); + if(close_shutter()) add2buf(OK); + else add2buf(ERR); break; case 'O': - if(open_shutter()) add2buf("OK"); - else add2buf("ERR"); + if(open_shutter()) add2buf(OK); + else add2buf(ERR); break; case 'R': USB_sendstr("Soft reset\n"); @@ -258,29 +260,29 @@ const char *parse_cmd(const char *buf){ default: return helpmsg; } - bufputchar('\n'); - return stbuf; - } - uint32_t Num = 0; - char *nxt; - switch(*buf){ // long messages - case 'N': - ++buf; - nxt = getnum(buf, &Num); - if(buf == nxt){ - if(Num == 0) return "Wrong number\n"; - return "Integer32 overflow\n"; - } - add2buf("You give: "); - add2buf(u2str(Num)); - if(*nxt && *nxt != '\n'){ - add2buf(", the rest of string: "); - add2buf(nxt); - }else add2buf("\n"); - break; - default: - return buf; + }else{ // long messages + uint32_t Num = 0; + char *nxt; + switch(*buf){ + case 'E': + ++buf; + nxt = getnum(buf, &Num); + if(buf == nxt){ + if(Num == 0) return "ERRNUM\n"; + return "I32OVERFLOW\n"; + } + if(shutterstate != SHUTTER_RELAX){ + add2buf(ERR); + break; + } + if(expose_shutter(Num)) add2buf(OK); + else add2buf(ERR); + break; + default: + return buf; + } } + bufputchar('\n'); return stbuf; } diff --git a/F1:F103/shutter/code/proto.h b/F1:F103/shutter/proto.h similarity index 100% rename from F1:F103/shutter/code/proto.h rename to F1:F103/shutter/proto.h diff --git a/F1:F103/shutter/code/ringbuffer.c b/F1:F103/shutter/ringbuffer.c similarity index 100% rename from F1:F103/shutter/code/ringbuffer.c rename to F1:F103/shutter/ringbuffer.c diff --git a/F1:F103/shutter/code/ringbuffer.h b/F1:F103/shutter/ringbuffer.h similarity index 100% rename from F1:F103/shutter/code/ringbuffer.h rename to F1:F103/shutter/ringbuffer.h diff --git a/F1:F103/shutter/shutter.bin b/F1:F103/shutter/shutter.bin new file mode 100755 index 0000000..2b23016 Binary files /dev/null and b/F1:F103/shutter/shutter.bin differ diff --git a/F1:F103/shutter/code/shutter.c b/F1:F103/shutter/shutter.c similarity index 63% rename from F1:F103/shutter/code/shutter.c rename to F1:F103/shutter/shutter.c index 89fb4e3..ee78e6a 100644 --- a/F1:F103/shutter/code/shutter.c +++ b/F1:F103/shutter/shutter.c @@ -27,21 +27,29 @@ static const char *states[SHUTTER_STATE_AMOUNT] = { [SHUTTER_RELAX] = "relax", [SHUTTER_PROCESS] = "process", [SHUTTER_WAIT] = "wait", + [SHUTTER_EXPOSE] = "exposing", }; +static const char *regstates[4] = {"open", "close", "off", "hiZ"}; + static const char *opcl[2] = {"closed", "opened"}; shutter_state shutterstate = SHUTTER_ERROR; +static shutter_state nextstate = SHUTTER_RELAX; -static uint32_t Tstart = 0; +static uint32_t Tstart = 0, Texp = 0, Topened = 0; -static int changestate(int open){ - if(open == CHKHALL()) return TRUE; // already opened or closed +static int changestate(int open, shutter_state nxt){ + if(open == CHKHALL()){ + shutterstate = SHUTTER_RELAX; + return TRUE; // already opened or closed + } if(getADCvoltage(CHSHTR) < SHTR_WORK_VOLTAGE / SHTRVMUL) return FALSE; if(shutterstate == SHUTTER_ERROR) return FALSE; if(open) SHTROPEN(); else SHTRCLOSE(); shutterstate = SHUTTER_PROCESS; + nextstate = nxt; Tstart = Tms; return TRUE; } @@ -51,25 +59,29 @@ static int changestate(int open){ * @return false if can't work due to error (no shutter) or insufficient voltage */ int open_shutter(){ - return changestate(1); + return changestate(1, SHUTTER_RELAX); } int close_shutter(){ - return changestate(0); + return changestate(0, SHUTTER_RELAX); +} + +int expose_shutter(uint32_t exptime){ + if(!changestate(1, SHUTTER_EXPOSE)) return FALSE; + Texp = exptime; + return TRUE; } void process_shutter(){ -#ifdef EBUG static uint32_t T = 0; -#endif uint32_t V = getADCvoltage(CHSHTR)*SHTRVMUL; switch(shutterstate){ - case SHUTTER_ERROR: + case SHUTTER_ERROR: // error state: no shutter? SHTROFF(); shutterstate = SHUTTER_WAIT; Tstart = Tms; break; - case SHUTTER_PROCESS: + case SHUTTER_PROCESS: // process opening or closing #ifdef EBUG if(T != Tms){ T = Tms; @@ -83,15 +95,28 @@ void process_shutter(){ Tstart = Tms; } break; - case SHUTTER_WAIT: + case SHUTTER_WAIT: // wait for mechanical work done if(Tms - Tstart > WAITING_TIME){ SHTRHIZ(); - shutterstate = SHUTTER_RELAX; + shutterstate = nextstate; + int h = CHKHALL(); + if(h) Topened = Tms; + else{ + USB_sendstr("exptime="); + USB_sendstr(u2str(Tms - Topened - SHUTTER_TIME)); + USB_putbyte('\n'); + } USB_sendstr("shutter="); - USB_sendstr(opcl[CHKHALL()]); + USB_sendstr(opcl[h]); USB_putbyte('\n'); } break; + case SHUTTER_EXPOSE: // wait for exposition ends to close shutter + // now Tstart is time when shutter was opened; wait until Tms - Tstart >= Texp + if(Tms - Tstart < Texp || T == Tms) break; // once per 1ms + T = Tms; + if(!close_shutter()) USB_sendstr("exp=cantclose\n"); + break; default: if(CHKFB()) shutterstate = SHUTTER_ERROR; break; @@ -102,11 +127,11 @@ void process_shutter(){ // check button only when can open/close & shutter operations done if(V >= SHTR_WORK_VOLTAGE && shutterstate == SHUTTER_RELAX){ // shutter state allows to open/close if(s){ // pressed - if(!CHKHALL()){ if(open_shutter()){oldbtnstate = s; USB_sendstr(" open, old->1\n");}} - else{USB_sendstr("pressed when CHKHALL(), old->1\n"); oldbtnstate = s;} + if(!CHKHALL()){ if(open_shutter()){oldbtnstate = s; /*USB_sendstr(" open, old->1\n");*/}} + else{/*USB_sendstr("pressed when CHKHALL(), old->1\n");*/ oldbtnstate = s;} }else{ // released - if(CHKHALL()){ if(close_shutter()){oldbtnstate = s; USB_sendstr(" close, old->0\n");}} - else{USB_sendstr("released when !CHKHALL(), old->0\n"); oldbtnstate = s;} + if(CHKHALL()){ if(close_shutter()){oldbtnstate = s; /*USB_sendstr(" close, old->0\n");*/}} + else{/*USB_sendstr("released when !CHKHALL(), old->0\n");*/ oldbtnstate = s;} } } } @@ -115,8 +140,12 @@ void print_shutter_state(){ add2buf("shutter="); if(shutterstate != SHUTTER_RELAX) add2buf(states[shutterstate]); else add2buf(opcl[CHKHALL()]); + if(CHKHALL()){ + add2buf("\nexptime="); + add2buf(u2str(Tms - Topened)); + } add2buf("\nregstate="); - bufputchar('0' + SHTRSTATE()); + add2buf(regstates[SHTRSTATE()]); add2buf("\nfbstate="); bufputchar('0' + CHKFB()); bufputchar('\n'); diff --git a/F1:F103/shutter/code/shutter.cflags b/F1:F103/shutter/shutter.cflags similarity index 100% rename from F1:F103/shutter/code/shutter.cflags rename to F1:F103/shutter/shutter.cflags diff --git a/F1:F103/shutter/code/shutter.config b/F1:F103/shutter/shutter.config similarity index 100% rename from F1:F103/shutter/code/shutter.config rename to F1:F103/shutter/shutter.config diff --git a/F1:F103/shutter/code/shutter.creator b/F1:F103/shutter/shutter.creator similarity index 100% rename from F1:F103/shutter/code/shutter.creator rename to F1:F103/shutter/shutter.creator diff --git a/F1:F103/shutter/code/shutter.creator.user b/F1:F103/shutter/shutter.creator.user similarity index 100% rename from F1:F103/shutter/code/shutter.creator.user rename to F1:F103/shutter/shutter.creator.user diff --git a/F1:F103/shutter/code/shutter.creator.user.7bd84e3 b/F1:F103/shutter/shutter.creator.user.7bd84e3 similarity index 100% rename from F1:F103/shutter/code/shutter.creator.user.7bd84e3 rename to F1:F103/shutter/shutter.creator.user.7bd84e3 diff --git a/F1:F103/shutter/code/shutter.cxxflags b/F1:F103/shutter/shutter.cxxflags similarity index 100% rename from F1:F103/shutter/code/shutter.cxxflags rename to F1:F103/shutter/shutter.cxxflags diff --git a/F1:F103/shutter/code/shutter.files b/F1:F103/shutter/shutter.files similarity index 100% rename from F1:F103/shutter/code/shutter.files rename to F1:F103/shutter/shutter.files diff --git a/F1:F103/shutter/code/shutter.h b/F1:F103/shutter/shutter.h similarity index 93% rename from F1:F103/shutter/code/shutter.h rename to F1:F103/shutter/shutter.h index 752cbbf..3c4359b 100644 --- a/F1:F103/shutter/code/shutter.h +++ b/F1:F103/shutter/shutter.h @@ -18,6 +18,8 @@ #pragma once +#include <stm32f1.h> + // opening/closing time (ms) #define SHUTTER_TIME (20) // waiting for getting status time (ms) @@ -28,6 +30,7 @@ typedef enum{ SHUTTER_RELAX, // powered off SHUTTER_PROCESS, // opened or closed SHUTTER_WAIT, // wait in off state before turn to hi-z + SHUTTER_EXPOSE, // SHUTTER_STATE_AMOUNT } shutter_state; @@ -36,4 +39,5 @@ extern shutter_state shutterstate; void process_shutter(); int open_shutter(); int close_shutter(); +int expose_shutter(uint32_t exptime); void print_shutter_state(); diff --git a/F1:F103/shutter/code/shutter.includes b/F1:F103/shutter/shutter.includes similarity index 100% rename from F1:F103/shutter/code/shutter.includes rename to F1:F103/shutter/shutter.includes diff --git a/F1:F103/shutter/code/usb.c b/F1:F103/shutter/usb.c similarity index 100% rename from F1:F103/shutter/code/usb.c rename to F1:F103/shutter/usb.c diff --git a/F1:F103/shutter/code/usb.h b/F1:F103/shutter/usb.h similarity index 100% rename from F1:F103/shutter/code/usb.h rename to F1:F103/shutter/usb.h diff --git a/F1:F103/shutter/code/usb_lib.c b/F1:F103/shutter/usb_lib.c similarity index 99% rename from F1:F103/shutter/code/usb_lib.c rename to F1:F103/shutter/usb_lib.c index b74e345..29d3c5a 100644 --- a/F1:F103/shutter/code/usb_lib.c +++ b/F1:F103/shutter/usb_lib.c @@ -131,7 +131,7 @@ _USB_LANG_ID_(LD, LANG_US); _USB_STRING_(SD, u"0.0.1"); _USB_STRING_(MD, u"Prolific Technology Inc."); _USB_STRING_(PD, u"USB-Serial Controller"); -_USB_STRING_(ID, u"shutter_emulator"); +_USB_STRING_(ID, u"shutter"); static void const *StringDescriptor[iDESCR_AMOUNT] = { [iLANGUAGE_DESCR] = &LD, [iMANUFACTURER_DESCR] = &MD, diff --git a/F1:F103/shutter/code/usb_lib.h b/F1:F103/shutter/usb_lib.h similarity index 100% rename from F1:F103/shutter/code/usb_lib.h rename to F1:F103/shutter/usb_lib.h diff --git a/F1:F103/shutter/code/usbhw.c b/F1:F103/shutter/usbhw.c similarity index 100% rename from F1:F103/shutter/code/usbhw.c rename to F1:F103/shutter/usbhw.c diff --git a/F1:F103/shutter/code/usbhw.h b/F1:F103/shutter/usbhw.h similarity index 100% rename from F1:F103/shutter/code/usbhw.h rename to F1:F103/shutter/usbhw.h diff --git a/F1:F103/shutter/version.inc b/F1:F103/shutter/version.inc new file mode 100644 index 0000000..65002d8 --- /dev/null +++ b/F1:F103/shutter/version.inc @@ -0,0 +1,2 @@ +#define BUILD_NUMBER "80" +#define BUILD_DATE "2023-09-22"