├── .gitignore ├── .gitmodules ├── LICENSE ├── README.md ├── datasheets ├── 00001692C.pdf ├── 40001882A.pdf ├── ENG_CD_292303_E12.pdf ├── NCP380-D.PDF ├── PAC1932-Data-Sheet-DS20005850C.pdf └── lp3470.pdf ├── doc ├── photo.jpg ├── screenshot.png ├── system_diagram.png └── system_diagram.xml ├── hw ├── Release │ └── R1 │ │ ├── UPM R1 Assembly.pdf │ │ ├── UPM R1 BOM.html │ │ ├── UPM R1 Design.zip │ │ ├── UPM R1 Gerber.zip │ │ ├── UPM R1 Schematics.pdf │ │ └── UPM R1 render.png ├── upm-cache.lib ├── upm.kicad_pcb ├── upm.net ├── upm.pro └── upm.sch └── sw ├── .gdbinit ├── Makefile ├── i2c.c ├── i2c.h ├── init.c ├── link.lds ├── main.c ├── pac193x.c ├── pac193x.h ├── protocol.h ├── samd21.h ├── string.c ├── tools └── upm │ ├── 30-upm.rules │ ├── Makefile │ ├── README.md │ ├── gui.txt │ └── upm.c ├── upm.h ├── usb.c └── usb.h /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.bak 3 | *.kicad_pcb-bak 4 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "sw/CMSIS"] 2 | path = sw/CMSIS 3 | url = https://github.com/ARM-software/CMSIS.git 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | UPM 2 | 3 | SPDX-License-Identifier: BSD-3-Clause 4 | 5 | Copyright 2018, Jonas Persson 6 | 7 | Redistribution and use in source and binary forms, with or without modification, 8 | are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above copyright notice, 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | 17 | 3. Neither the name of the copyright holder nor the names of its contributors 18 | may be used to endorse or promote products derived from this software 19 | without specific prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 23 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 25 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 27 | GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 29 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | 33 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## UPM - USB Power Monitor 2 | 3 | This device monitors current and voltage for USB powered devices. 4 | 5 | # Hardware 6 | ![](https://github.com/jonpe960/upm/raw/master/doc/photo.jpg) 7 | Assembled PCB 8 | 9 | The PCB is a four layer board, manufactured by OSH Park. The boards can 10 | be ordered [here](https://oshpark.com/shared_projects/uE5lZDkP) 11 | 12 | Schematics, layout and BOM can be found [here](https://github.com/jonpe960/upm/tree/master/hw/Release/R1) 13 | 14 | # System description 15 | ![](https://github.com/jonpe960/upm/raw/master/doc/system_diagram.png) 16 | 17 | 18 | The device has a built in, two port, USB hub. One of the down stream ports 19 | connects to the USB A connector and the other down stream port is connected to 20 | the microcontroller. 21 | 22 | An integrade analog frontend that contains a 16 bit ADC and differential 23 | amplifier measures the voltage and current of the down stream VBUS supply. Three 24 | auxillary diff inputs are available on a pin header. 25 | 26 | It is possible to control the output VBUS with the on board power switch, which 27 | also has built in short circuit protection. Three auxillary, open collector, 28 | outputs are available on pin header. 29 | 30 | # Ncurses TUI 31 | 32 | ![](https://github.com/jonpe960/upm/raw/master/doc/screenshot.png) 33 | 34 | The ncurses based TUI, displaying voltage, current and energy usage. 35 | Outputs can be controled from the TUI: 36 | - A/a VBUS on/off 37 | - S/s out1 on/off 38 | - D/d out2 on/off 39 | - F/f out3 on/off 40 | - r Reset energy counters 41 | 42 | 43 | # Intended usage 44 | 45 | This project came from a need to remotley monitor and power cycle USB powered devices. 46 | 47 | # Future improvements 48 | 49 | - Add domain/tcp socket listener for remote control 50 | - Support for logging 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /datasheets/00001692C.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonasblixt/upm/e9040a0f5c13927e5bcb483ef60ee49691a7b079/datasheets/00001692C.pdf -------------------------------------------------------------------------------- /datasheets/40001882A.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonasblixt/upm/e9040a0f5c13927e5bcb483ef60ee49691a7b079/datasheets/40001882A.pdf -------------------------------------------------------------------------------- /datasheets/ENG_CD_292303_E12.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonasblixt/upm/e9040a0f5c13927e5bcb483ef60ee49691a7b079/datasheets/ENG_CD_292303_E12.pdf -------------------------------------------------------------------------------- /datasheets/NCP380-D.PDF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonasblixt/upm/e9040a0f5c13927e5bcb483ef60ee49691a7b079/datasheets/NCP380-D.PDF -------------------------------------------------------------------------------- /datasheets/PAC1932-Data-Sheet-DS20005850C.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonasblixt/upm/e9040a0f5c13927e5bcb483ef60ee49691a7b079/datasheets/PAC1932-Data-Sheet-DS20005850C.pdf -------------------------------------------------------------------------------- /datasheets/lp3470.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonasblixt/upm/e9040a0f5c13927e5bcb483ef60ee49691a7b079/datasheets/lp3470.pdf -------------------------------------------------------------------------------- /doc/photo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonasblixt/upm/e9040a0f5c13927e5bcb483ef60ee49691a7b079/doc/photo.jpg -------------------------------------------------------------------------------- /doc/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonasblixt/upm/e9040a0f5c13927e5bcb483ef60ee49691a7b079/doc/screenshot.png -------------------------------------------------------------------------------- /doc/system_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonasblixt/upm/e9040a0f5c13927e5bcb483ef60ee49691a7b079/doc/system_diagram.png -------------------------------------------------------------------------------- /doc/system_diagram.xml: -------------------------------------------------------------------------------- 1 | 5Vpdc5s4FP01fmwGJMD2Y2wnm512p57JpNvuy45iFNAWI0bItb2/fiUjAUI4IbUxaTYz8UjXkhD3nPuhK4/gfL37jaEs/oOGOBkBJ9yN4GIEwNR3xKcU7AuBP4WFIGIkLERuJbgn/2IlVPOiDQlxbgzklCacZKZwRdMUr7ghQ4zRrTnsiSbmUzMUYUtwv0KJLf2ThDwupBP9WlJ+h0kU6ye7jvpmjfRgJchjFNJtTQRvRnDOKOVFa72b40TqTuulmHd75NtyYwynvMuExWySUyda0o/OArl/zfLPH+MPvtob3+sXxqF4f9WljMc0oilKbirpjNFNGmK5qiN6MV8noumKJt4R/rXW/iaHXAFfdP/BnO8VumjDqRBVi3+iNFPTiu3IPRx9SyXK6Yat8DOvptmCWIT5M+O8EgvBYUzXmLO9mMdwgjj5Ye4DKTZF5bhK4aKhdP4K/Y/71//4NfoXWmb7r/VODcQBwAlOBEdNXVIidggc5ZU8baTKKYGpYy5R7EvNqiC+Zgzta8MyOSDv/hx33DDRl/ZljheNYgcV30qd/DwFlfZ+oGSj9PlwL6B27h7EZ5AIdGaPTLQiXlKgRleTjNuYcHyfoQP2WxEQTIKqJ2HG8e55CtmQqwlCR4aKJqq7rZyzqz1uXHfMoAHx2UwYntWEtf05LfY3gBMFHe30CGiXcaLAZnCWc4bRWkgLMi+FogbnboO6Xlfqen1R1zti+vMimaJscJWNGx4x6Kozpy+dgV5CtnPl14K26QmKCF46g+LL8Fomt6L7mNDV90J0SxK97gCuIujoKsCgCVdgUX4ztwB9gdcoz4qjxhPZSVD7iGvdvUNvgW1iqWpBt+lBU8q3upbmhAK4qSwxmH7Hc5oIbwIXKU2lPTwJpjZEKCFRKroroTAs5DOpTiIOYtfqizUJw4MxtaFjGtgZ8IATE49pCxxuCxy9oTF9EQ3w/0HD9YeGw7WTDv/LCIjFnC+zh/v3C0XTUUEbieCiQFyghKFj8xIzInYtUagS9GPZei1GKySrEO0MVBKBHWP0oCHaDXrJsF6HaFv941dGFJyI6E/VP9ygNXvvt5wxeQPsKQmjCfSLs8cdD0Ef34eXpw+04rrFJx2AP6FHnCxpTjihMhA/Us7pWoZ2XeqXuIYoj0tqWcG8HvBHAD4d/kwONuM9l1RQ6YO+k3CLp2Zyh+tdJK9irnAiTilMzrxiOCe5OM/nZetvcJ50wG+kA22JmXPRfGDai/2rQ7h2AaaxT6EZLbzS+G0P8facwLirE4BDOIEAmk5A55/9eoGx5QWuBQA0ErJbRoXtpqFFs0vXxnzYoWQAL1oy0C/xnPesmcAqQXlOVgdvhhi3xR0q46VdHrn5OqOldK1wHYuWNVz8Fli07OTLLYMVHmyAXbymdbdlrTNtnPMmjXWO3JGdywQ1c2pU+h3Ypbp3c6729EFW69u1rdm7ZCAFvRysdWbcVulunLne6JELeCe6gZ7jZdCsz/j9x0tg3yQtSXpgKgqFcZ0UKhnlSGXY0zMZm6WkltDZWsYKerM2+2Jifjc6lNidD+LfvmV+N54vaBR32+70xxf1fPbNx+cMSzqvaJKoi1GHbni24Rqid4yPB8zI5LVEJvdMAIlu9Yu4wjtVPyuEN/8B -------------------------------------------------------------------------------- /hw/Release/R1/UPM R1 Assembly.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonasblixt/upm/e9040a0f5c13927e5bcb483ef60ee49691a7b079/hw/Release/R1/UPM R1 Assembly.pdf -------------------------------------------------------------------------------- /hw/Release/R1/UPM R1 BOM.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | KiCad BOM Example 5 8 | 9 | 10 |

C:\Users\jonas.persson\Desktop\upm\hw\upm.sch

11 |

2018-09-14 12:27:19

12 |

Eeschema (5.0.0)

13 |

Component Count:72

14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 |
DesignatorQntyNameDescriptionManufacturerPart Number
C1, C2, C24, C254C0402_12p_25Vdc_C0G_2Ceramic Capacitor 12pF, 25Vdc, ±5%, C0GMurataGRM1555C1E120JA01
C3, C6, C183C0402_100n_25Vdc_X7RCeramic Capacitor 0.10uF, 25Vdc, ±10%, X7RMurataGRM155R71E104KE14
C4, C5, C7, C8, C9, C10, C11, C12, C13, C14, C15, C17, C19, C20, C22, C2716C0402_1u_6.3Vdc_X7RCeramic Capacitor 1.0uF, 6.3Vdc, ±10%, X7RMurataGRM155R70J105KA12
C16, C21, C23, C264C0603_10u_10Vdc_X7RCeramic Capacitor 10uF, 10Vdc, ±20%, X7RMurataGRM188Z71A106MA73
C281PCAP_120u_4120µF, ±20%, 10V, 27 mOhm, 5000 Hrs @ 105°C, -55°C ~ 105°C, 2.3ANichiconPCS1A121MCL1GS
C29, C30, C313C0603_22n_100Vdc_X7RCeramic Capacitor 22000pF, 100Vdc, ±10%, X7RMurataGRM188R72A223KAC4
FB11BL0603_BLM18BB121SN1DFERRITE CHIP 120 OHM 500MA 0603,84870,0DCR: 300 mOhm MaxMurataBLM18BB121SN1D
J11FTSH-105-01-F-DV-KSamtecFTSH-105-01-F-DV-K.stp
J21USB_A_292303-1TE292303-1
J31DX4R005JJ2R1800JAEDX4R005JJ2R1800
J41TFM-105-02-S-D-WTSamtecTFM-105-02-S-D-WT
L11IHLP1212_1u_11µH, ±20%, I=5A, I_sat=4.5A, DCR=24 mOhm Max, Self resonance: 75MHz, -55°C ~ 125°C, 0.144 L x 0.118 W (3.65mm x 3.00mm)VishayIHLP1212BZER1R0M11
Q1, Q22PUMH13NexperiaPUMH13,115
R1, R122R0402_100R100, ±1%, 0.063WVishayCRCW0402100RFKED
R2, R3, R4, R6, R7, R8, R11, R13, R14, R15, R2311R0402_46k4046.4k, ±1%, 0.063WVishayCRCW040246K4FKED
R51R0402_12k1012.1k, ±1%, 0.063WVishayCRCW040212K1FKED
R9, R102R0402_2k202.2k, ±1%, 0.063WVishayCRCW04022K20FKED
R161R0402_21k21k, ±1%, 0.063WVishayCRCW040221K0FKED
R171R0603_200R200, ±1%, 0.1WVishayCRCW0603200RFKEA
R18, R19, R203R0603_51R51, ±1%, 0.1WVishayCRCW060351R0FKEA
R211R0402_1k1k, ±1%, 0.063WVishayCRCW04021K00FKED
R221R0805_0R1SamsungRUT2012FR100CS
U11ATSAMD21E15BMicrochipATSAMD21E15B-MUT
U21MIC23150-SYMTMicrochipMIC23150-SYMT
U31USB2512BMicrochipUSB2512Bi-AEZG
U41PAC1934MicrochipPAC1934T-I/JQ
U51LP3470IM5X-3.08_NOPBTILP3470IM5X-3.08/NOPB
U61NCP380HSNAJAAT1GONSemiNCP380HSNAJAAT1G
U7, U82USBLC6-4STUSBLC6-4SC6Y
X11NX2520SA-24.000000MHZf=24MHz, Stability:±10ppm, Tol:±10ppm,Load capacitance:10pF,esr:70 Ohm,Temp:-10°C ~ 60°CNDKNX2520SA-24.000000MHZ
X21NX2520SA-16.000000MHZf=16MHz, Stability:±10ppm, Tol:±10ppm,Load capacitance:10pF,esr:80 Ohm,Temp:-10°C ~ 60°CNDKNX2520SA-16.000000MHZ
48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /hw/Release/R1/UPM R1 Design.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonasblixt/upm/e9040a0f5c13927e5bcb483ef60ee49691a7b079/hw/Release/R1/UPM R1 Design.zip -------------------------------------------------------------------------------- /hw/Release/R1/UPM R1 Gerber.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonasblixt/upm/e9040a0f5c13927e5bcb483ef60ee49691a7b079/hw/Release/R1/UPM R1 Gerber.zip -------------------------------------------------------------------------------- /hw/Release/R1/UPM R1 Schematics.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonasblixt/upm/e9040a0f5c13927e5bcb483ef60ee49691a7b079/hw/Release/R1/UPM R1 Schematics.pdf -------------------------------------------------------------------------------- /hw/Release/R1/UPM R1 render.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonasblixt/upm/e9040a0f5c13927e5bcb483ef60ee49691a7b079/hw/Release/R1/UPM R1 render.png -------------------------------------------------------------------------------- /hw/upm-cache.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.4 2 | #encoding utf-8 3 | # 4 | # beads_BLM:BL0603_BLM18BB121SN1D 5 | # 6 | DEF ~beads_BLM:BL0603_BLM18BB121SN1D FB 0 10 N Y 1 F N 7 | F0 "FB" 0 150 39 H V L CNN 8 | F1 "beads_BLM:BL0603_BLM18BB121SN1D" 6 -85 40 H I L CNN 9 | F2 "L0603" 38 -150 30 H I C CNN 10 | F3 "" 0 0 60 H V C CNN 11 | F4 "FERRITE CHIP 120 OHM 500MA 0603,84870,0DCR: 300 mOhm Max" 100 200 60 H I C CNN "Description" 12 | F5 "BLM18BB121SN1D" 100 200 60 H I C CNN "Part Number" 13 | F6 "Murata" 100 200 60 H I C CNN "Manufacturer" 14 | F7 "120 Ohm @ 100MHz" 100 100 39 H V C CNN "Impedance" 15 | $FPLIST 16 | L0603 17 | $ENDFPLIST 18 | DRAW 19 | A -150 0 50 1 1799 0 1 0 N -100 0 -200 0 20 | A -50 0 50 1 1799 0 1 0 N 0 0 -100 0 21 | A 0 0 0 0 0 0 1 0 N 0 0 0 0 22 | A 50 0 50 1 1799 0 1 0 N 100 0 0 0 23 | A 150 0 50 1 1799 0 1 0 N 200 0 100 0 24 | S -225 75 225 -50 0 1 0 N 25 | X 1 1 -350 0 150 R 40 40 1 1 P 26 | X 2 2 350 0 150 L 40 40 1 1 P 27 | ENDDRAW 28 | ENDDEF 29 | # 30 | # capacitors_murata_GRM:C0402_100n_25Vdc_X7R 31 | # 32 | DEF ~capacitors_murata_GRM:C0402_100n_25Vdc_X7R C 0 10 N Y 1 F N 33 | F0 "C" 0 150 39 H V L CNN 34 | F1 "capacitors_murata_GRM:C0402_100n_25Vdc_X7R" 6 -85 40 H I L CNN 35 | F2 "C0402" 38 -150 30 H I C CNN 36 | F3 "" 0 0 60 H V C CNN 37 | F4 "0.10uF, 25Vdc, ±10%, X7R" 100 200 60 H I C CNN "Description" 38 | F5 "GRM155R71E104KE14" 100 200 60 H I C CNN "Part Number" 39 | F6 "Murata" 100 200 60 H I C CNN "Manufacturer" 40 | F7 "0.10uF" 100 100 39 H V C CNN "Capacitance" 41 | $FPLIST 42 | C0402 43 | $ENDFPLIST 44 | DRAW 45 | P 2 0 1 20 -80 -30 80 -30 N 46 | P 2 0 1 20 -80 30 80 30 N 47 | X ~ 1 0 200 170 D 40 40 1 1 P 48 | X ~ 2 0 -200 170 U 40 40 1 1 P 49 | ENDDRAW 50 | ENDDEF 51 | # 52 | # capacitors_murata_GRM:C0402_12p_25Vdc_C0G_2 53 | # 54 | DEF ~capacitors_murata_GRM:C0402_12p_25Vdc_C0G_2 C 0 10 N Y 1 F N 55 | F0 "C" 0 150 39 H V L CNN 56 | F1 "capacitors_murata_GRM:C0402_12p_25Vdc_C0G_2" 6 -85 40 H I L CNN 57 | F2 "C0402" 38 -150 30 H I C CNN 58 | F3 "" 0 0 60 H V C CNN 59 | F4 "12pF, 25Vdc, ±5%, C0G" 100 200 60 H I C CNN "Description" 60 | F5 "GRM1555C1E120JA01" 100 200 60 H I C CNN "Part Number" 61 | F6 "Murata" 100 200 60 H I C CNN "Manufacturer" 62 | F7 "12pF" 100 100 39 H V C CNN "Capacitance" 63 | $FPLIST 64 | C0402 65 | $ENDFPLIST 66 | DRAW 67 | P 2 0 1 20 -80 -30 80 -30 N 68 | P 2 0 1 20 -80 30 80 30 N 69 | X ~ 1 0 200 170 D 40 40 1 1 P 70 | X ~ 2 0 -200 170 U 40 40 1 1 P 71 | ENDDRAW 72 | ENDDEF 73 | # 74 | # capacitors_murata_GRM:C0402_1u_6.3Vdc_X7R 75 | # 76 | DEF ~capacitors_murata_GRM:C0402_1u_6.3Vdc_X7R C 0 10 N Y 1 F N 77 | F0 "C" 0 150 39 H V L CNN 78 | F1 "capacitors_murata_GRM:C0402_1u_6.3Vdc_X7R" 6 -85 40 H I L CNN 79 | F2 "C0402" 38 -150 30 H I C CNN 80 | F3 "" 0 0 60 H V C CNN 81 | F4 "1.0uF, 6.3Vdc, ±10%, X7R" 100 200 60 H I C CNN "Description" 82 | F5 "GRM155R70J105KA12" 100 200 60 H I C CNN "Part Number" 83 | F6 "Murata" 100 200 60 H I C CNN "Manufacturer" 84 | F7 "1.0uF" 100 100 39 H V C CNN "Capacitance" 85 | $FPLIST 86 | C0402 87 | $ENDFPLIST 88 | DRAW 89 | P 2 0 1 20 -80 -30 80 -30 N 90 | P 2 0 1 20 -80 30 80 30 N 91 | X ~ 1 0 200 170 D 40 40 1 1 P 92 | X ~ 2 0 -200 170 U 40 40 1 1 P 93 | ENDDRAW 94 | ENDDEF 95 | # 96 | # capacitors_murata_GRM:C0603_10u_10Vdc_X7R 97 | # 98 | DEF ~capacitors_murata_GRM:C0603_10u_10Vdc_X7R C 0 10 N Y 1 F N 99 | F0 "C" 0 150 39 H V L CNN 100 | F1 "capacitors_murata_GRM:C0603_10u_10Vdc_X7R" 6 -85 40 H I L CNN 101 | F2 "C0603" 38 -150 30 H I C CNN 102 | F3 "" 0 0 60 H V C CNN 103 | F4 "10uF, 10Vdc, ±20%, X7R" 100 200 60 H I C CNN "Description" 104 | F5 "GRM188Z71A106MA73" 100 200 60 H I C CNN "Part Number" 105 | F6 "Murata" 100 200 60 H I C CNN "Manufacturer" 106 | F7 "10uF" 100 100 39 H V C CNN "Capacitance" 107 | $FPLIST 108 | C0603 109 | $ENDFPLIST 110 | DRAW 111 | P 2 0 1 20 -80 -30 80 -30 N 112 | P 2 0 1 20 -80 30 80 30 N 113 | X ~ 1 0 200 170 D 40 40 1 1 P 114 | X ~ 2 0 -200 170 U 40 40 1 1 P 115 | ENDDRAW 116 | ENDDEF 117 | # 118 | # capacitors_murata_GRM:C0603_22n_100Vdc_X7R 119 | # 120 | DEF ~capacitors_murata_GRM:C0603_22n_100Vdc_X7R C 0 10 N Y 1 F N 121 | F0 "C" 0 150 39 H V L CNN 122 | F1 "capacitors_murata_GRM:C0603_22n_100Vdc_X7R" 6 -85 40 H I L CNN 123 | F2 "C0603" 38 -150 30 H I C CNN 124 | F3 "" 0 0 60 H V C CNN 125 | F4 "22000pF, 100Vdc, ±10%, X7R" 100 200 60 H I C CNN "Description" 126 | F5 "GRM188R72A223KAC4" 100 200 60 H I C CNN "Part Number" 127 | F6 "Murata" 100 200 60 H I C CNN "Manufacturer" 128 | F7 "22000pF" 100 100 39 H V C CNN "Capacitance" 129 | $FPLIST 130 | C0603 131 | $ENDFPLIST 132 | DRAW 133 | P 2 0 1 20 -80 -30 80 -30 N 134 | P 2 0 1 20 -80 30 80 30 N 135 | X ~ 1 0 200 170 D 40 40 1 1 P 136 | X ~ 2 0 -200 170 U 40 40 1 1 P 137 | ENDDRAW 138 | ENDDEF 139 | # 140 | # comm:USB2512B 141 | # 142 | DEF comm:USB2512B U 0 40 Y Y 1 F N 143 | F0 "U" 50 3100 60 H V C CNN 144 | F1 "comm:USB2512B" 250 -50 60 H V C CNN 145 | F2 "footprints:QFN-36-1EP_6x6mm_Pitch0.5mm" 500 3450 60 H I C CNN 146 | F3 "" 50 3100 60 H I C CNN 147 | F4 "Microchip" 500 3650 60 H I C CNN "Manufacturer" 148 | F5 "USB2512Bi-AEZG" 500 3550 60 H I C CNN "Part Number" 149 | DRAW 150 | S 0 3050 1750 0 0 1 0 N 151 | X USBDM_DN1 1 1950 2050 200 L 50 50 1 1 B 152 | X VDDA33_2 10 1950 2550 200 L 50 50 1 1 W 153 | X TEST 11 -200 1600 200 R 50 50 1 1 I 154 | X PRTPWR1/BC_EN1 12 -200 2300 200 R 50 50 1 1 I 155 | X OCS1_N 13 -200 2500 200 R 50 50 1 1 I 156 | X CRFILT 14 -200 200 200 R 50 50 1 1 P 157 | X VDD33_3 15 1950 2650 200 L 50 50 1 1 W 158 | X PRTPWR2_BC_EN2 16 -200 2200 200 R 50 50 1 1 I 159 | X OCS2_N 17 -200 2400 200 R 50 50 1 1 I 160 | X NC_18 18 1950 550 200 L 50 50 1 1 N 161 | X NC_19 19 1950 450 200 L 50 50 1 1 N 162 | X USBDP_DN1 2 1950 2150 200 L 50 50 1 1 B 163 | X NC_20 20 1950 350 200 L 50 50 1 1 N 164 | X NC_21 21 1950 250 200 L 50 50 1 1 N 165 | X SDA 22 1950 1500 200 L 50 50 1 1 B 166 | X VDD33_4 23 1950 2750 200 L 50 50 1 1 W 167 | X SCL/CFG_SEL0 24 1950 1400 200 L 50 50 1 1 B 168 | X HS_IND/CFG_SEL1 25 1950 1300 200 L 50 50 1 1 B 169 | X RESET_N 26 -200 1800 200 R 50 50 1 1 I 170 | X VBUS_DET 27 -200 2700 200 R 50 50 1 1 I 171 | X SUSP_IND 28 -200 1700 200 R 50 50 1 1 I 172 | X VDD33_5 29 1950 2850 200 L 50 50 1 1 W 173 | X USBDM_DN2 3 1950 1750 200 L 50 50 1 1 B 174 | X USBDM_UP 30 -200 2850 200 R 50 50 1 1 B 175 | X USBDP_UP 31 -200 2950 200 R 50 50 1 1 B 176 | X XTALOUT 32 -200 450 200 R 50 50 1 1 O 177 | X XTALIN 33 -200 350 200 R 50 50 1 1 I 178 | X PLLFILT 34 -200 100 200 R 50 50 1 1 P 179 | X RBIAS 35 1950 1100 200 L 50 50 1 1 P 180 | X VDDA33_6 36 1950 2950 200 L 50 50 1 1 W 181 | X GND_EP 37 1950 100 200 L 50 50 1 1 w 182 | X USBDP_DN2 4 1950 1850 200 L 50 50 1 1 B 183 | X VDDA33_1 5 1950 2450 200 L 50 50 1 1 W 184 | X NC_6 6 1950 950 200 L 50 50 1 1 N 185 | X NC_7 7 1950 850 200 L 50 50 1 1 N 186 | X NC_8 8 1950 750 200 L 50 50 1 1 N 187 | X NC_9 9 1950 650 200 L 50 50 1 1 N 188 | ENDDRAW 189 | ENDDEF 190 | # 191 | # connectors:DX4R005JJ2R1800 192 | # 193 | DEF connectors:DX4R005JJ2R1800 J 0 40 Y Y 1 F N 194 | F0 "J" 150 950 60 H V C CNN 195 | F1 "connectors:DX4R005JJ2R1800" 200 -50 60 H V C CNN 196 | F2 "USB_Micro-B" 150 1300 60 H I C CNN 197 | F3 "" -250 100 60 H V C CNN 198 | F4 "JAE" 150 1500 50 H I C CNN "Manufacturer" 199 | F5 "DX4R005JJ2R1800" 150 1400 50 H I C CNN "Part Number" 200 | DRAW 201 | T 0 75 500 31 0 0 0 D+ Normal 0 C C 202 | T 0 75 600 31 0 0 0 D- Normal 0 C C 203 | T 0 75 300 31 0 0 0 GND Normal 0 C C 204 | T 0 75 400 31 0 0 0 OTG Normal 0 C C 205 | T 0 75 700 31 0 0 0 VBUS Normal 0 C C 206 | S 150 275 175 225 0 1 0 N 207 | S 150 375 175 325 0 1 0 N 208 | S 150 475 175 425 0 1 0 N 209 | S 150 575 175 525 0 1 0 N 210 | S 150 675 175 625 0 1 0 N 211 | S 200 700 150 200 0 1 0 N 212 | P 2 0 1 0 0 250 150 250 N 213 | P 2 0 1 0 0 350 150 350 N 214 | P 2 0 1 0 0 450 150 450 N 215 | P 2 0 1 0 0 550 150 550 N 216 | P 2 0 1 0 0 650 150 650 N 217 | P 2 0 1 0 0 800 0 100 N 218 | P 6 0 1 0 0 800 100 900 250 900 250 0 100 0 0 100 N 219 | X ~ 1 -200 650 200 R 50 50 1 1 B 220 | X ~ 2 -200 550 200 R 50 50 1 1 B 221 | X ~ 3 -200 450 200 R 50 50 1 1 B 222 | X ~ 4 -200 350 200 R 50 50 1 1 B 223 | X ~ 5 -200 250 200 R 50 50 1 1 B 224 | X ~ 6 -200 100 200 R 50 50 1 1 B 225 | X ~ 7 -200 800 200 R 50 50 1 1 B 226 | ENDDRAW 227 | ENDDEF 228 | # 229 | # connectors:FTSH-105-01-F-DV-K 230 | # 231 | DEF connectors:FTSH-105-01-F-DV-K J 0 40 Y Y 1 F N 232 | F0 "J" -50 300 50 H V C CNN 233 | F1 "connectors:FTSH-105-01-F-DV-K" 0 -300 50 H V C CNN 234 | F2 "Jonas:FTSH-105-01-F-DV-K" 100 600 50 H I C CNN 235 | F3 "" 0 0 50 H I C CNN 236 | F4 "Samtec" 50 400 50 H I C CNN "Manufacturer" 237 | F5 "FTSH-105-01-F-DV-K.stp" 150 500 50 H I C CNN "Part Number" 238 | DRAW 239 | S -100 -250 100 250 0 1 0 N 240 | S -100 50 -50 -50 0 1 0 N 241 | X ~ 1 -300 200 200 R 50 50 1 1 P 242 | X ~ 10 300 -200 200 L 50 50 1 1 P 243 | X ~ 2 300 200 200 L 50 50 1 1 P 244 | X ~ 3 -300 100 200 R 50 50 1 1 P 245 | X ~ 4 300 100 200 L 50 50 1 1 P 246 | X ~ 5 -300 0 200 R 50 50 1 1 P 247 | X ~ 6 300 0 200 L 50 50 1 1 P 248 | X ~ 7 -300 -100 200 R 50 50 1 1 P 249 | X ~ 8 300 -100 200 L 50 50 1 1 P 250 | X ~ 9 -300 -200 200 R 50 50 1 1 P 251 | ENDDRAW 252 | ENDDEF 253 | # 254 | # connectors:TFM-105-02-S-D-WT 255 | # 256 | DEF connectors:TFM-105-02-S-D-WT J 0 40 Y Y 1 F N 257 | F0 "J" 250 850 60 H V C CNN 258 | F1 "connectors:TFM-105-02-S-D-WT" 850 -100 60 H V C CNN 259 | F2 "TFM-105-02-S-D-WT" 800 1200 60 H I C CNN 260 | F3 "" 0 0 60 H V C CNN 261 | F4 "Samtec" 350 950 50 H I C CNN "Manufacturer" 262 | F5 "TFM-105-02-S-D-WT" 450 1050 50 H I C CNN "Part Number" 263 | DRAW 264 | S 0 800 300 0 0 1 0 N 265 | S 100 0 200 50 0 1 0 N 266 | S 100 800 200 750 0 1 0 N 267 | S 300 150 250 50 0 1 0 N 268 | X 1 1 -200 600 200 R 50 50 1 1 B 269 | X 10 10 500 200 200 L 50 50 1 1 B 270 | X 11 11 150 1000 200 D 50 50 1 1 B 271 | X 12 12 150 -200 200 U 50 50 1 1 B 272 | X 2 2 500 600 200 L 50 50 1 1 B 273 | X 3 3 -200 500 200 R 50 50 1 1 B 274 | X 4 4 500 500 200 L 50 50 1 1 B 275 | X 5 5 -200 400 200 R 50 50 1 1 B 276 | X 6 6 500 400 200 L 50 50 1 1 B 277 | X 7 7 -200 300 200 R 50 50 1 1 B 278 | X 8 8 500 300 200 L 50 50 1 1 B 279 | X 9 9 -200 200 200 R 50 50 1 1 B 280 | ENDDRAW 281 | ENDDEF 282 | # 283 | # connectors:USB_A_292303-1 284 | # 285 | DEF connectors:USB_A_292303-1 J 0 40 Y N 1 F N 286 | F0 "J" 50 600 60 H V C CNN 287 | F1 "connectors:USB_A_292303-1" 400 -75 60 H V C CNN 288 | F2 "USB_A_TH" -50 500 60 H I C CNN 289 | F3 "" 0 0 60 H I C CNN 290 | F4 "TE" 150 700 60 H I C CNN "Manufacturer" 291 | F5 "292303-1" 250 800 60 H I C CNN "Part Number" 292 | DRAW 293 | S 0 500 175 0 0 1 0 N 294 | S 100 75 75 125 0 1 0 N 295 | S 100 175 75 225 0 1 0 N 296 | S 100 275 75 325 0 1 0 N 297 | S 100 375 75 425 0 1 0 N 298 | S 100 450 150 50 0 1 0 N 299 | S 150 0 50 -25 0 1 0 N 300 | S 150 500 50 525 0 1 0 N 301 | S 175 475 200 25 0 1 0 N 302 | X 1 1 -200 400 200 R 50 50 1 1 P 303 | X 2 2 -200 300 200 R 50 50 1 1 P 304 | X 3 3 -200 200 200 R 50 50 1 1 P 305 | X 4 4 -200 100 200 R 50 50 1 1 P 306 | X SH1 5 -200 0 200 R 50 50 1 1 P 307 | X SH2 6 -200 500 200 R 50 50 1 1 P 308 | ENDDRAW 309 | ENDDEF 310 | # 311 | # cpu:ATSAMD21E15B 312 | # 313 | DEF cpu:ATSAMD21E15B U 0 40 Y Y 1 F N 314 | F0 "U" 50 2650 60 H V C CNN 315 | F1 "cpu:ATSAMD21E15B" 350 -50 60 H V C CNN 316 | F2 "footprints:QFN-32-1EP_5x5mm_Pitch0.5mm" 500 2850 60 H I C CNN 317 | F3 "" 0 0 60 H I C CNN 318 | F4 "Microchip" 500 3150 60 H I C CNN "Manufacturer" 319 | F5 "ATSAMD21E15B-MUT" 550 3000 60 H I C CNN "Part Number" 320 | DRAW 321 | S 0 2600 750 0 0 1 0 N 322 | X PA00 1 950 2550 200 L 50 50 1 1 B 323 | X GND 10 -200 250 200 R 50 50 1 1 w 324 | X PA08 11 950 1750 200 L 50 50 1 1 B 325 | X PA09 12 950 1650 200 L 50 50 1 1 B 326 | X PA10 13 950 1550 200 L 50 50 1 1 B 327 | X PA11 14 950 1450 200 L 50 50 1 1 B 328 | X PA14 15 950 1350 200 L 50 50 1 1 B 329 | X PA15 16 950 1250 200 L 50 50 1 1 B 330 | X PA16 17 950 1150 200 L 50 50 1 1 B 331 | X PA17 18 950 1050 200 L 50 50 1 1 B 332 | X PA18 19 950 950 200 L 50 50 1 1 B 333 | X PA01 2 950 2450 200 L 50 50 1 1 B 334 | X PA19 20 950 850 200 L 50 50 1 1 B 335 | X PA22 21 950 750 200 L 50 50 1 1 B 336 | X PA23 22 950 650 200 L 50 50 1 1 B 337 | X PA24 23 950 550 200 L 50 50 1 1 B 338 | X PA25 24 950 450 200 L 50 50 1 1 B 339 | X PA27 25 950 350 200 L 50 50 1 1 B 340 | X RESET_N 26 -200 2250 200 R 50 50 1 1 I 341 | X PA28 27 950 250 200 L 50 50 1 1 B 342 | X GND 28 -200 150 200 R 50 50 1 1 w 343 | X VDDCORE 29 -200 2150 200 R 50 50 1 1 P 344 | X PA02 3 950 2350 200 L 50 50 1 1 B 345 | X VDDIN 30 -200 2550 200 R 50 50 1 1 W 346 | X PA30 31 950 150 200 L 50 50 1 1 B 347 | X PA31 32 950 50 200 L 50 50 1 1 B 348 | X GND_EP 33 -200 50 200 R 50 50 1 1 w 349 | X PA03 4 950 2250 200 L 50 50 1 1 B 350 | X PA04 5 950 2150 200 L 50 50 1 1 B 351 | X PA05 6 950 2050 200 L 50 50 1 1 B 352 | X PA06 7 950 1950 200 L 50 50 1 1 B 353 | X PA07 8 950 1850 200 L 50 50 1 1 B 354 | X VDDANA 9 -200 2450 200 R 50 50 1 1 W 355 | ENDDRAW 356 | ENDDEF 357 | # 358 | # dcdc:MIC23150-SYMT 359 | # 360 | DEF dcdc:MIC23150-SYMT U 0 40 Y Y 1 F N 361 | F0 "U" 100 650 79 H V C CNN 362 | F1 "dcdc:MIC23150-SYMT" 500 -100 79 H V C CNN 363 | F2 "DFN-8_2x2mm_Pitch0.5mm" 450 1150 79 H I C CNN 364 | F3 "" 100 650 79 H I C CNN 365 | F4 "MIC23150-SYMT" 200 750 79 H I C CNN "Part Number" 366 | F5 "Microchip" 300 850 79 H I C CNN "Manufacturer" 367 | DRAW 368 | T 0 300 250 50 0 1 0 3.3V Normal 0 C C 369 | S 0 550 700 0 1 1 0 N 370 | X SW_1 1 900 500 200 L 50 50 1 1 w 371 | X SW_2 2 900 400 200 L 50 50 1 1 w 372 | X EN 3 -200 50 200 R 50 50 1 1 I 373 | X SNS 4 900 300 200 L 50 50 1 1 I 374 | X AGND 5 900 150 200 L 50 50 1 1 w 375 | X VIN_6 6 -200 500 200 R 50 50 1 1 W 376 | X VIN_7 7 -200 400 200 R 50 50 1 1 W 377 | X PGND 8 900 50 200 L 50 50 1 1 w 378 | ENDDRAW 379 | ENDDEF 380 | # 381 | # esd:USBLC6-4 382 | # 383 | DEF esd:USBLC6-4 U 0 40 Y Y 1 F N 384 | F0 "U" 50 350 60 H V C CNN 385 | F1 "esd:USBLC6-4" 250 -50 60 H V C CNN 386 | F2 "SOT-23-6" 300 650 60 H I C CNN 387 | F3 "" 0 0 60 H V C CNN 388 | F4 "ST" 150 450 50 H I C CNN "Manufacturer" 389 | F5 "USBLC6-4SC6Y" 250 550 50 H I C CNN "Part Number" 390 | $FPLIST 391 | SOT23-6 392 | $ENDFPLIST 393 | DRAW 394 | S 0 300 500 0 0 1 0 N 395 | X IO1 1 -200 250 200 R 50 50 1 1 P 396 | X GND 2 -200 150 200 R 50 50 1 1 P 397 | X IO2 3 -200 50 200 R 50 50 1 1 P 398 | X IO3 4 700 250 200 L 50 50 1 1 P 399 | X VBUS 5 700 150 200 L 50 50 1 1 P 400 | X IO4 6 700 50 200 L 50 50 1 1 P 401 | ENDDRAW 402 | ENDDEF 403 | # 404 | # nichicon_polymer_cap:PCAP_120u_4 405 | # 406 | DEF ~nichicon_polymer_cap:PCAP_120u_4 C 0 10 N Y 1 F N 407 | F0 "C" 0 150 39 H V L CNN 408 | F1 "nichicon_polymer_cap:PCAP_120u_4" 6 -85 40 H I L CNN 409 | F2 "PCAP_6.60" 38 -150 30 H I C CNN 410 | F3 "" 0 0 60 H V C CNN 411 | F4 "120µF, ±20%, 10V, 27 mOhm, 5000 Hrs @ 105°C, -55°C ~ 105°C, 2.3A" 100 200 60 H I C CNN "Description" 412 | F5 "PCS1A121MCL1GS" 100 200 60 H I C CNN "Part Number" 413 | F6 "Nichicon" 100 200 60 H I C CNN "Manufacturer" 414 | F7 "120µF" 100 100 39 H V C CNN "Capacitance" 415 | $FPLIST 416 | PCAP_6.60 417 | $ENDFPLIST 418 | DRAW 419 | A 0 -200 180 563 1236 0 1 15 N 100 -50 -100 -50 420 | T 0 -50 100 80 0 0 0 + Normal 0 C C 421 | P 4 0 1 15 -100 50 100 50 50 50 50 50 N 422 | X ~ 1 0 200 150 D 40 40 1 1 P 423 | X ~ 2 0 -200 180 U 40 40 1 1 P 424 | ENDDRAW 425 | ENDDEF 426 | # 427 | # power:GND 428 | # 429 | DEF power:GND #PWR 0 0 Y Y 1 F P 430 | F0 "#PWR" 0 140 20 H I C CNN 431 | F1 "power:GND" 0 100 30 H V C CNN 432 | F2 "" 0 0 60 H V C CNN 433 | F3 "" 0 0 60 H V C CNN 434 | DRAW 435 | P 2 0 1 12 -50 50 50 50 N 436 | P 2 0 1 0 0 50 0 0 N 437 | X GND 1 0 0 0 U 20 20 0 0 W N 438 | ENDDRAW 439 | ENDDEF 440 | # 441 | # power:LP3470IM5X-3.08_NOPB 442 | # 443 | DEF power:LP3470IM5X-3.08_NOPB U 0 40 Y Y 1 F N 444 | F0 "U" 50 350 60 H V C CNN 445 | F1 "power:LP3470IM5X-3.08_NOPB" 350 -50 60 H V C CNN 446 | F2 "footprints:SOT-23-5" 300 600 60 H I C CNN 447 | F3 "" -400 -200 60 H V C CNN 448 | F4 "TI" 300 800 50 H I C CNN "Manufacturer" 449 | F5 "LP3470IM5X-3.08/NOPB" 300 700 50 H I C CNN "Part Number" 450 | DRAW 451 | S 0 300 650 0 0 1 0 N 452 | X SRT 1 850 150 200 L 50 50 1 1 I 453 | X GND 2 850 50 200 L 50 50 1 1 I 454 | X Vcc1 3 -200 250 200 R 50 50 1 1 I 455 | X Vcc 4 -200 150 200 R 50 50 1 1 I 456 | X RESET_N 5 850 250 200 L 50 50 1 1 I 457 | ENDDRAW 458 | ENDDEF 459 | # 460 | # power:NCP380HSNAJAAT1G 461 | # 462 | DEF power:NCP380HSNAJAAT1G U 0 40 Y Y 1 F N 463 | F0 "U" 50 350 60 H V C CNN 464 | F1 "power:NCP380HSNAJAAT1G" 450 -50 60 H V C CNN 465 | F2 "footprints:TSOT-23-6" 350 550 60 H I C CNN 466 | F3 "" 0 0 60 H V C CNN 467 | F4 "ONSemi" 350 750 50 H I C CNN "Manufacturer" 468 | F5 "NCP380HSNAJAAT1G" 350 650 50 H I C CNN "Part Number" 469 | DRAW 470 | S 0 300 700 0 0 1 0 N 471 | X IN 1 -200 250 200 R 50 50 1 1 I 472 | X GND 2 900 50 200 L 50 50 1 1 I 473 | X EN 3 -200 150 200 R 50 50 1 1 I 474 | X FLAG_N 4 -200 50 200 R 50 50 1 1 I 475 | X ILIM 5 900 150 200 L 50 50 1 1 I 476 | X OUT 6 900 250 200 L 50 50 1 1 I 477 | ENDDRAW 478 | ENDDEF 479 | # 480 | # power:P3V3 481 | # 482 | DEF power:P3V3 #PWR 0 0 Y Y 1 F P 483 | F0 "#PWR" 0 140 20 H I C CNN 484 | F1 "power:P3V3" 0 100 30 H V C CNN 485 | F2 "" 0 0 60 H V C CNN 486 | F3 "" 0 0 60 H V C CNN 487 | DRAW 488 | P 2 0 1 12 -50 50 50 50 N 489 | P 2 0 1 0 0 50 0 0 N 490 | X P3V3 1 0 0 0 U 20 20 0 0 W N 491 | ENDDRAW 492 | ENDDEF 493 | # 494 | # power:P5V0 495 | # 496 | DEF power:P5V0 #PWR 0 0 Y Y 1 F P 497 | F0 "#PWR" 0 140 20 H I C CNN 498 | F1 "power:P5V0" 0 100 30 H V C CNN 499 | F2 "" 0 0 60 H V C CNN 500 | F3 "" 0 0 60 H V C CNN 501 | DRAW 502 | P 2 0 1 12 -50 50 50 50 N 503 | P 2 0 1 0 0 50 0 0 N 504 | X P5V0 1 0 0 0 U 20 20 0 0 W N 505 | ENDDRAW 506 | ENDDEF 507 | # 508 | # power:PAC1934 509 | # 510 | DEF power:PAC1934 U 0 40 Y Y 1 F N 511 | F0 "U" 50 1150 60 H V C CNN 512 | F1 "power:PAC1934" 200 -50 60 H V C CNN 513 | F2 "footprints:QFN-16-1EP_4x4mm_Pitch0.65mm" 400 1250 60 H I C CNN 514 | F3 "" 0 0 60 H I C CNN 515 | F4 "Microchip" 450 1450 60 H I C CNN "Manufacturer" 516 | F5 "PAC1934T-I/JQ" 600 1350 60 H I C CNN "Part Number" 517 | DRAW 518 | S 0 1100 1150 0 0 1 0 N 519 | X SLOW/ALERT_N 1 -200 450 200 R 50 50 1 1 I 520 | X SENSE4_P 10 1350 150 200 L 50 50 1 1 I 521 | X SENSE1_P 11 1350 1050 200 L 50 50 1 1 I 522 | X SENSE1_N 12 1350 950 200 L 50 50 1 1 I 523 | X SENSE2_P 13 1350 750 200 L 50 50 1 1 I 524 | X SENSE2_N 14 1350 650 200 L 50 50 1 1 I 525 | X VDD_IO 15 -200 950 200 R 50 50 1 1 W 526 | X PWRDN_N 16 -200 350 200 R 50 50 1 1 I 527 | X EP 17 -200 150 200 R 50 50 1 1 N 528 | X VDD 2 -200 1050 200 R 50 50 1 1 W 529 | X GND 3 -200 50 200 R 50 50 1 1 w 530 | X SM_CLK 4 -200 700 200 R 50 50 1 1 I 531 | X SM_DATA 5 -200 600 200 R 50 50 1 1 B 532 | X ADDRSEL 6 -200 250 200 R 50 50 1 1 I 533 | X SENSE3_N 7 1350 350 200 L 50 50 1 1 I 534 | X SENSE3_P 8 1350 450 200 L 50 50 1 1 I 535 | X SENSE4_N 9 1350 50 200 L 50 50 1 1 I 536 | ENDDRAW 537 | ENDDEF 538 | # 539 | # resistors_misc:R0805_0R1 540 | # 541 | DEF ~resistors_misc:R0805_0R1 R 0 10 N Y 1 F N 542 | F0 "R" 150 150 39 H V L CNN 543 | F1 "resistors_misc:R0805_0R1" 200 -100 40 H I L CNN 544 | F2 "R0805" 250 -150 30 H I C CNN 545 | F3 "" 0 0 60 H V C CNN 546 | F4 "RES SMD 0.1 OHM 1% 1/4W 0805" -250 450 60 H I C CNN "Description" 547 | F5 "RUT2012FR100CS" -250 550 60 H I C CNN "Part Number" 548 | F6 "Samsung" -550 650 60 H I C CNN "Manufacturer" 549 | F7 "100mOhm, 1%" 300 100 39 H V C CNN "Resistance" 550 | $FPLIST 551 | R1206 552 | $ENDFPLIST 553 | DRAW 554 | S -40 150 40 -150 0 1 12 N 555 | X ~ 1 0 250 100 D 60 60 1 1 P 556 | X ~ 2 0 -250 100 U 60 60 1 1 P 557 | ENDDRAW 558 | ENDDEF 559 | # 560 | # transistors:PUMH13 561 | # 562 | DEF transistors:PUMH13 Q 0 0 Y Y 2 L N 563 | F0 "Q" 200 75 50 H V L CNN 564 | F1 "transistors:PUMH13" 200 0 50 H V L CNN 565 | F2 "footprints:SOT-363_SC-70-6" 100 -25 50 H I L CNN 566 | F3 "" 200 75 50 H V L CNN 567 | F4 "Nexperia" 300 175 50 H I C CNN "Manufacturer" 568 | F5 "PUMH13,115" 400 275 50 H I C CNN "Part Number" 569 | DRAW 570 | A -50 0 125 901 -901 0 1 10 N -50 125 -50 -125 571 | A 25 0 125 -899 899 0 1 10 N 25 -125 25 125 572 | A 25 0 125 -899 899 0 1 10 N 25 -125 25 125 573 | C -50 0 5 0 1 0 N 574 | C -50 0 5 0 1 0 N 575 | C 100 -90 5 0 1 0 N 576 | C 100 -90 5 0 1 0 N 577 | T 900 -85 -60 20 0 0 0 47k Normal 0 C C 578 | T 900 -85 -60 20 0 0 0 47k Normal 0 C C 579 | T 0 -130 35 20 0 0 0 4k7 Normal 0 C C 580 | T 0 -130 35 20 0 0 0 4k7 Normal 0 C C 581 | P 2 0 1 0 -135 0 -150 0 N 582 | P 2 0 1 0 -135 0 -150 0 N 583 | P 2 0 1 10 -50 -125 25 -125 N 584 | P 2 0 1 10 -50 -125 25 -125 N 585 | P 2 0 1 10 -50 125 25 125 N 586 | P 2 0 1 10 -50 125 25 125 N 587 | P 2 0 1 0 0 -10 100 90 N 588 | P 2 0 1 0 0 -10 100 90 N 589 | P 2 0 1 20 5 60 5 -65 F 590 | P 2 0 1 20 5 60 5 -65 F 591 | P 2 0 1 0 100 90 100 100 N 592 | P 2 0 1 0 100 90 100 100 N 593 | P 3 0 1 0 100 -90 0 10 0 10 N 594 | P 3 0 1 0 100 -90 0 10 0 10 N 595 | P 4 0 1 0 55 -25 35 -45 75 -65 55 -25 F 596 | P 9 0 1 0 0 0 -75 0 -80 20 -90 -20 -100 20 -110 -20 -120 20 -130 -20 -135 0 N 597 | P 9 0 1 0 0 0 -75 0 -80 20 -90 -20 -100 20 -110 -20 -120 20 -130 -20 -135 0 N 598 | P 11 0 1 0 -50 0 -50 -15 -30 -20 -70 -30 -30 -40 -70 -50 -30 -60 -70 -70 -50 -75 -50 -90 100 -90 N 599 | P 11 0 1 0 -50 0 -50 -15 -30 -20 -70 -30 -30 -40 -70 -50 -30 -60 -70 -70 -50 -75 -50 -90 100 -90 N 600 | X ~ 3 100 200 100 D 50 50 1 1 P 601 | X ~ 4 100 -200 100 U 50 50 1 1 P 602 | X ~ 5 -250 0 100 R 50 50 1 1 I 603 | X ~ 1 100 -200 100 U 50 50 2 1 P 604 | X ~ 2 -250 0 100 R 50 50 2 1 I 605 | X ~ 6 100 200 100 D 50 50 2 1 P 606 | ENDDRAW 607 | ENDDEF 608 | # 609 | # vishay_IHLP_inductors:IHLP1212_1u_1 610 | # 611 | DEF ~vishay_IHLP_inductors:IHLP1212_1u_1 L 0 10 N Y 1 F N 612 | F0 "L" 0 150 39 H V L CNN 613 | F1 "vishay_IHLP_inductors:IHLP1212_1u_1" 6 -85 40 H I L CNN 614 | F2 "IHLP1212" 38 -150 30 H I C CNN 615 | F3 "" 0 0 60 H V C CNN 616 | F4 "1µH, ±20%, 5A, 4.5A, 24 mOhm Max, 75MHz, -55°C ~ 125°C, 0.144 L x 0.118 W (3.65mm x 3.00mm)" 100 200 60 H I C CNN "Description" 617 | F5 "IHLP1212BZER1R0M11" 100 200 60 H I C CNN "Part Number" 618 | F6 "Vishay" 100 200 60 H I C CNN "Manufacturer" 619 | F7 "1µH" 100 100 39 H V C CNN "Inductance" 620 | $FPLIST 621 | IHLP1212 622 | $ENDFPLIST 623 | DRAW 624 | A -150 0 50 1 1799 0 1 0 N -100 0 -200 0 625 | A -50 0 50 1 1799 0 1 0 N 0 0 -100 0 626 | A 50 0 50 1 1799 0 1 0 N 100 0 0 0 627 | A 150 0 50 1 1799 0 1 0 N 200 0 100 0 628 | X 1 1 -250 0 50 R 30 30 1 1 I 629 | X 2 2 250 0 50 L 30 30 1 1 I 630 | ENDDRAW 631 | ENDDEF 632 | # 633 | # vishay_resistors:R0402_100R 634 | # 635 | DEF ~vishay_resistors:R0402_100R R 0 10 N Y 1 F N 636 | F0 "R" 0 150 39 H V L CNN 637 | F1 "vishay_resistors:R0402_100R" 6 -85 40 H I L CNN 638 | F2 "R0402" 38 -150 30 H I C CNN 639 | F3 "" 0 0 60 H V C CNN 640 | F4 "100, ±1%, 0.063W" 100 200 60 H I C CNN "Description" 641 | F5 "CRCW0402100RFKED" 100 200 60 H I C CNN "Part Number" 642 | F6 "Vishay" 100 200 60 H I C CNN "Manufacturer" 643 | F7 "100" 100 100 39 H V C CNN "Resistance" 644 | $FPLIST 645 | R0402 646 | $ENDFPLIST 647 | DRAW 648 | S -40 150 40 -150 0 1 12 N 649 | X ~ 1 0 250 100 D 60 60 1 1 P 650 | X ~ 2 0 -250 100 U 60 60 1 1 P 651 | ENDDRAW 652 | ENDDEF 653 | # 654 | # vishay_resistors:R0402_12k10 655 | # 656 | DEF ~vishay_resistors:R0402_12k10 R 0 10 N Y 1 F N 657 | F0 "R" 0 150 39 H V L CNN 658 | F1 "vishay_resistors:R0402_12k10" 6 -85 40 H I L CNN 659 | F2 "R0402" 38 -150 30 H I C CNN 660 | F3 "" 0 0 60 H V C CNN 661 | F4 "12.1k, ±1%, 0.063W" 100 200 60 H I C CNN "Description" 662 | F5 "CRCW040212K1FKED" 100 200 60 H I C CNN "Part Number" 663 | F6 "Vishay" 100 200 60 H I C CNN "Manufacturer" 664 | F7 "12.1k" 100 100 39 H V C CNN "Resistance" 665 | $FPLIST 666 | R0402 667 | $ENDFPLIST 668 | DRAW 669 | S -40 150 40 -150 0 1 12 N 670 | X ~ 1 0 250 100 D 60 60 1 1 P 671 | X ~ 2 0 -250 100 U 60 60 1 1 P 672 | ENDDRAW 673 | ENDDEF 674 | # 675 | # vishay_resistors:R0402_1k 676 | # 677 | DEF ~vishay_resistors:R0402_1k R 0 10 N Y 1 F N 678 | F0 "R" 0 150 39 H V L CNN 679 | F1 "vishay_resistors:R0402_1k" 6 -85 40 H I L CNN 680 | F2 "R0402" 38 -150 30 H I C CNN 681 | F3 "" 0 0 60 H V C CNN 682 | F4 "1k, ±1%, 0.063W" 100 200 60 H I C CNN "Description" 683 | F5 "CRCW04021K00FKED" 100 200 60 H I C CNN "Part Number" 684 | F6 "Vishay" 100 200 60 H I C CNN "Manufacturer" 685 | F7 "1k" 100 100 39 H V C CNN "Resistance" 686 | $FPLIST 687 | R0402 688 | $ENDFPLIST 689 | DRAW 690 | S -40 150 40 -150 0 1 12 N 691 | X ~ 1 0 250 100 D 60 60 1 1 P 692 | X ~ 2 0 -250 100 U 60 60 1 1 P 693 | ENDDRAW 694 | ENDDEF 695 | # 696 | # vishay_resistors:R0402_21k 697 | # 698 | DEF ~vishay_resistors:R0402_21k R 0 10 N Y 1 F N 699 | F0 "R" 0 150 39 H V L CNN 700 | F1 "vishay_resistors:R0402_21k" 6 -85 40 H I L CNN 701 | F2 "R0402" 38 -150 30 H I C CNN 702 | F3 "" 0 0 60 H V C CNN 703 | F4 "21k, ±1%, 0.063W" 100 200 60 H I C CNN "Description" 704 | F5 "CRCW040221K0FKED" 100 200 60 H I C CNN "Part Number" 705 | F6 "Vishay" 100 200 60 H I C CNN "Manufacturer" 706 | F7 "21k" 100 100 39 H V C CNN "Resistance" 707 | $FPLIST 708 | R0402 709 | $ENDFPLIST 710 | DRAW 711 | S -40 150 40 -150 0 1 12 N 712 | X ~ 1 0 250 100 D 60 60 1 1 P 713 | X ~ 2 0 -250 100 U 60 60 1 1 P 714 | ENDDRAW 715 | ENDDEF 716 | # 717 | # vishay_resistors:R0402_2k20 718 | # 719 | DEF ~vishay_resistors:R0402_2k20 R 0 10 N Y 1 F N 720 | F0 "R" 0 150 39 H V L CNN 721 | F1 "vishay_resistors:R0402_2k20" 6 -85 40 H I L CNN 722 | F2 "R0402" 38 -150 30 H I C CNN 723 | F3 "" 0 0 60 H V C CNN 724 | F4 "2.2k, ±1%, 0.063W" 100 200 60 H I C CNN "Description" 725 | F5 "CRCW04022K20FKED" 100 200 60 H I C CNN "Part Number" 726 | F6 "Vishay" 100 200 60 H I C CNN "Manufacturer" 727 | F7 "2.2k" 100 100 39 H V C CNN "Resistance" 728 | $FPLIST 729 | R0402 730 | $ENDFPLIST 731 | DRAW 732 | S -40 150 40 -150 0 1 12 N 733 | X ~ 1 0 250 100 D 60 60 1 1 P 734 | X ~ 2 0 -250 100 U 60 60 1 1 P 735 | ENDDRAW 736 | ENDDEF 737 | # 738 | # vishay_resistors:R0402_46k40 739 | # 740 | DEF ~vishay_resistors:R0402_46k40 R 0 10 N Y 1 F N 741 | F0 "R" 0 150 39 H V L CNN 742 | F1 "vishay_resistors:R0402_46k40" 6 -85 40 H I L CNN 743 | F2 "R0402" 38 -150 30 H I C CNN 744 | F3 "" 0 0 60 H V C CNN 745 | F4 "46.4k, ±1%, 0.063W" 100 200 60 H I C CNN "Description" 746 | F5 "CRCW040246K4FKED" 100 200 60 H I C CNN "Part Number" 747 | F6 "Vishay" 100 200 60 H I C CNN "Manufacturer" 748 | F7 "46.4k" 100 100 39 H V C CNN "Resistance" 749 | $FPLIST 750 | R0402 751 | $ENDFPLIST 752 | DRAW 753 | S -40 150 40 -150 0 1 12 N 754 | X ~ 1 0 250 100 D 60 60 1 1 P 755 | X ~ 2 0 -250 100 U 60 60 1 1 P 756 | ENDDRAW 757 | ENDDEF 758 | # 759 | # vishay_resistors:R0603_200R 760 | # 761 | DEF ~vishay_resistors:R0603_200R R 0 10 N Y 1 F N 762 | F0 "R" 0 150 39 H V L CNN 763 | F1 "vishay_resistors:R0603_200R" 6 -85 40 H I L CNN 764 | F2 "R0603" 38 -150 30 H I C CNN 765 | F3 "" 0 0 60 H V C CNN 766 | F4 "200, ±1%, 0.1W" 100 200 60 H I C CNN "Description" 767 | F5 "CRCW0603200RFKEA" 100 200 60 H I C CNN "Part Number" 768 | F6 "Vishay" 100 200 60 H I C CNN "Manufacturer" 769 | F7 "200" 100 100 39 H V C CNN "Resistance" 770 | $FPLIST 771 | R0603 772 | $ENDFPLIST 773 | DRAW 774 | S -40 150 40 -150 0 1 12 N 775 | X ~ 1 0 250 100 D 60 60 1 1 P 776 | X ~ 2 0 -250 100 U 60 60 1 1 P 777 | ENDDRAW 778 | ENDDEF 779 | # 780 | # vishay_resistors:R0603_51R 781 | # 782 | DEF ~vishay_resistors:R0603_51R R 0 10 N Y 1 F N 783 | F0 "R" 0 150 39 H V L CNN 784 | F1 "vishay_resistors:R0603_51R" 6 -85 40 H I L CNN 785 | F2 "R0603" 38 -150 30 H I C CNN 786 | F3 "" 0 0 60 H V C CNN 787 | F4 "51, ±1%, 0.1W" 100 200 60 H I C CNN "Description" 788 | F5 "CRCW060351R0FKEA" 100 200 60 H I C CNN "Part Number" 789 | F6 "Vishay" 100 200 60 H I C CNN "Manufacturer" 790 | F7 "51" 100 100 39 H V C CNN "Resistance" 791 | $FPLIST 792 | R0603 793 | $ENDFPLIST 794 | DRAW 795 | S -40 150 40 -150 0 1 12 N 796 | X ~ 1 0 250 100 D 60 60 1 1 P 797 | X ~ 2 0 -250 100 U 60 60 1 1 P 798 | ENDDRAW 799 | ENDDEF 800 | # 801 | # xtal_NDK:NX2520SA-16.000000MHZ 802 | # 803 | DEF ~xtal_NDK:NX2520SA-16.000000MHZ X 0 10 N Y 1 F N 804 | F0 "X" 0 150 39 H V L CNN 805 | F1 "xtal_NDK:NX2520SA-16.000000MHZ" 6 -85 40 H I L CNN 806 | F2 "NX2520SA" 38 -150 30 H I C CNN 807 | F3 "" 0 0 60 H V C CNN 808 | F4 "f=16MHz, Stability:±10ppm, Tol:±10ppm,Load capacitance:10pF,esr:80 Ohm,Temp:-10°C ~ 60°C" 100 200 60 H I C CNN "Description" 809 | F5 "NX2520SA-16.000000MHZ" 100 200 60 H I C CNN "Part Number" 810 | F6 "NDK" 100 200 60 H I C CNN "Manufacturer" 811 | F7 "16MHz" 100 100 39 H V C CNN "Frequency" 812 | $FPLIST 813 | NX2520SA 814 | $ENDFPLIST 815 | DRAW 816 | P 2 0 1 0 -100 100 -100 -100 N 817 | P 2 0 1 0 100 100 100 -100 N 818 | P 5 0 1 0 -50 50 50 50 50 -50 -50 -50 -50 50 N 819 | X 1 1 -300 0 200 R 40 40 1 1 P 820 | X 3 3 300 0 200 L 40 40 1 1 P 821 | ENDDRAW 822 | ENDDEF 823 | # 824 | # xtal_NDK:NX2520SA-24.000000MHZ 825 | # 826 | DEF ~xtal_NDK:NX2520SA-24.000000MHZ X 0 10 N Y 1 F N 827 | F0 "X" 0 150 39 H V L CNN 828 | F1 "xtal_NDK:NX2520SA-24.000000MHZ" 6 -85 40 H I L CNN 829 | F2 "NX2520SA" 38 -150 30 H I C CNN 830 | F3 "" 0 0 60 H V C CNN 831 | F4 "f=24MHz, Stability:±10ppm, Tol:±10ppm,Load capacitance:10pF,esr:70 Ohm,Temp:-10°C ~ 60°C" 100 200 60 H I C CNN "Description" 832 | F5 "NX2520SA-24.000000MHZ" 100 200 60 H I C CNN "Part Number" 833 | F6 "NDK" 100 200 60 H I C CNN "Manufacturer" 834 | F7 "24MHz" 100 100 39 H V C CNN "Frequency" 835 | $FPLIST 836 | NX2520SA 837 | $ENDFPLIST 838 | DRAW 839 | P 2 0 1 0 -100 100 -100 -100 N 840 | P 2 0 1 0 100 100 100 -100 N 841 | P 5 0 1 0 -50 50 50 50 50 -50 -50 -50 -50 50 N 842 | X 1 1 -300 0 200 R 40 40 1 1 P 843 | X 3 3 300 0 200 L 40 40 1 1 P 844 | ENDDRAW 845 | ENDDEF 846 | # 847 | #End Library 848 | -------------------------------------------------------------------------------- /hw/upm.net: -------------------------------------------------------------------------------- 1 | (export (version D) 2 | (design 3 | (source /Users/jop/git/upm/hw/upm.sch) 4 | (date "2018 September 11, Tuesday 20:32:27") 5 | (tool "Eeschema (5.0.0-3-g5ebb6b6)") 6 | (sheet (number 1) (name /) (tstamps /) 7 | (title_block 8 | (title "UPM - USB Power Monitor") 9 | (company) 10 | (rev R1.0) 11 | (date 2018-09-05) 12 | (source upm.sch) 13 | (comment (number 1) (value "Jonas Persson")) 14 | (comment (number 2) (value jonpe960@gmail.com)) 15 | (comment (number 3) (value "")) 16 | (comment (number 4) (value ""))))) 17 | (components 18 | (comp (ref U1) 19 | (value ATSAMD21E15B) 20 | (footprint footprints:QFN-32-1EP_5x5mm_Pitch0.5mm) 21 | (fields 22 | (field (name Manufacturer) Microchip) 23 | (field (name "Part Number") ATSAMD21E15B-MUT)) 24 | (libsource (lib cpu) (part ATSAMD21E15B) (description "")) 25 | (sheetpath (names /) (tstamps /)) 26 | (tstamp 5B8EF43F)) 27 | (comp (ref U3) 28 | (value USB2512B) 29 | (footprint footprints:QFN-36-1EP_6x6mm_Pitch0.5mm) 30 | (fields 31 | (field (name Manufacturer) Microchip) 32 | (field (name "Part Number") USB2512Bi-AEZG)) 33 | (libsource (lib comm) (part USB2512B) (description "")) 34 | (sheetpath (names /) (tstamps /)) 35 | (tstamp 5B8EF4E0)) 36 | (comp (ref U4) 37 | (value PAC1934) 38 | (footprint footprints:QFN-16-1EP_4x4mm_Pitch0.65mm) 39 | (fields 40 | (field (name Manufacturer) Microchip) 41 | (field (name "Part Number") PAC1934T-I/JQ)) 42 | (libsource (lib power) (part PAC1934) (description "")) 43 | (sheetpath (names /) (tstamps /)) 44 | (tstamp 5B8EF55F)) 45 | (comp (ref U6) 46 | (value NCP380HSNAJAAT1G) 47 | (footprint footprints:TSOT-23-6) 48 | (fields 49 | (field (name Manufacturer) ONSemi) 50 | (field (name "Part Number") NCP380HSNAJAAT1G)) 51 | (libsource (lib power) (part NCP380HSNAJAAT1G) (description "")) 52 | (sheetpath (names /) (tstamps /)) 53 | (tstamp 5B8EF6E4)) 54 | (comp (ref U2) 55 | (value MIC23150-SYMT) 56 | (footprint DFN-8_2x2mm_Pitch0.5mm) 57 | (fields 58 | (field (name Manufacturer) Microchip) 59 | (field (name "Part Number") MIC23150-SYMT)) 60 | (libsource (lib dcdc) (part MIC23150-SYMT) (description "")) 61 | (sheetpath (names /) (tstamps /)) 62 | (tstamp 5B8EF888)) 63 | (comp (ref J2) 64 | (value USB_A_292303-1) 65 | (footprint USB_A_TH) 66 | (fields 67 | (field (name Manufacturer) TE) 68 | (field (name "Part Number") 292303-1)) 69 | (libsource (lib connectors) (part USB_A_292303-1) (description "")) 70 | (sheetpath (names /) (tstamps /)) 71 | (tstamp 5B8EFDA0)) 72 | (comp (ref J1) 73 | (value FTSH-105-01-F-DV-K) 74 | (footprint footprints:FTSH-105-01-F-DV-K) 75 | (fields 76 | (field (name Manufacturer) Samtec) 77 | (field (name "Part Number") FTSH-105-01-F-DV-K.stp)) 78 | (libsource (lib connectors) (part FTSH-105-01-F-DV-K) (description "")) 79 | (sheetpath (names /) (tstamps /)) 80 | (tstamp 5B8EFE4C)) 81 | (comp (ref U5) 82 | (value LP3470IM5X-3.08_NOPB) 83 | (footprint footprints:SOT-23-5) 84 | (fields 85 | (field (name Manufacturer) TI) 86 | (field (name "Part Number") LP3470IM5X-3.08/NOPB)) 87 | (libsource (lib power) (part LP3470IM5X-3.08_NOPB) (description "")) 88 | (sheetpath (names /) (tstamps /)) 89 | (tstamp 5B8FB8B6)) 90 | (comp (ref R4) 91 | (value R0402_46k40) 92 | (footprint R0402) 93 | (fields 94 | (field (name Description) "46.4k, ±1%, 0.063W") 95 | (field (name Manufacturer) Vishay) 96 | (field (name "Part Number") CRCW040246K4FKED) 97 | (field (name Resistance) 46.4k)) 98 | (libsource (lib vishay_resistors) (part R0402_46k40) (description "46.4k, ±1%, 0.063W")) 99 | (sheetpath (names /) (tstamps /)) 100 | (tstamp 5B91D430)) 101 | (comp (ref X1) 102 | (value NX2520SA-24.000000MHZ) 103 | (footprint NX2520SA) 104 | (fields 105 | (field (name Description) "f=24MHz, Stability:±10ppm, Tol:±10ppm,Load capacitance:10pF,esr:70 Ohm,Temp:-10°C ~ 60°C") 106 | (field (name Frequency) 24MHz) 107 | (field (name Manufacturer) NDK) 108 | (field (name "Part Number") NX2520SA-24.000000MHZ)) 109 | (libsource (lib xtal_NDK) (part NX2520SA-24.000000MHZ) (description "f=24MHz, Stability:±10ppm, Tol:±10ppm,Load capacitance:10pF,esr:70 Ohm,Temp:-10°C ~ 60°C")) 110 | (sheetpath (names /) (tstamps /)) 111 | (tstamp 5B91D578)) 112 | (comp (ref C1) 113 | (value C0402_12p_25Vdc_C0G_2) 114 | (footprint C0402) 115 | (fields 116 | (field (name Capacitance) 12pF) 117 | (field (name Description) "12pF, 25Vdc, ±5%, C0G") 118 | (field (name Manufacturer) Murata) 119 | (field (name "Part Number") GRM1555C1E120JA01)) 120 | (libsource (lib capacitors_murata_GRM) (part C0402_12p_25Vdc_C0G_2) (description "Ceramic Capacitor 12pF, 25Vdc, ±5%, C0G")) 121 | (sheetpath (names /) (tstamps /)) 122 | (tstamp 5B91D6FA)) 123 | (comp (ref C2) 124 | (value C0402_12p_25Vdc_C0G_2) 125 | (footprint C0402) 126 | (fields 127 | (field (name Capacitance) 12pF) 128 | (field (name Description) "12pF, 25Vdc, ±5%, C0G") 129 | (field (name Manufacturer) Murata) 130 | (field (name "Part Number") GRM1555C1E120JA01)) 131 | (libsource (lib capacitors_murata_GRM) (part C0402_12p_25Vdc_C0G_2) (description "Ceramic Capacitor 12pF, 25Vdc, ±5%, C0G")) 132 | (sheetpath (names /) (tstamps /)) 133 | (tstamp 5B91D770)) 134 | (comp (ref C5) 135 | (value C0402_1u_6.3Vdc_X7R) 136 | (footprint C0402) 137 | (fields 138 | (field (name Capacitance) 1.0uF) 139 | (field (name Description) "1.0uF, 6.3Vdc, ±10%, X7R") 140 | (field (name Manufacturer) Murata) 141 | (field (name "Part Number") GRM155R70J105KA12)) 142 | (libsource (lib capacitors_murata_GRM) (part C0402_1u_6.3Vdc_X7R) (description "Ceramic Capacitor 1.0uF, 6.3Vdc, ±10%, X7R")) 143 | (sheetpath (names /) (tstamps /)) 144 | (tstamp 5B91D851)) 145 | (comp (ref C7) 146 | (value C0402_1u_6.3Vdc_X7R) 147 | (footprint C0402) 148 | (fields 149 | (field (name Capacitance) 1.0uF) 150 | (field (name Description) "1.0uF, 6.3Vdc, ±10%, X7R") 151 | (field (name Manufacturer) Murata) 152 | (field (name "Part Number") GRM155R70J105KA12)) 153 | (libsource (lib capacitors_murata_GRM) (part C0402_1u_6.3Vdc_X7R) (description "Ceramic Capacitor 1.0uF, 6.3Vdc, ±10%, X7R")) 154 | (sheetpath (names /) (tstamps /)) 155 | (tstamp 5B91D8D4)) 156 | (comp (ref C3) 157 | (value C0402_100n_25Vdc_X7R) 158 | (footprint C0402) 159 | (fields 160 | (field (name Capacitance) 0.10uF) 161 | (field (name Description) "0.10uF, 25Vdc, ±10%, X7R") 162 | (field (name Manufacturer) Murata) 163 | (field (name "Part Number") GRM155R71E104KE14)) 164 | (libsource (lib capacitors_murata_GRM) (part C0402_100n_25Vdc_X7R) (description "Ceramic Capacitor 0.10uF, 25Vdc, ±10%, X7R")) 165 | (sheetpath (names /) (tstamps /)) 166 | (tstamp 5B91D9F7)) 167 | (comp (ref C6) 168 | (value C0402_100n_25Vdc_X7R) 169 | (footprint C0402) 170 | (fields 171 | (field (name Capacitance) 0.10uF) 172 | (field (name Description) "0.10uF, 25Vdc, ±10%, X7R") 173 | (field (name Manufacturer) Murata) 174 | (field (name "Part Number") GRM155R71E104KE14)) 175 | (libsource (lib capacitors_murata_GRM) (part C0402_100n_25Vdc_X7R) (description "Ceramic Capacitor 0.10uF, 25Vdc, ±10%, X7R")) 176 | (sheetpath (names /) (tstamps /)) 177 | (tstamp 5B91DA4B)) 178 | (comp (ref R1) 179 | (value R0402_100R) 180 | (footprint R0402) 181 | (fields 182 | (field (name Description) "100, ±1%, 0.063W") 183 | (field (name Manufacturer) Vishay) 184 | (field (name "Part Number") CRCW0402100RFKED) 185 | (field (name Resistance) 100)) 186 | (libsource (lib vishay_resistors) (part R0402_100R) (description "100, ±1%, 0.063W")) 187 | (sheetpath (names /) (tstamps /)) 188 | (tstamp 5B91FF08)) 189 | (comp (ref R2) 190 | (value R0402_46k40) 191 | (footprint R0402) 192 | (fields 193 | (field (name Description) "46.4k, ±1%, 0.063W") 194 | (field (name Manufacturer) Vishay) 195 | (field (name "Part Number") CRCW040246K4FKED) 196 | (field (name Resistance) 46.4k)) 197 | (libsource (lib vishay_resistors) (part R0402_46k40) (description "46.4k, ±1%, 0.063W")) 198 | (sheetpath (names /) (tstamps /)) 199 | (tstamp 5B922251)) 200 | (comp (ref R3) 201 | (value R0402_46k40) 202 | (footprint R0402) 203 | (fields 204 | (field (name Description) "46.4k, ±1%, 0.063W") 205 | (field (name Manufacturer) Vishay) 206 | (field (name "Part Number") CRCW040246K4FKED) 207 | (field (name Resistance) 46.4k)) 208 | (libsource (lib vishay_resistors) (part R0402_46k40) (description "46.4k, ±1%, 0.063W")) 209 | (sheetpath (names /) (tstamps /)) 210 | (tstamp 5B92296B)) 211 | (comp (ref C4) 212 | (value C0402_1u_6.3Vdc_X7R) 213 | (footprint C0402) 214 | (fields 215 | (field (name Capacitance) 1.0uF) 216 | (field (name Description) "1.0uF, 6.3Vdc, ±10%, X7R") 217 | (field (name Manufacturer) Murata) 218 | (field (name "Part Number") GRM155R70J105KA12)) 219 | (libsource (lib capacitors_murata_GRM) (part C0402_1u_6.3Vdc_X7R) (description "Ceramic Capacitor 1.0uF, 6.3Vdc, ±10%, X7R")) 220 | (sheetpath (names /) (tstamps /)) 221 | (tstamp 5B9234AD)) 222 | (comp (ref U7) 223 | (value USBLC6-4) 224 | (footprint SOT-23-6) 225 | (fields 226 | (field (name Manufacturer) ST) 227 | (field (name "Part Number") USBLC6-4SC6Y)) 228 | (libsource (lib esd) (part USBLC6-4) (description "")) 229 | (sheetpath (names /) (tstamps /)) 230 | (tstamp 5B92634F)) 231 | (comp (ref U8) 232 | (value USBLC6-4) 233 | (footprint SOT-23-6) 234 | (fields 235 | (field (name Manufacturer) ST) 236 | (field (name "Part Number") USBLC6-4SC6Y)) 237 | (libsource (lib esd) (part USBLC6-4) (description "")) 238 | (sheetpath (names /) (tstamps /)) 239 | (tstamp 5B92D8E9)) 240 | (comp (ref R5) 241 | (value R0402_12k10) 242 | (footprint R0402) 243 | (fields 244 | (field (name Description) "12.1k, ±1%, 0.063W") 245 | (field (name Manufacturer) Vishay) 246 | (field (name "Part Number") CRCW040212K1FKED) 247 | (field (name Resistance) 12.1k)) 248 | (libsource (lib vishay_resistors) (part R0402_12k10) (description "12.1k, ±1%, 0.063W")) 249 | (sheetpath (names /) (tstamps /)) 250 | (tstamp 5B92EF96)) 251 | (comp (ref R6) 252 | (value R0402_46k40) 253 | (footprint R0402) 254 | (fields 255 | (field (name Description) "46.4k, ±1%, 0.063W") 256 | (field (name Manufacturer) Vishay) 257 | (field (name "Part Number") CRCW040246K4FKED) 258 | (field (name Resistance) 46.4k)) 259 | (libsource (lib vishay_resistors) (part R0402_46k40) (description "46.4k, ±1%, 0.063W")) 260 | (sheetpath (names /) (tstamps /)) 261 | (tstamp 5B93130C)) 262 | (comp (ref R7) 263 | (value R0402_46k40) 264 | (footprint R0402) 265 | (fields 266 | (field (name Description) "46.4k, ±1%, 0.063W") 267 | (field (name Manufacturer) Vishay) 268 | (field (name "Part Number") CRCW040246K4FKED) 269 | (field (name Resistance) 46.4k)) 270 | (libsource (lib vishay_resistors) (part R0402_46k40) (description "46.4k, ±1%, 0.063W")) 271 | (sheetpath (names /) (tstamps /)) 272 | (tstamp 5B931388)) 273 | (comp (ref R8) 274 | (value R0402_46k40) 275 | (footprint R0402) 276 | (fields 277 | (field (name Description) "46.4k, ±1%, 0.063W") 278 | (field (name Manufacturer) Vishay) 279 | (field (name "Part Number") CRCW040246K4FKED) 280 | (field (name Resistance) 46.4k)) 281 | (libsource (lib vishay_resistors) (part R0402_46k40) (description "46.4k, ±1%, 0.063W")) 282 | (sheetpath (names /) (tstamps /)) 283 | (tstamp 5B9313DC)) 284 | (comp (ref C8) 285 | (value C0402_1u_6.3Vdc_X7R) 286 | (footprint C0402) 287 | (fields 288 | (field (name Capacitance) 1.0uF) 289 | (field (name Description) "1.0uF, 6.3Vdc, ±10%, X7R") 290 | (field (name Manufacturer) Murata) 291 | (field (name "Part Number") GRM155R70J105KA12)) 292 | (libsource (lib capacitors_murata_GRM) (part C0402_1u_6.3Vdc_X7R) (description "Ceramic Capacitor 1.0uF, 6.3Vdc, ±10%, X7R")) 293 | (sheetpath (names /) (tstamps /)) 294 | (tstamp 5B942A55)) 295 | (comp (ref C9) 296 | (value C0402_1u_6.3Vdc_X7R) 297 | (footprint C0402) 298 | (fields 299 | (field (name Capacitance) 1.0uF) 300 | (field (name Description) "1.0uF, 6.3Vdc, ±10%, X7R") 301 | (field (name Manufacturer) Murata) 302 | (field (name "Part Number") GRM155R70J105KA12)) 303 | (libsource (lib capacitors_murata_GRM) (part C0402_1u_6.3Vdc_X7R) (description "Ceramic Capacitor 1.0uF, 6.3Vdc, ±10%, X7R")) 304 | (sheetpath (names /) (tstamps /)) 305 | (tstamp 5B942BC2)) 306 | (comp (ref C10) 307 | (value C0402_1u_6.3Vdc_X7R) 308 | (footprint C0402) 309 | (fields 310 | (field (name Capacitance) 1.0uF) 311 | (field (name Description) "1.0uF, 6.3Vdc, ±10%, X7R") 312 | (field (name Manufacturer) Murata) 313 | (field (name "Part Number") GRM155R70J105KA12)) 314 | (libsource (lib capacitors_murata_GRM) (part C0402_1u_6.3Vdc_X7R) (description "Ceramic Capacitor 1.0uF, 6.3Vdc, ±10%, X7R")) 315 | (sheetpath (names /) (tstamps /)) 316 | (tstamp 5B942C20)) 317 | (comp (ref C11) 318 | (value C0402_1u_6.3Vdc_X7R) 319 | (footprint C0402) 320 | (fields 321 | (field (name Capacitance) 1.0uF) 322 | (field (name Description) "1.0uF, 6.3Vdc, ±10%, X7R") 323 | (field (name Manufacturer) Murata) 324 | (field (name "Part Number") GRM155R70J105KA12)) 325 | (libsource (lib capacitors_murata_GRM) (part C0402_1u_6.3Vdc_X7R) (description "Ceramic Capacitor 1.0uF, 6.3Vdc, ±10%, X7R")) 326 | (sheetpath (names /) (tstamps /)) 327 | (tstamp 5B942C7C)) 328 | (comp (ref C12) 329 | (value C0402_1u_6.3Vdc_X7R) 330 | (footprint C0402) 331 | (fields 332 | (field (name Capacitance) 1.0uF) 333 | (field (name Description) "1.0uF, 6.3Vdc, ±10%, X7R") 334 | (field (name Manufacturer) Murata) 335 | (field (name "Part Number") GRM155R70J105KA12)) 336 | (libsource (lib capacitors_murata_GRM) (part C0402_1u_6.3Vdc_X7R) (description "Ceramic Capacitor 1.0uF, 6.3Vdc, ±10%, X7R")) 337 | (sheetpath (names /) (tstamps /)) 338 | (tstamp 5B942CD6)) 339 | (comp (ref C13) 340 | (value C0402_1u_6.3Vdc_X7R) 341 | (footprint C0402) 342 | (fields 343 | (field (name Capacitance) 1.0uF) 344 | (field (name Description) "1.0uF, 6.3Vdc, ±10%, X7R") 345 | (field (name Manufacturer) Murata) 346 | (field (name "Part Number") GRM155R70J105KA12)) 347 | (libsource (lib capacitors_murata_GRM) (part C0402_1u_6.3Vdc_X7R) (description "Ceramic Capacitor 1.0uF, 6.3Vdc, ±10%, X7R")) 348 | (sheetpath (names /) (tstamps /)) 349 | (tstamp 5B942D38)) 350 | (comp (ref X2) 351 | (value NX2520SA-16.000000MHZ) 352 | (footprint NX2520SA) 353 | (fields 354 | (field (name Description) "f=16MHz, Stability:±10ppm, Tol:±10ppm,Load capacitance:10pF,esr:80 Ohm,Temp:-10°C ~ 60°C") 355 | (field (name Frequency) 16MHz) 356 | (field (name Manufacturer) NDK) 357 | (field (name "Part Number") NX2520SA-16.000000MHZ)) 358 | (libsource (lib xtal_NDK) (part NX2520SA-16.000000MHZ) (description "f=16MHz, Stability:±10ppm, Tol:±10ppm,Load capacitance:10pF,esr:80 Ohm,Temp:-10°C ~ 60°C")) 359 | (sheetpath (names /) (tstamps /)) 360 | (tstamp 5B964B2A)) 361 | (comp (ref C15) 362 | (value C0402_1u_6.3Vdc_X7R) 363 | (footprint C0402) 364 | (fields 365 | (field (name Capacitance) 1.0uF) 366 | (field (name Description) "1.0uF, 6.3Vdc, ±10%, X7R") 367 | (field (name Manufacturer) Murata) 368 | (field (name "Part Number") GRM155R70J105KA12)) 369 | (libsource (lib capacitors_murata_GRM) (part C0402_1u_6.3Vdc_X7R) (description "Ceramic Capacitor 1.0uF, 6.3Vdc, ±10%, X7R")) 370 | (sheetpath (names /) (tstamps /)) 371 | (tstamp 5B96ADDC)) 372 | (comp (ref C14) 373 | (value C0402_1u_6.3Vdc_X7R) 374 | (footprint C0402) 375 | (fields 376 | (field (name Capacitance) 1.0uF) 377 | (field (name Description) "1.0uF, 6.3Vdc, ±10%, X7R") 378 | (field (name Manufacturer) Murata) 379 | (field (name "Part Number") GRM155R70J105KA12)) 380 | (libsource (lib capacitors_murata_GRM) (part C0402_1u_6.3Vdc_X7R) (description "Ceramic Capacitor 1.0uF, 6.3Vdc, ±10%, X7R")) 381 | (sheetpath (names /) (tstamps /)) 382 | (tstamp 5B96AE98)) 383 | (comp (ref R11) 384 | (value R0402_46k40) 385 | (footprint R0402) 386 | (fields 387 | (field (name Description) "46.4k, ±1%, 0.063W") 388 | (field (name Manufacturer) Vishay) 389 | (field (name "Part Number") CRCW040246K4FKED) 390 | (field (name Resistance) 46.4k)) 391 | (libsource (lib vishay_resistors) (part R0402_46k40) (description "46.4k, ±1%, 0.063W")) 392 | (sheetpath (names /) (tstamps /)) 393 | (tstamp 5B9965B1)) 394 | (comp (ref R10) 395 | (value R0402_2k20) 396 | (footprint R0402) 397 | (fields 398 | (field (name Description) "2.2k, ±1%, 0.063W") 399 | (field (name Manufacturer) Vishay) 400 | (field (name "Part Number") CRCW04022K20FKED) 401 | (field (name Resistance) 2.2k)) 402 | (libsource (lib vishay_resistors) (part R0402_2k20) (description "2.2k, ±1%, 0.063W")) 403 | (sheetpath (names /) (tstamps /)) 404 | (tstamp 5B99EA15)) 405 | (comp (ref R9) 406 | (value R0402_2k20) 407 | (footprint R0402) 408 | (fields 409 | (field (name Description) "2.2k, ±1%, 0.063W") 410 | (field (name Manufacturer) Vishay) 411 | (field (name "Part Number") CRCW04022K20FKED) 412 | (field (name Resistance) 2.2k)) 413 | (libsource (lib vishay_resistors) (part R0402_2k20) (description "2.2k, ±1%, 0.063W")) 414 | (sheetpath (names /) (tstamps /)) 415 | (tstamp 5B99EAD9)) 416 | (comp (ref R12) 417 | (value R0402_100R) 418 | (footprint R0402) 419 | (fields 420 | (field (name Description) "100, ±1%, 0.063W") 421 | (field (name Manufacturer) Vishay) 422 | (field (name "Part Number") CRCW0402100RFKED) 423 | (field (name Resistance) 100)) 424 | (libsource (lib vishay_resistors) (part R0402_100R) (description "100, ±1%, 0.063W")) 425 | (sheetpath (names /) (tstamps /)) 426 | (tstamp 5BA4CCE3)) 427 | (comp (ref C24) 428 | (value C0402_12p_25Vdc_C0G_2) 429 | (footprint C0402) 430 | (fields 431 | (field (name Capacitance) 12pF) 432 | (field (name Description) "12pF, 25Vdc, ±5%, C0G") 433 | (field (name Manufacturer) Murata) 434 | (field (name "Part Number") GRM1555C1E120JA01)) 435 | (libsource (lib capacitors_murata_GRM) (part C0402_12p_25Vdc_C0G_2) (description "Ceramic Capacitor 12pF, 25Vdc, ±5%, C0G")) 436 | (sheetpath (names /) (tstamps /)) 437 | (tstamp 5BA51E26)) 438 | (comp (ref C25) 439 | (value C0402_12p_25Vdc_C0G_2) 440 | (footprint C0402) 441 | (fields 442 | (field (name Capacitance) 12pF) 443 | (field (name Description) "12pF, 25Vdc, ±5%, C0G") 444 | (field (name Manufacturer) Murata) 445 | (field (name "Part Number") GRM1555C1E120JA01)) 446 | (libsource (lib capacitors_murata_GRM) (part C0402_12p_25Vdc_C0G_2) (description "Ceramic Capacitor 12pF, 25Vdc, ±5%, C0G")) 447 | (sheetpath (names /) (tstamps /)) 448 | (tstamp 5BA5BEA1)) 449 | (comp (ref C22) 450 | (value C0402_1u_6.3Vdc_X7R) 451 | (footprint C0402) 452 | (fields 453 | (field (name Capacitance) 1.0uF) 454 | (field (name Description) "1.0uF, 6.3Vdc, ±10%, X7R") 455 | (field (name Manufacturer) Murata) 456 | (field (name "Part Number") GRM155R70J105KA12)) 457 | (libsource (lib capacitors_murata_GRM) (part C0402_1u_6.3Vdc_X7R) (description "Ceramic Capacitor 1.0uF, 6.3Vdc, ±10%, X7R")) 458 | (sheetpath (names /) (tstamps /)) 459 | (tstamp 5BA9E192)) 460 | (comp (ref C20) 461 | (value C0402_1u_6.3Vdc_X7R) 462 | (footprint C0402) 463 | (fields 464 | (field (name Capacitance) 1.0uF) 465 | (field (name Description) "1.0uF, 6.3Vdc, ±10%, X7R") 466 | (field (name Manufacturer) Murata) 467 | (field (name "Part Number") GRM155R70J105KA12)) 468 | (libsource (lib capacitors_murata_GRM) (part C0402_1u_6.3Vdc_X7R) (description "Ceramic Capacitor 1.0uF, 6.3Vdc, ±10%, X7R")) 469 | (sheetpath (names /) (tstamps /)) 470 | (tstamp 5BA9E20D)) 471 | (comp (ref C19) 472 | (value C0402_1u_6.3Vdc_X7R) 473 | (footprint C0402) 474 | (fields 475 | (field (name Capacitance) 1.0uF) 476 | (field (name Description) "1.0uF, 6.3Vdc, ±10%, X7R") 477 | (field (name Manufacturer) Murata) 478 | (field (name "Part Number") GRM155R70J105KA12)) 479 | (libsource (lib capacitors_murata_GRM) (part C0402_1u_6.3Vdc_X7R) (description "Ceramic Capacitor 1.0uF, 6.3Vdc, ±10%, X7R")) 480 | (sheetpath (names /) (tstamps /)) 481 | (tstamp 5BAC6CFB)) 482 | (comp (ref C17) 483 | (value C0402_1u_6.3Vdc_X7R) 484 | (footprint C0402) 485 | (fields 486 | (field (name Capacitance) 1.0uF) 487 | (field (name Description) "1.0uF, 6.3Vdc, ±10%, X7R") 488 | (field (name Manufacturer) Murata) 489 | (field (name "Part Number") GRM155R70J105KA12)) 490 | (libsource (lib capacitors_murata_GRM) (part C0402_1u_6.3Vdc_X7R) (description "Ceramic Capacitor 1.0uF, 6.3Vdc, ±10%, X7R")) 491 | (sheetpath (names /) (tstamps /)) 492 | (tstamp 5BAF53F8)) 493 | (comp (ref C18) 494 | (value C0402_100n_25Vdc_X7R) 495 | (footprint C0402) 496 | (fields 497 | (field (name Capacitance) 0.10uF) 498 | (field (name Description) "0.10uF, 25Vdc, ±10%, X7R") 499 | (field (name Manufacturer) Murata) 500 | (field (name "Part Number") GRM155R71E104KE14)) 501 | (libsource (lib capacitors_murata_GRM) (part C0402_100n_25Vdc_X7R) (description "Ceramic Capacitor 0.10uF, 25Vdc, ±10%, X7R")) 502 | (sheetpath (names /) (tstamps /)) 503 | (tstamp 5BB07831)) 504 | (comp (ref R13) 505 | (value R0402_46k40) 506 | (footprint R0402) 507 | (fields 508 | (field (name Description) "46.4k, ±1%, 0.063W") 509 | (field (name Manufacturer) Vishay) 510 | (field (name "Part Number") CRCW040246K4FKED) 511 | (field (name Resistance) 46.4k)) 512 | (libsource (lib vishay_resistors) (part R0402_46k40) (description "46.4k, ±1%, 0.063W")) 513 | (sheetpath (names /) (tstamps /)) 514 | (tstamp 5BB2BC5A)) 515 | (comp (ref C16) 516 | (value C0603_10u_10Vdc_X7R) 517 | (footprint C0603) 518 | (fields 519 | (field (name Capacitance) 10uF) 520 | (field (name Description) "10uF, 10Vdc, ±20%, X7R") 521 | (field (name Manufacturer) Murata) 522 | (field (name "Part Number") GRM188Z71A106MA73)) 523 | (libsource (lib capacitors_murata_GRM) (part C0603_10u_10Vdc_X7R) (description "Ceramic Capacitor 10uF, 10Vdc, ±20%, X7R")) 524 | (sheetpath (names /) (tstamps /)) 525 | (tstamp 5BCC5639)) 526 | (comp (ref C21) 527 | (value C0603_10u_10Vdc_X7R) 528 | (footprint C0603) 529 | (fields 530 | (field (name Capacitance) 10uF) 531 | (field (name Description) "10uF, 10Vdc, ±20%, X7R") 532 | (field (name Manufacturer) Murata) 533 | (field (name "Part Number") GRM188Z71A106MA73)) 534 | (libsource (lib capacitors_murata_GRM) (part C0603_10u_10Vdc_X7R) (description "Ceramic Capacitor 10uF, 10Vdc, ±20%, X7R")) 535 | (sheetpath (names /) (tstamps /)) 536 | (tstamp 5BCC56DD)) 537 | (comp (ref C23) 538 | (value C0603_10u_10Vdc_X7R) 539 | (footprint C0603) 540 | (fields 541 | (field (name Capacitance) 10uF) 542 | (field (name Description) "10uF, 10Vdc, ±20%, X7R") 543 | (field (name Manufacturer) Murata) 544 | (field (name "Part Number") GRM188Z71A106MA73)) 545 | (libsource (lib capacitors_murata_GRM) (part C0603_10u_10Vdc_X7R) (description "Ceramic Capacitor 10uF, 10Vdc, ±20%, X7R")) 546 | (sheetpath (names /) (tstamps /)) 547 | (tstamp 5BCC5760)) 548 | (comp (ref C26) 549 | (value C0603_10u_10Vdc_X7R) 550 | (footprint C0603) 551 | (fields 552 | (field (name Capacitance) 10uF) 553 | (field (name Description) "10uF, 10Vdc, ±20%, X7R") 554 | (field (name Manufacturer) Murata) 555 | (field (name "Part Number") GRM188Z71A106MA73)) 556 | (libsource (lib capacitors_murata_GRM) (part C0603_10u_10Vdc_X7R) (description "Ceramic Capacitor 10uF, 10Vdc, ±20%, X7R")) 557 | (sheetpath (names /) (tstamps /)) 558 | (tstamp 5BCC580C)) 559 | (comp (ref L1) 560 | (value IHLP1212_1u_1) 561 | (footprint IHLP1212) 562 | (fields 563 | (field (name Description) "1µH, ±20%, 5A, 4.5A, 24 mOhm Max, 75MHz, -55°C ~ 125°C, 0.144 L x 0.118 W (3.65mm x 3.00mm)") 564 | (field (name Inductance) 1µH) 565 | (field (name Manufacturer) Vishay) 566 | (field (name "Part Number") IHLP1212BZER1R0M11)) 567 | (libsource (lib vishay_IHLP_inductors) (part IHLP1212_1u_1) (description "1µH, ±20%, I=5A, I_sat=4.5A, DCR=24 mOhm Max, Self resonance: 75MHz, -55°C ~ 125°C, 0.144 L x 0.118 W (3.65mm x 3.00mm)")) 568 | (sheetpath (names /) (tstamps /)) 569 | (tstamp 5BCC5AD4)) 570 | (comp (ref C28) 571 | (value PCAP_120u_4) 572 | (footprint footprints:CP_Elec_6.3x5.8) 573 | (fields 574 | (field (name Capacitance) 120µF) 575 | (field (name Description) "120µF, ±20%, 10V, 27 mOhm, 5000 Hrs @ 105°C, -55°C ~ 105°C, 2.3A") 576 | (field (name Manufacturer) Nichicon) 577 | (field (name "Part Number") PCS1A121MCL1GS)) 578 | (libsource (lib nichicon_polymer_cap) (part PCAP_120u_4) (description "120µF, ±20%, 10V, 27 mOhm, 5000 Hrs @ 105°C, -55°C ~ 105°C, 2.3A")) 579 | (sheetpath (names /) (tstamps /)) 580 | (tstamp 5B91D14E)) 581 | (comp (ref R15) 582 | (value R0402_46k40) 583 | (footprint R0402) 584 | (fields 585 | (field (name Description) "46.4k, ±1%, 0.063W") 586 | (field (name Manufacturer) Vishay) 587 | (field (name "Part Number") CRCW040246K4FKED) 588 | (field (name Resistance) 46.4k)) 589 | (libsource (lib vishay_resistors) (part R0402_46k40) (description "46.4k, ±1%, 0.063W")) 590 | (sheetpath (names /) (tstamps /)) 591 | (tstamp 5B91D1F0)) 592 | (comp (ref C27) 593 | (value C0402_1u_6.3Vdc_X7R) 594 | (footprint C0402) 595 | (fields 596 | (field (name Capacitance) 1.0uF) 597 | (field (name Description) "1.0uF, 6.3Vdc, ±10%, X7R") 598 | (field (name Manufacturer) Murata) 599 | (field (name "Part Number") GRM155R70J105KA12)) 600 | (libsource (lib capacitors_murata_GRM) (part C0402_1u_6.3Vdc_X7R) (description "Ceramic Capacitor 1.0uF, 6.3Vdc, ±10%, X7R")) 601 | (sheetpath (names /) (tstamps /)) 602 | (tstamp 5B91D2A2)) 603 | (comp (ref R14) 604 | (value R0402_46k40) 605 | (footprint R0402) 606 | (fields 607 | (field (name Description) "46.4k, ±1%, 0.063W") 608 | (field (name Manufacturer) Vishay) 609 | (field (name "Part Number") CRCW040246K4FKED) 610 | (field (name Resistance) 46.4k)) 611 | (libsource (lib vishay_resistors) (part R0402_46k40) (description "46.4k, ±1%, 0.063W")) 612 | (sheetpath (names /) (tstamps /)) 613 | (tstamp 5B946363)) 614 | (comp (ref R16) 615 | (value R0402_21k) 616 | (footprint R0402) 617 | (fields 618 | (field (name Description) "21k, ±1%, 0.063W") 619 | (field (name Manufacturer) Vishay) 620 | (field (name "Part Number") CRCW040221K0FKED) 621 | (field (name Resistance) 21k)) 622 | (libsource (lib vishay_resistors) (part R0402_21k) (description "21k, ±1%, 0.063W")) 623 | (sheetpath (names /) (tstamps /)) 624 | (tstamp 5B9D541E)) 625 | (comp (ref Q1) 626 | (value PUMH13) 627 | (footprint footprints:SOT-363_SC-70-6) 628 | (fields 629 | (field (name Manufacturer) Nexperia) 630 | (field (name "Part Number") PUMH13,115)) 631 | (libsource (lib transistors) (part PUMH13) (description "")) 632 | (sheetpath (names /) (tstamps /)) 633 | (tstamp 5BD69AB1)) 634 | (comp (ref Q2) 635 | (value PUMH13) 636 | (footprint footprints:SOT-363_SC-70-6) 637 | (fields 638 | (field (name Manufacturer) Nexperia) 639 | (field (name "Part Number") PUMH13,115)) 640 | (libsource (lib transistors) (part PUMH13) (description "")) 641 | (sheetpath (names /) (tstamps /)) 642 | (tstamp 5BD69B80)) 643 | (comp (ref R18) 644 | (value R0603_51R) 645 | (footprint R0603) 646 | (fields 647 | (field (name Description) "51, ±1%, 0.1W") 648 | (field (name Manufacturer) Vishay) 649 | (field (name "Part Number") CRCW060351R0FKEA) 650 | (field (name Resistance) 51)) 651 | (libsource (lib vishay_resistors) (part R0603_51R) (description "51, ±1%, 0.1W")) 652 | (sheetpath (names /) (tstamps /)) 653 | (tstamp 5BF91165)) 654 | (comp (ref R19) 655 | (value R0603_51R) 656 | (footprint R0603) 657 | (fields 658 | (field (name Description) "51, ±1%, 0.1W") 659 | (field (name Manufacturer) Vishay) 660 | (field (name "Part Number") CRCW060351R0FKEA) 661 | (field (name Resistance) 51)) 662 | (libsource (lib vishay_resistors) (part R0603_51R) (description "51, ±1%, 0.1W")) 663 | (sheetpath (names /) (tstamps /)) 664 | (tstamp 5BF91340)) 665 | (comp (ref R20) 666 | (value R0603_51R) 667 | (footprint R0603) 668 | (fields 669 | (field (name Description) "51, ±1%, 0.1W") 670 | (field (name Manufacturer) Vishay) 671 | (field (name "Part Number") CRCW060351R0FKEA) 672 | (field (name Resistance) 51)) 673 | (libsource (lib vishay_resistors) (part R0603_51R) (description "51, ±1%, 0.1W")) 674 | (sheetpath (names /) (tstamps /)) 675 | (tstamp 5BF913E0)) 676 | (comp (ref C29) 677 | (value C0603_22n_100Vdc_X7R) 678 | (footprint C0603) 679 | (fields 680 | (field (name Capacitance) 22000pF) 681 | (field (name Description) "22000pF, 100Vdc, ±10%, X7R") 682 | (field (name Manufacturer) Murata) 683 | (field (name "Part Number") GRM188R72A223KAC4)) 684 | (libsource (lib capacitors_murata_GRM) (part C0603_22n_100Vdc_X7R) (description "Ceramic Capacitor 22000pF, 100Vdc, ±10%, X7R")) 685 | (sheetpath (names /) (tstamps /)) 686 | (tstamp 5BFA9F58)) 687 | (comp (ref C30) 688 | (value C0603_22n_100Vdc_X7R) 689 | (footprint C0603) 690 | (fields 691 | (field (name Capacitance) 22000pF) 692 | (field (name Description) "22000pF, 100Vdc, ±10%, X7R") 693 | (field (name Manufacturer) Murata) 694 | (field (name "Part Number") GRM188R72A223KAC4)) 695 | (libsource (lib capacitors_murata_GRM) (part C0603_22n_100Vdc_X7R) (description "Ceramic Capacitor 22000pF, 100Vdc, ±10%, X7R")) 696 | (sheetpath (names /) (tstamps /)) 697 | (tstamp 5BFAA044)) 698 | (comp (ref C31) 699 | (value C0603_22n_100Vdc_X7R) 700 | (footprint C0603) 701 | (fields 702 | (field (name Capacitance) 22000pF) 703 | (field (name Description) "22000pF, 100Vdc, ±10%, X7R") 704 | (field (name Manufacturer) Murata) 705 | (field (name "Part Number") GRM188R72A223KAC4)) 706 | (libsource (lib capacitors_murata_GRM) (part C0603_22n_100Vdc_X7R) (description "Ceramic Capacitor 22000pF, 100Vdc, ±10%, X7R")) 707 | (sheetpath (names /) (tstamps /)) 708 | (tstamp 5BFAA0EA)) 709 | (comp (ref J3) 710 | (value DX4R005JJ2R1800) 711 | (footprint USB_Micro-B) 712 | (fields 713 | (field (name Manufacturer) JAE) 714 | (field (name "Part Number") DX4R005JJ2R1800)) 715 | (libsource (lib connectors) (part DX4R005JJ2R1800) (description "")) 716 | (sheetpath (names /) (tstamps /)) 717 | (tstamp 5C19AFB8)) 718 | (comp (ref FB1) 719 | (value BL0603_BLM18BB121SN1D) 720 | (footprint L0603) 721 | (fields 722 | (field (name Description) "FERRITE CHIP 120 OHM 500MA 0603,84870,0DCR: 300 mOhm Max") 723 | (field (name Impedance) "120 Ohm @ 100MHz") 724 | (field (name Manufacturer) Murata) 725 | (field (name "Part Number") BLM18BB121SN1D)) 726 | (libsource (lib beads_BLM) (part BL0603_BLM18BB121SN1D) (description "FERRITE CHIP 120 OHM 500MA 0603,84870,0DCR: 300 mOhm Max")) 727 | (sheetpath (names /) (tstamps /)) 728 | (tstamp 5C27B657)) 729 | (comp (ref R17) 730 | (value R0603_200R) 731 | (footprint R0603) 732 | (fields 733 | (field (name Description) "200, ±1%, 0.1W") 734 | (field (name Manufacturer) Vishay) 735 | (field (name "Part Number") CRCW0603200RFKEA) 736 | (field (name Resistance) 200)) 737 | (libsource (lib vishay_resistors) (part R0603_200R) (description "200, ±1%, 0.1W")) 738 | (sheetpath (names /) (tstamps /)) 739 | (tstamp 5C34C560)) 740 | (comp (ref R21) 741 | (value R0402_1k) 742 | (footprint R0402) 743 | (fields 744 | (field (name Description) "1k, ±1%, 0.063W") 745 | (field (name Manufacturer) Vishay) 746 | (field (name "Part Number") CRCW04021K00FKED) 747 | (field (name Resistance) 1k)) 748 | (libsource (lib vishay_resistors) (part R0402_1k) (description "1k, ±1%, 0.063W")) 749 | (sheetpath (names /) (tstamps /)) 750 | (tstamp 5BBABA76)) 751 | (comp (ref J4) 752 | (value TFM-105-02-S-D-WT) 753 | (footprint TFM-105-02-S-D-WT) 754 | (fields 755 | (field (name Manufacturer) Samtec) 756 | (field (name "Part Number") TFM-105-02-S-D-WT)) 757 | (libsource (lib connectors) (part TFM-105-02-S-D-WT) (description "")) 758 | (sheetpath (names /) (tstamps /)) 759 | (tstamp 5BBF1807)) 760 | (comp (ref R22) 761 | (value R0805_0R1) 762 | (footprint R0805) 763 | (fields 764 | (field (name Description) "RES SMD 0.1 OHM 1% 1/4W 0805") 765 | (field (name Manufacturer) Samsung) 766 | (field (name "Part Number") RUT2012FR100CS) 767 | (field (name Resistance) "100mOhm, 1%")) 768 | (libsource (lib resistors_misc) (part R0805_0R1) (description "100k, ±1%, 0.063W")) 769 | (sheetpath (names /) (tstamps /)) 770 | (tstamp 5C34EB2F)) 771 | (comp (ref R23) 772 | (value R0402_46k40) 773 | (footprint R0402) 774 | (fields 775 | (field (name Description) "46.4k, ±1%, 0.063W") 776 | (field (name Manufacturer) Vishay) 777 | (field (name "Part Number") CRCW040246K4FKED) 778 | (field (name Resistance) 46.4k)) 779 | (libsource (lib vishay_resistors) (part R0402_46k40) (description "46.4k, ±1%, 0.063W")) 780 | (sheetpath (names /) (tstamps /)) 781 | (tstamp 5C61712F))) 782 | (libparts 783 | (libpart (lib beads_BLM) (part BL0603_BLM18BB121SN1D) 784 | (description "FERRITE CHIP 120 OHM 500MA 0603,84870,0DCR: 300 mOhm Max") 785 | (footprints 786 | (fp L0603)) 787 | (fields 788 | (field (name Reference) FB) 789 | (field (name Value) BL0603_BLM18BB121SN1D) 790 | (field (name Footprint) L0603) 791 | (field (name Description) "FERRITE CHIP 120 OHM 500MA 0603,84870,0DCR: 300 mOhm Max") 792 | (field (name "Part Number") BLM18BB121SN1D) 793 | (field (name Manufacturer) Murata) 794 | (field (name Impedance) "120 Ohm @ 100MHz")) 795 | (pins 796 | (pin (num 1) (name 1) (type passive)) 797 | (pin (num 2) (name 2) (type passive)))) 798 | (libpart (lib capacitors_murata_GRM) (part C0402_100n_25Vdc_X7R) 799 | (description "Ceramic Capacitor 0.10uF, 25Vdc, ±10%, X7R") 800 | (footprints 801 | (fp C0402)) 802 | (fields 803 | (field (name Reference) C) 804 | (field (name Value) C0402_100n_25Vdc_X7R) 805 | (field (name Footprint) C0402) 806 | (field (name Description) "0.10uF, 25Vdc, ±10%, X7R") 807 | (field (name "Part Number") GRM155R71E104KE14) 808 | (field (name Manufacturer) Murata) 809 | (field (name Capacitance) 0.10uF)) 810 | (pins 811 | (pin (num 1) (name ~) (type passive)) 812 | (pin (num 2) (name ~) (type passive)))) 813 | (libpart (lib capacitors_murata_GRM) (part C0402_12p_25Vdc_C0G_2) 814 | (description "Ceramic Capacitor 12pF, 25Vdc, ±5%, C0G") 815 | (footprints 816 | (fp C0402)) 817 | (fields 818 | (field (name Reference) C) 819 | (field (name Value) C0402_12p_25Vdc_C0G_2) 820 | (field (name Footprint) C0402) 821 | (field (name Description) "12pF, 25Vdc, ±5%, C0G") 822 | (field (name "Part Number") GRM1555C1E120JA01) 823 | (field (name Manufacturer) Murata) 824 | (field (name Capacitance) 12pF)) 825 | (pins 826 | (pin (num 1) (name ~) (type passive)) 827 | (pin (num 2) (name ~) (type passive)))) 828 | (libpart (lib capacitors_murata_GRM) (part C0402_1u_6.3Vdc_X7R) 829 | (description "Ceramic Capacitor 1.0uF, 6.3Vdc, ±10%, X7R") 830 | (footprints 831 | (fp C0402)) 832 | (fields 833 | (field (name Reference) C) 834 | (field (name Value) C0402_1u_6.3Vdc_X7R) 835 | (field (name Footprint) C0402) 836 | (field (name Description) "1.0uF, 6.3Vdc, ±10%, X7R") 837 | (field (name "Part Number") GRM155R70J105KA12) 838 | (field (name Manufacturer) Murata) 839 | (field (name Capacitance) 1.0uF)) 840 | (pins 841 | (pin (num 1) (name ~) (type passive)) 842 | (pin (num 2) (name ~) (type passive)))) 843 | (libpart (lib capacitors_murata_GRM) (part C0603_10u_10Vdc_X7R) 844 | (description "Ceramic Capacitor 10uF, 10Vdc, ±20%, X7R") 845 | (footprints 846 | (fp C0603)) 847 | (fields 848 | (field (name Reference) C) 849 | (field (name Value) C0603_10u_10Vdc_X7R) 850 | (field (name Footprint) C0603) 851 | (field (name Description) "10uF, 10Vdc, ±20%, X7R") 852 | (field (name "Part Number") GRM188Z71A106MA73) 853 | (field (name Manufacturer) Murata) 854 | (field (name Capacitance) 10uF)) 855 | (pins 856 | (pin (num 1) (name ~) (type passive)) 857 | (pin (num 2) (name ~) (type passive)))) 858 | (libpart (lib capacitors_murata_GRM) (part C0603_22n_100Vdc_X7R) 859 | (description "Ceramic Capacitor 22000pF, 100Vdc, ±10%, X7R") 860 | (footprints 861 | (fp C0603)) 862 | (fields 863 | (field (name Reference) C) 864 | (field (name Value) C0603_22n_100Vdc_X7R) 865 | (field (name Footprint) C0603) 866 | (field (name Description) "22000pF, 100Vdc, ±10%, X7R") 867 | (field (name "Part Number") GRM188R72A223KAC4) 868 | (field (name Manufacturer) Murata) 869 | (field (name Capacitance) 22000pF)) 870 | (pins 871 | (pin (num 1) (name ~) (type passive)) 872 | (pin (num 2) (name ~) (type passive)))) 873 | (libpart (lib comm) (part USB2512B) 874 | (fields 875 | (field (name Reference) U) 876 | (field (name Value) USB2512B) 877 | (field (name Footprint) footprints:QFN-36-1EP_6x6mm_Pitch0.5mm) 878 | (field (name Manufacturer) Microchip) 879 | (field (name "Part Number") USB2512Bi-AEZG)) 880 | (pins 881 | (pin (num 1) (name USBDM_DN1) (type BiDi)) 882 | (pin (num 2) (name USBDP_DN1) (type BiDi)) 883 | (pin (num 3) (name USBDM_DN2) (type BiDi)) 884 | (pin (num 4) (name USBDP_DN2) (type BiDi)) 885 | (pin (num 5) (name VDDA33_1) (type power_in)) 886 | (pin (num 6) (name NC_6) (type NotConnected)) 887 | (pin (num 7) (name NC_7) (type NotConnected)) 888 | (pin (num 8) (name NC_8) (type NotConnected)) 889 | (pin (num 9) (name NC_9) (type NotConnected)) 890 | (pin (num 10) (name VDDA33_2) (type power_in)) 891 | (pin (num 11) (name TEST) (type input)) 892 | (pin (num 12) (name PRTPWR1/BC_EN1) (type input)) 893 | (pin (num 13) (name OCS1_N) (type input)) 894 | (pin (num 14) (name CRFILT) (type passive)) 895 | (pin (num 15) (name VDD33_3) (type power_in)) 896 | (pin (num 16) (name PRTPWR2_BC_EN2) (type input)) 897 | (pin (num 17) (name OCS2_N) (type input)) 898 | (pin (num 18) (name NC_18) (type NotConnected)) 899 | (pin (num 19) (name NC_19) (type NotConnected)) 900 | (pin (num 20) (name NC_20) (type NotConnected)) 901 | (pin (num 21) (name NC_21) (type NotConnected)) 902 | (pin (num 22) (name SDA) (type BiDi)) 903 | (pin (num 23) (name VDD33_4) (type power_in)) 904 | (pin (num 24) (name SCL/CFG_SEL0) (type BiDi)) 905 | (pin (num 25) (name HS_IND/CFG_SEL1) (type BiDi)) 906 | (pin (num 26) (name RESET_N) (type input)) 907 | (pin (num 27) (name VBUS_DET) (type input)) 908 | (pin (num 28) (name SUSP_IND) (type input)) 909 | (pin (num 29) (name VDD33_5) (type power_in)) 910 | (pin (num 30) (name USBDM_UP) (type BiDi)) 911 | (pin (num 31) (name USBDP_UP) (type BiDi)) 912 | (pin (num 32) (name XTALOUT) (type output)) 913 | (pin (num 33) (name XTALIN) (type input)) 914 | (pin (num 34) (name PLLFILT) (type passive)) 915 | (pin (num 35) (name RBIAS) (type passive)) 916 | (pin (num 36) (name VDDA33_6) (type power_in)) 917 | (pin (num 37) (name GND_EP) (type power_out)))) 918 | (libpart (lib connectors) (part DX4R005JJ2R1800) 919 | (fields 920 | (field (name Reference) J) 921 | (field (name Value) DX4R005JJ2R1800) 922 | (field (name Footprint) USB_Micro-B) 923 | (field (name Manufacturer) JAE) 924 | (field (name "Part Number") DX4R005JJ2R1800)) 925 | (pins 926 | (pin (num 1) (name ~) (type BiDi)) 927 | (pin (num 2) (name ~) (type BiDi)) 928 | (pin (num 3) (name ~) (type BiDi)) 929 | (pin (num 4) (name ~) (type BiDi)) 930 | (pin (num 5) (name ~) (type BiDi)) 931 | (pin (num 6) (name ~) (type BiDi)) 932 | (pin (num 7) (name ~) (type BiDi)))) 933 | (libpart (lib connectors) (part FTSH-105-01-F-DV-K) 934 | (fields 935 | (field (name Reference) J) 936 | (field (name Value) FTSH-105-01-F-DV-K) 937 | (field (name Footprint) Jonas:FTSH-105-01-F-DV-K) 938 | (field (name Manufacturer) Samtec) 939 | (field (name "Part Number") FTSH-105-01-F-DV-K.stp)) 940 | (pins 941 | (pin (num 1) (name ~) (type passive)) 942 | (pin (num 2) (name ~) (type passive)) 943 | (pin (num 3) (name ~) (type passive)) 944 | (pin (num 4) (name ~) (type passive)) 945 | (pin (num 5) (name ~) (type passive)) 946 | (pin (num 6) (name ~) (type passive)) 947 | (pin (num 7) (name ~) (type passive)) 948 | (pin (num 8) (name ~) (type passive)) 949 | (pin (num 9) (name ~) (type passive)) 950 | (pin (num 10) (name ~) (type passive)))) 951 | (libpart (lib connectors) (part TFM-105-02-S-D-WT) 952 | (fields 953 | (field (name Reference) J) 954 | (field (name Value) TFM-105-02-S-D-WT) 955 | (field (name Footprint) TFM-105-02-S-D-WT) 956 | (field (name Manufacturer) Samtec) 957 | (field (name "Part Number") TFM-105-02-S-D-WT)) 958 | (pins 959 | (pin (num 1) (name 1) (type BiDi)) 960 | (pin (num 2) (name 2) (type BiDi)) 961 | (pin (num 3) (name 3) (type BiDi)) 962 | (pin (num 4) (name 4) (type BiDi)) 963 | (pin (num 5) (name 5) (type BiDi)) 964 | (pin (num 6) (name 6) (type BiDi)) 965 | (pin (num 7) (name 7) (type BiDi)) 966 | (pin (num 8) (name 8) (type BiDi)) 967 | (pin (num 9) (name 9) (type BiDi)) 968 | (pin (num 10) (name 10) (type BiDi)) 969 | (pin (num 11) (name 11) (type BiDi)) 970 | (pin (num 12) (name 12) (type BiDi)))) 971 | (libpart (lib connectors) (part USB_A_292303-1) 972 | (fields 973 | (field (name Reference) J) 974 | (field (name Value) USB_A_292303-1) 975 | (field (name Footprint) USB_A_TH) 976 | (field (name Manufacturer) TE) 977 | (field (name "Part Number") 292303-1)) 978 | (pins 979 | (pin (num 1) (name 1) (type passive)) 980 | (pin (num 2) (name 2) (type passive)) 981 | (pin (num 3) (name 3) (type passive)) 982 | (pin (num 4) (name 4) (type passive)) 983 | (pin (num 5) (name SH1) (type passive)) 984 | (pin (num 6) (name SH2) (type passive)))) 985 | (libpart (lib cpu) (part ATSAMD21E15B) 986 | (fields 987 | (field (name Reference) U) 988 | (field (name Value) ATSAMD21E15B) 989 | (field (name Footprint) footprints:QFN-32-1EP_5x5mm_Pitch0.5mm) 990 | (field (name Manufacturer) Microchip) 991 | (field (name "Part Number") ATSAMD21E15B-MUT)) 992 | (pins 993 | (pin (num 1) (name PA00) (type BiDi)) 994 | (pin (num 2) (name PA01) (type BiDi)) 995 | (pin (num 3) (name PA02) (type BiDi)) 996 | (pin (num 4) (name PA03) (type BiDi)) 997 | (pin (num 5) (name PA04) (type BiDi)) 998 | (pin (num 6) (name PA05) (type BiDi)) 999 | (pin (num 7) (name PA06) (type BiDi)) 1000 | (pin (num 8) (name PA07) (type BiDi)) 1001 | (pin (num 9) (name VDDANA) (type power_in)) 1002 | (pin (num 10) (name GND) (type power_out)) 1003 | (pin (num 11) (name PA08) (type BiDi)) 1004 | (pin (num 12) (name PA09) (type BiDi)) 1005 | (pin (num 13) (name PA10) (type BiDi)) 1006 | (pin (num 14) (name PA11) (type BiDi)) 1007 | (pin (num 15) (name PA14) (type BiDi)) 1008 | (pin (num 16) (name PA15) (type BiDi)) 1009 | (pin (num 17) (name PA16) (type BiDi)) 1010 | (pin (num 18) (name PA17) (type BiDi)) 1011 | (pin (num 19) (name PA18) (type BiDi)) 1012 | (pin (num 20) (name PA19) (type BiDi)) 1013 | (pin (num 21) (name PA22) (type BiDi)) 1014 | (pin (num 22) (name PA23) (type BiDi)) 1015 | (pin (num 23) (name PA24) (type BiDi)) 1016 | (pin (num 24) (name PA25) (type BiDi)) 1017 | (pin (num 25) (name PA27) (type BiDi)) 1018 | (pin (num 26) (name RESET_N) (type input)) 1019 | (pin (num 27) (name PA28) (type BiDi)) 1020 | (pin (num 28) (name GND) (type power_out)) 1021 | (pin (num 29) (name VDDCORE) (type passive)) 1022 | (pin (num 30) (name VDDIN) (type power_in)) 1023 | (pin (num 31) (name PA30) (type BiDi)) 1024 | (pin (num 32) (name PA31) (type BiDi)) 1025 | (pin (num 33) (name GND_EP) (type power_out)))) 1026 | (libpart (lib dcdc) (part MIC23150-SYMT) 1027 | (fields 1028 | (field (name Reference) U) 1029 | (field (name Value) MIC23150-SYMT) 1030 | (field (name Footprint) DFN-8_2x2mm_Pitch0.5mm) 1031 | (field (name "Part Number") MIC23150-SYMT) 1032 | (field (name Manufacturer) Microchip)) 1033 | (pins 1034 | (pin (num 1) (name SW_1) (type power_out)) 1035 | (pin (num 2) (name SW_2) (type power_out)) 1036 | (pin (num 3) (name EN) (type input)) 1037 | (pin (num 4) (name SNS) (type input)) 1038 | (pin (num 5) (name AGND) (type power_out)) 1039 | (pin (num 6) (name VIN_6) (type power_in)) 1040 | (pin (num 7) (name VIN_7) (type power_in)) 1041 | (pin (num 8) (name PGND) (type power_out)))) 1042 | (libpart (lib esd) (part USBLC6-4) 1043 | (footprints 1044 | (fp SOT23-6)) 1045 | (fields 1046 | (field (name Reference) U) 1047 | (field (name Value) USBLC6-4) 1048 | (field (name Footprint) SOT-23-6) 1049 | (field (name Manufacturer) ST) 1050 | (field (name "Part Number") USBLC6-4SC6Y)) 1051 | (pins 1052 | (pin (num 1) (name IO1) (type passive)) 1053 | (pin (num 2) (name GND) (type passive)) 1054 | (pin (num 3) (name IO2) (type passive)) 1055 | (pin (num 4) (name IO3) (type passive)) 1056 | (pin (num 5) (name VBUS) (type passive)) 1057 | (pin (num 6) (name IO4) (type passive)))) 1058 | (libpart (lib nichicon_polymer_cap) (part PCAP_120u_4) 1059 | (description "120µF, ±20%, 10V, 27 mOhm, 5000 Hrs @ 105°C, -55°C ~ 105°C, 2.3A") 1060 | (footprints 1061 | (fp PCAP_6.60)) 1062 | (fields 1063 | (field (name Reference) C) 1064 | (field (name Value) PCAP_120u_4) 1065 | (field (name Footprint) PCAP_6.60) 1066 | (field (name Description) "120µF, ±20%, 10V, 27 mOhm, 5000 Hrs @ 105°C, -55°C ~ 105°C, 2.3A") 1067 | (field (name "Part Number") PCS1A121MCL1GS) 1068 | (field (name Manufacturer) Nichicon) 1069 | (field (name Capacitance) 120µF)) 1070 | (pins 1071 | (pin (num 1) (name ~) (type passive)) 1072 | (pin (num 2) (name ~) (type passive)))) 1073 | (libpart (lib power) (part LP3470IM5X-3.08_NOPB) 1074 | (fields 1075 | (field (name Reference) U) 1076 | (field (name Value) LP3470IM5X-3.08_NOPB) 1077 | (field (name Footprint) footprints:SOT-23-5) 1078 | (field (name Manufacturer) TI) 1079 | (field (name "Part Number") LP3470IM5X-3.08/NOPB)) 1080 | (pins 1081 | (pin (num 1) (name SRT) (type input)) 1082 | (pin (num 2) (name GND) (type input)) 1083 | (pin (num 3) (name Vcc1) (type input)) 1084 | (pin (num 4) (name Vcc) (type input)) 1085 | (pin (num 5) (name RESET_N) (type input)))) 1086 | (libpart (lib power) (part NCP380HSNAJAAT1G) 1087 | (fields 1088 | (field (name Reference) U) 1089 | (field (name Value) NCP380HSNAJAAT1G) 1090 | (field (name Footprint) footprints:TSOT-23-6) 1091 | (field (name Manufacturer) ONSemi) 1092 | (field (name "Part Number") NCP380HSNAJAAT1G)) 1093 | (pins 1094 | (pin (num 1) (name IN) (type input)) 1095 | (pin (num 2) (name GND) (type input)) 1096 | (pin (num 3) (name EN) (type input)) 1097 | (pin (num 4) (name FLAG_N) (type input)) 1098 | (pin (num 5) (name ILIM) (type input)) 1099 | (pin (num 6) (name OUT) (type input)))) 1100 | (libpart (lib power) (part PAC1934) 1101 | (fields 1102 | (field (name Reference) U) 1103 | (field (name Value) PAC1934) 1104 | (field (name Footprint) footprints:QFN-16-1EP_4x4mm_Pitch0.65mm) 1105 | (field (name Manufacturer) Microchip) 1106 | (field (name "Part Number") PAC1934T-I/JQ)) 1107 | (pins 1108 | (pin (num 1) (name SLOW/ALERT_N) (type input)) 1109 | (pin (num 2) (name VDD) (type power_in)) 1110 | (pin (num 3) (name GND) (type power_out)) 1111 | (pin (num 4) (name SM_CLK) (type input)) 1112 | (pin (num 5) (name SM_DATA) (type BiDi)) 1113 | (pin (num 6) (name ADDRSEL) (type input)) 1114 | (pin (num 7) (name SENSE3_N) (type input)) 1115 | (pin (num 8) (name SENSE3_P) (type input)) 1116 | (pin (num 9) (name SENSE4_N) (type input)) 1117 | (pin (num 10) (name SENSE4_P) (type input)) 1118 | (pin (num 11) (name SENSE1_P) (type input)) 1119 | (pin (num 12) (name SENSE1_N) (type input)) 1120 | (pin (num 13) (name SENSE2_P) (type input)) 1121 | (pin (num 14) (name SENSE2_N) (type input)) 1122 | (pin (num 15) (name VDD_IO) (type power_in)) 1123 | (pin (num 16) (name PWRDN_N) (type input)) 1124 | (pin (num 17) (name EP) (type NotConnected)))) 1125 | (libpart (lib resistors_misc) (part R0805_0R1) 1126 | (description "100k, ±1%, 0.063W") 1127 | (footprints 1128 | (fp R1206)) 1129 | (fields 1130 | (field (name Reference) R) 1131 | (field (name Value) R0805_0R1) 1132 | (field (name Footprint) R0805) 1133 | (field (name Description) "RES SMD 0.1 OHM 1% 1/4W 0805") 1134 | (field (name "Part Number") RUT2012FR100CS) 1135 | (field (name Manufacturer) Samsung) 1136 | (field (name Resistance) "100mOhm, 1%")) 1137 | (pins 1138 | (pin (num 1) (name ~) (type passive)) 1139 | (pin (num 2) (name ~) (type passive)))) 1140 | (libpart (lib transistors) (part PUMH13) 1141 | (fields 1142 | (field (name Reference) Q) 1143 | (field (name Value) PUMH13) 1144 | (field (name Footprint) footprints:SOT-363_SC-70-6) 1145 | (field (name Manufacturer) Nexperia) 1146 | (field (name "Part Number") PUMH13,115)) 1147 | (pins 1148 | (pin (num 1) (name ~) (type passive)) 1149 | (pin (num 2) (name ~) (type input)) 1150 | (pin (num 3) (name ~) (type passive)) 1151 | (pin (num 4) (name ~) (type passive)) 1152 | (pin (num 5) (name ~) (type input)) 1153 | (pin (num 6) (name ~) (type passive)))) 1154 | (libpart (lib vishay_IHLP_inductors) (part IHLP1212_1u_1) 1155 | (description "1µH, ±20%, I=5A, I_sat=4.5A, DCR=24 mOhm Max, Self resonance: 75MHz, -55°C ~ 125°C, 0.144 L x 0.118 W (3.65mm x 3.00mm)") 1156 | (footprints 1157 | (fp IHLP1212)) 1158 | (fields 1159 | (field (name Reference) L) 1160 | (field (name Value) IHLP1212_1u_1) 1161 | (field (name Footprint) IHLP1212) 1162 | (field (name Description) "1µH, ±20%, 5A, 4.5A, 24 mOhm Max, 75MHz, -55°C ~ 125°C, 0.144 L x 0.118 W (3.65mm x 3.00mm)") 1163 | (field (name "Part Number") IHLP1212BZER1R0M11) 1164 | (field (name Manufacturer) Vishay) 1165 | (field (name Inductance) 1µH)) 1166 | (pins 1167 | (pin (num 1) (name 1) (type input)) 1168 | (pin (num 2) (name 2) (type input)))) 1169 | (libpart (lib vishay_resistors) (part R0402_100R) 1170 | (description "100, ±1%, 0.063W") 1171 | (footprints 1172 | (fp R0402)) 1173 | (fields 1174 | (field (name Reference) R) 1175 | (field (name Value) R0402_100R) 1176 | (field (name Footprint) R0402) 1177 | (field (name Description) "100, ±1%, 0.063W") 1178 | (field (name "Part Number") CRCW0402100RFKED) 1179 | (field (name Manufacturer) Vishay) 1180 | (field (name Resistance) 100)) 1181 | (pins 1182 | (pin (num 1) (name ~) (type passive)) 1183 | (pin (num 2) (name ~) (type passive)))) 1184 | (libpart (lib vishay_resistors) (part R0402_12k10) 1185 | (description "12.1k, ±1%, 0.063W") 1186 | (footprints 1187 | (fp R0402)) 1188 | (fields 1189 | (field (name Reference) R) 1190 | (field (name Value) R0402_12k10) 1191 | (field (name Footprint) R0402) 1192 | (field (name Description) "12.1k, ±1%, 0.063W") 1193 | (field (name "Part Number") CRCW040212K1FKED) 1194 | (field (name Manufacturer) Vishay) 1195 | (field (name Resistance) 12.1k)) 1196 | (pins 1197 | (pin (num 1) (name ~) (type passive)) 1198 | (pin (num 2) (name ~) (type passive)))) 1199 | (libpart (lib vishay_resistors) (part R0402_1k) 1200 | (description "1k, ±1%, 0.063W") 1201 | (footprints 1202 | (fp R0402)) 1203 | (fields 1204 | (field (name Reference) R) 1205 | (field (name Value) R0402_1k) 1206 | (field (name Footprint) R0402) 1207 | (field (name Description) "1k, ±1%, 0.063W") 1208 | (field (name "Part Number") CRCW04021K00FKED) 1209 | (field (name Manufacturer) Vishay) 1210 | (field (name Resistance) 1k)) 1211 | (pins 1212 | (pin (num 1) (name ~) (type passive)) 1213 | (pin (num 2) (name ~) (type passive)))) 1214 | (libpart (lib vishay_resistors) (part R0402_21k) 1215 | (description "21k, ±1%, 0.063W") 1216 | (footprints 1217 | (fp R0402)) 1218 | (fields 1219 | (field (name Reference) R) 1220 | (field (name Value) R0402_21k) 1221 | (field (name Footprint) R0402) 1222 | (field (name Description) "21k, ±1%, 0.063W") 1223 | (field (name "Part Number") CRCW040221K0FKED) 1224 | (field (name Manufacturer) Vishay) 1225 | (field (name Resistance) 21k)) 1226 | (pins 1227 | (pin (num 1) (name ~) (type passive)) 1228 | (pin (num 2) (name ~) (type passive)))) 1229 | (libpart (lib vishay_resistors) (part R0402_2k20) 1230 | (description "2.2k, ±1%, 0.063W") 1231 | (footprints 1232 | (fp R0402)) 1233 | (fields 1234 | (field (name Reference) R) 1235 | (field (name Value) R0402_2k20) 1236 | (field (name Footprint) R0402) 1237 | (field (name Description) "2.2k, ±1%, 0.063W") 1238 | (field (name "Part Number") CRCW04022K20FKED) 1239 | (field (name Manufacturer) Vishay) 1240 | (field (name Resistance) 2.2k)) 1241 | (pins 1242 | (pin (num 1) (name ~) (type passive)) 1243 | (pin (num 2) (name ~) (type passive)))) 1244 | (libpart (lib vishay_resistors) (part R0402_46k40) 1245 | (description "46.4k, ±1%, 0.063W") 1246 | (footprints 1247 | (fp R0402)) 1248 | (fields 1249 | (field (name Reference) R) 1250 | (field (name Value) R0402_46k40) 1251 | (field (name Footprint) R0402) 1252 | (field (name Description) "46.4k, ±1%, 0.063W") 1253 | (field (name "Part Number") CRCW040246K4FKED) 1254 | (field (name Manufacturer) Vishay) 1255 | (field (name Resistance) 46.4k)) 1256 | (pins 1257 | (pin (num 1) (name ~) (type passive)) 1258 | (pin (num 2) (name ~) (type passive)))) 1259 | (libpart (lib vishay_resistors) (part R0603_200R) 1260 | (description "200, ±1%, 0.1W") 1261 | (footprints 1262 | (fp R0603)) 1263 | (fields 1264 | (field (name Reference) R) 1265 | (field (name Value) R0603_200R) 1266 | (field (name Footprint) R0603) 1267 | (field (name Description) "200, ±1%, 0.1W") 1268 | (field (name "Part Number") CRCW0603200RFKEA) 1269 | (field (name Manufacturer) Vishay) 1270 | (field (name Resistance) 200)) 1271 | (pins 1272 | (pin (num 1) (name ~) (type passive)) 1273 | (pin (num 2) (name ~) (type passive)))) 1274 | (libpart (lib vishay_resistors) (part R0603_51R) 1275 | (description "51, ±1%, 0.1W") 1276 | (footprints 1277 | (fp R0603)) 1278 | (fields 1279 | (field (name Reference) R) 1280 | (field (name Value) R0603_51R) 1281 | (field (name Footprint) R0603) 1282 | (field (name Description) "51, ±1%, 0.1W") 1283 | (field (name "Part Number") CRCW060351R0FKEA) 1284 | (field (name Manufacturer) Vishay) 1285 | (field (name Resistance) 51)) 1286 | (pins 1287 | (pin (num 1) (name ~) (type passive)) 1288 | (pin (num 2) (name ~) (type passive)))) 1289 | (libpart (lib xtal_NDK) (part NX2520SA-16.000000MHZ) 1290 | (description "f=16MHz, Stability:±10ppm, Tol:±10ppm,Load capacitance:10pF,esr:80 Ohm,Temp:-10°C ~ 60°C") 1291 | (footprints 1292 | (fp NX2520SA)) 1293 | (fields 1294 | (field (name Reference) X) 1295 | (field (name Value) NX2520SA-16.000000MHZ) 1296 | (field (name Footprint) NX2520SA) 1297 | (field (name Description) "f=16MHz, Stability:±10ppm, Tol:±10ppm,Load capacitance:10pF,esr:80 Ohm,Temp:-10°C ~ 60°C") 1298 | (field (name "Part Number") NX2520SA-16.000000MHZ) 1299 | (field (name Manufacturer) NDK) 1300 | (field (name Frequency) 16MHz)) 1301 | (pins 1302 | (pin (num 1) (name 1) (type passive)) 1303 | (pin (num 3) (name 3) (type passive)))) 1304 | (libpart (lib xtal_NDK) (part NX2520SA-24.000000MHZ) 1305 | (description "f=24MHz, Stability:±10ppm, Tol:±10ppm,Load capacitance:10pF,esr:70 Ohm,Temp:-10°C ~ 60°C") 1306 | (footprints 1307 | (fp NX2520SA)) 1308 | (fields 1309 | (field (name Reference) X) 1310 | (field (name Value) NX2520SA-24.000000MHZ) 1311 | (field (name Footprint) NX2520SA) 1312 | (field (name Description) "f=24MHz, Stability:±10ppm, Tol:±10ppm,Load capacitance:10pF,esr:70 Ohm,Temp:-10°C ~ 60°C") 1313 | (field (name "Part Number") NX2520SA-24.000000MHZ) 1314 | (field (name Manufacturer) NDK) 1315 | (field (name Frequency) 24MHz)) 1316 | (pins 1317 | (pin (num 1) (name 1) (type passive)) 1318 | (pin (num 3) (name 3) (type passive))))) 1319 | (libraries 1320 | (library (logical beads_BLM) 1321 | (uri /Users/jop/git/kicadlib/library/beads_BLM.lib)) 1322 | (library (logical capacitors_murata_GRM) 1323 | (uri /Users/jop/git/kicadlib/library/capacitors_murata_GRM.lib)) 1324 | (library (logical comm) 1325 | (uri /Users/jop/git/kicadlib/library/comm.lib)) 1326 | (library (logical connectors) 1327 | (uri /Users/jop/git/kicadlib/library/connectors.lib)) 1328 | (library (logical cpu) 1329 | (uri /Users/jop/git/kicadlib/library/cpu.lib)) 1330 | (library (logical dcdc) 1331 | (uri /Users/jop/git/kicadlib/library/dcdc.lib)) 1332 | (library (logical esd) 1333 | (uri /Users/jop/git/kicadlib/library/esd.lib)) 1334 | (library (logical nichicon_polymer_cap) 1335 | (uri /Users/jop/git/kicadlib/library/nichicon_polymer_cap.lib)) 1336 | (library (logical power) 1337 | (uri /Users/jop/git/kicadlib/library/power.lib)) 1338 | (library (logical resistors_misc) 1339 | (uri /Users/jop/git/kicadlib/library/resistors_misc.lib)) 1340 | (library (logical transistors) 1341 | (uri /Users/jop/git/kicadlib/library/transistors.lib)) 1342 | (library (logical vishay_IHLP_inductors) 1343 | (uri /Users/jop/git/kicadlib/library/vishay_IHLP_inductors.lib)) 1344 | (library (logical vishay_resistors) 1345 | (uri /Users/jop/git/kicadlib/library/vishay_resistors.lib)) 1346 | (library (logical xtal_NDK) 1347 | (uri /Users/jop/git/kicadlib/library/xtal_NDK.lib))) 1348 | (nets 1349 | (net (code 1) (name "Net-(U1-Pad13)") 1350 | (node (ref U1) (pin 13))) 1351 | (net (code 2) (name "Net-(U1-Pad14)") 1352 | (node (ref U1) (pin 14))) 1353 | (net (code 3) (name "Net-(U1-Pad17)") 1354 | (node (ref U1) (pin 17))) 1355 | (net (code 4) (name "Net-(U1-Pad18)") 1356 | (node (ref U1) (pin 18))) 1357 | (net (code 5) (name "Net-(U1-Pad19)") 1358 | (node (ref U1) (pin 19))) 1359 | (net (code 6) (name "Net-(U1-Pad20)") 1360 | (node (ref U1) (pin 20))) 1361 | (net (code 7) (name "Net-(U1-Pad21)") 1362 | (node (ref U1) (pin 21))) 1363 | (net (code 8) (name "Net-(U1-Pad22)") 1364 | (node (ref U1) (pin 22))) 1365 | (net (code 9) (name /UC_USB_D_N) 1366 | (node (ref U1) (pin 23)) 1367 | (node (ref U3) (pin 3))) 1368 | (net (code 10) (name /UC_USB_D_P) 1369 | (node (ref U1) (pin 24)) 1370 | (node (ref U3) (pin 4))) 1371 | (net (code 11) (name "Net-(U1-Pad25)") 1372 | (node (ref U1) (pin 25))) 1373 | (net (code 12) (name "Net-(U3-Pad12)") 1374 | (node (ref U3) (pin 12))) 1375 | (net (code 13) (name "Net-(C3-Pad1)") 1376 | (node (ref C3) (pin 1)) 1377 | (node (ref C5) (pin 1)) 1378 | (node (ref U3) (pin 14))) 1379 | (net (code 14) (name "Net-(U3-Pad16)") 1380 | (node (ref U3) (pin 16))) 1381 | (net (code 15) (name P3V3) 1382 | (node (ref U3) (pin 10)) 1383 | (node (ref C15) (pin 1)) 1384 | (node (ref C14) (pin 1)) 1385 | (node (ref U3) (pin 13)) 1386 | (node (ref U1) (pin 9)) 1387 | (node (ref U3) (pin 15)) 1388 | (node (ref U3) (pin 17)) 1389 | (node (ref U3) (pin 23)) 1390 | (node (ref C22) (pin 1)) 1391 | (node (ref C20) (pin 1)) 1392 | (node (ref U3) (pin 29)) 1393 | (node (ref U3) (pin 36)) 1394 | (node (ref U3) (pin 5)) 1395 | (node (ref R23) (pin 2)) 1396 | (node (ref U4) (pin 15)) 1397 | (node (ref U4) (pin 2)) 1398 | (node (ref R21) (pin 1)) 1399 | (node (ref U2) (pin 4)) 1400 | (node (ref C13) (pin 1)) 1401 | (node (ref C12) (pin 1)) 1402 | (node (ref C11) (pin 1)) 1403 | (node (ref C10) (pin 1)) 1404 | (node (ref J1) (pin 1)) 1405 | (node (ref C9) (pin 1)) 1406 | (node (ref C8) (pin 1)) 1407 | (node (ref U5) (pin 3)) 1408 | (node (ref U5) (pin 4)) 1409 | (node (ref R14) (pin 2)) 1410 | (node (ref C17) (pin 1)) 1411 | (node (ref U1) (pin 30)) 1412 | (node (ref R10) (pin 1)) 1413 | (node (ref R9) (pin 1)) 1414 | (node (ref L1) (pin 2)) 1415 | (node (ref C26) (pin 1)) 1416 | (node (ref C23) (pin 1)) 1417 | (node (ref C21) (pin 1)) 1418 | (node (ref R13) (pin 2))) 1419 | (net (code 16) (name "Net-(U3-Pad18)") 1420 | (node (ref U3) (pin 18))) 1421 | (net (code 17) (name "Net-(U3-Pad19)") 1422 | (node (ref U3) (pin 19))) 1423 | (net (code 18) (name "Net-(U3-Pad20)") 1424 | (node (ref U3) (pin 20))) 1425 | (net (code 19) (name "Net-(U3-Pad21)") 1426 | (node (ref U3) (pin 21))) 1427 | (net (code 20) (name "Net-(R8-Pad2)") 1428 | (node (ref R8) (pin 2)) 1429 | (node (ref U3) (pin 22))) 1430 | (net (code 21) (name "Net-(R7-Pad2)") 1431 | (node (ref R7) (pin 2)) 1432 | (node (ref U3) (pin 24))) 1433 | (net (code 22) (name "Net-(R6-Pad2)") 1434 | (node (ref R6) (pin 2)) 1435 | (node (ref U3) (pin 25))) 1436 | (net (code 23) (name "Net-(C2-Pad1)") 1437 | (node (ref C2) (pin 1)) 1438 | (node (ref X1) (pin 3)) 1439 | (node (ref U3) (pin 33))) 1440 | (net (code 24) (name "Net-(C6-Pad1)") 1441 | (node (ref C6) (pin 1)) 1442 | (node (ref C7) (pin 1)) 1443 | (node (ref U3) (pin 34))) 1444 | (net (code 25) (name "Net-(R5-Pad1)") 1445 | (node (ref R5) (pin 1)) 1446 | (node (ref U3) (pin 35))) 1447 | (net (code 26) (name "Net-(U3-Pad6)") 1448 | (node (ref U3) (pin 6))) 1449 | (net (code 27) (name "Net-(U3-Pad7)") 1450 | (node (ref U3) (pin 7))) 1451 | (net (code 28) (name "Net-(U3-Pad8)") 1452 | (node (ref U3) (pin 8))) 1453 | (net (code 29) (name "Net-(U3-Pad9)") 1454 | (node (ref U3) (pin 9))) 1455 | (net (code 30) (name /SNS4_P) 1456 | (node (ref J4) (pin 6)) 1457 | (node (ref U4) (pin 10))) 1458 | (net (code 31) (name /SNS2_P) 1459 | (node (ref J4) (pin 10)) 1460 | (node (ref U4) (pin 13))) 1461 | (net (code 32) (name /SNS2_N) 1462 | (node (ref J4) (pin 9)) 1463 | (node (ref U4) (pin 14))) 1464 | (net (code 33) (name "Net-(U4-Pad17)") 1465 | (node (ref U4) (pin 17))) 1466 | (net (code 34) (name /SNS3_N) 1467 | (node (ref J4) (pin 7)) 1468 | (node (ref U4) (pin 7))) 1469 | (net (code 35) (name /SNS3_P) 1470 | (node (ref J4) (pin 8)) 1471 | (node (ref U4) (pin 8))) 1472 | (net (code 36) (name /SNS4_N) 1473 | (node (ref J4) (pin 5)) 1474 | (node (ref U4) (pin 9))) 1475 | (net (code 37) (name P5V0) 1476 | (node (ref C16) (pin 1)) 1477 | (node (ref C27) (pin 1)) 1478 | (node (ref U7) (pin 5)) 1479 | (node (ref R2) (pin 2)) 1480 | (node (ref FB1) (pin 2)) 1481 | (node (ref U2) (pin 7)) 1482 | (node (ref U2) (pin 6)) 1483 | (node (ref U2) (pin 3)) 1484 | (node (ref U6) (pin 1))) 1485 | (net (code 38) (name "Net-(R16-Pad1)") 1486 | (node (ref U6) (pin 5)) 1487 | (node (ref R16) (pin 1))) 1488 | (net (code 39) (name "Net-(L1-Pad1)") 1489 | (node (ref U2) (pin 1)) 1490 | (node (ref U2) (pin 2)) 1491 | (node (ref L1) (pin 1))) 1492 | (net (code 40) (name "Net-(J1-Pad7)") 1493 | (node (ref J1) (pin 7))) 1494 | (net (code 41) (name "Net-(J1-Pad8)") 1495 | (node (ref J1) (pin 8))) 1496 | (net (code 42) (name "Net-(C18-Pad1)") 1497 | (node (ref C18) (pin 1)) 1498 | (node (ref U5) (pin 1))) 1499 | (net (code 43) (name GND) 1500 | (node (ref U1) (pin 10)) 1501 | (node (ref C15) (pin 2)) 1502 | (node (ref C14) (pin 2)) 1503 | (node (ref C13) (pin 2)) 1504 | (node (ref C12) (pin 2)) 1505 | (node (ref C11) (pin 2)) 1506 | (node (ref C10) (pin 2)) 1507 | (node (ref C9) (pin 2)) 1508 | (node (ref C8) (pin 2)) 1509 | (node (ref U1) (pin 28)) 1510 | (node (ref R11) (pin 1)) 1511 | (node (ref U1) (pin 33)) 1512 | (node (ref U3) (pin 11)) 1513 | (node (ref U3) (pin 37)) 1514 | (node (ref J4) (pin 2)) 1515 | (node (ref U4) (pin 3)) 1516 | (node (ref R8) (pin 1)) 1517 | (node (ref R7) (pin 1)) 1518 | (node (ref R6) (pin 1)) 1519 | (node (ref R5) (pin 2)) 1520 | (node (ref U4) (pin 6)) 1521 | (node (ref U6) (pin 2)) 1522 | (node (ref U2) (pin 5)) 1523 | (node (ref C24) (pin 2)) 1524 | (node (ref U2) (pin 8)) 1525 | (node (ref J2) (pin 4)) 1526 | (node (ref J2) (pin 5)) 1527 | (node (ref J2) (pin 6)) 1528 | (node (ref C25) (pin 2)) 1529 | (node (ref U8) (pin 2)) 1530 | (node (ref J3) (pin 7)) 1531 | (node (ref C22) (pin 2)) 1532 | (node (ref C20) (pin 2)) 1533 | (node (ref J3) (pin 6)) 1534 | (node (ref J3) (pin 5)) 1535 | (node (ref U7) (pin 2)) 1536 | (node (ref C19) (pin 2)) 1537 | (node (ref C31) (pin 2)) 1538 | (node (ref C30) (pin 2)) 1539 | (node (ref C29) (pin 2)) 1540 | (node (ref C17) (pin 2)) 1541 | (node (ref C18) (pin 2)) 1542 | (node (ref C4) (pin 2)) 1543 | (node (ref J1) (pin 3)) 1544 | (node (ref R3) (pin 1)) 1545 | (node (ref Q1) (pin 1)) 1546 | (node (ref Q2) (pin 4)) 1547 | (node (ref Q2) (pin 1)) 1548 | (node (ref Q1) (pin 4)) 1549 | (node (ref J1) (pin 5)) 1550 | (node (ref C16) (pin 2)) 1551 | (node (ref C21) (pin 2)) 1552 | (node (ref C23) (pin 2)) 1553 | (node (ref C26) (pin 2)) 1554 | (node (ref C6) (pin 2)) 1555 | (node (ref C3) (pin 2)) 1556 | (node (ref C7) (pin 2)) 1557 | (node (ref C5) (pin 2)) 1558 | (node (ref C2) (pin 2)) 1559 | (node (ref C1) (pin 2)) 1560 | (node (ref C28) (pin 2)) 1561 | (node (ref R15) (pin 1)) 1562 | (node (ref C27) (pin 2)) 1563 | (node (ref R4) (pin 2)) 1564 | (node (ref R16) (pin 2)) 1565 | (node (ref U5) (pin 2)) 1566 | (node (ref J1) (pin 9))) 1567 | (net (code 44) (name "Net-(R4-Pad1)") 1568 | (node (ref R4) (pin 1)) 1569 | (node (ref U3) (pin 28))) 1570 | (net (code 45) (name "Net-(R1-Pad1)") 1571 | (node (ref U3) (pin 32)) 1572 | (node (ref R1) (pin 1))) 1573 | (net (code 46) (name "Net-(C1-Pad1)") 1574 | (node (ref X1) (pin 1)) 1575 | (node (ref C1) (pin 1)) 1576 | (node (ref R1) (pin 2))) 1577 | (net (code 47) (name "Net-(C4-Pad1)") 1578 | (node (ref U3) (pin 27)) 1579 | (node (ref C4) (pin 1)) 1580 | (node (ref R2) (pin 1)) 1581 | (node (ref R3) (pin 2))) 1582 | (net (code 48) (name "Net-(U7-Pad1)") 1583 | (node (ref U7) (pin 1))) 1584 | (net (code 49) (name "Net-(U7-Pad3)") 1585 | (node (ref U7) (pin 3))) 1586 | (net (code 50) (name /USB_D_N) 1587 | (node (ref U7) (pin 6)) 1588 | (node (ref J3) (pin 2)) 1589 | (node (ref U3) (pin 30))) 1590 | (net (code 51) (name "Net-(U8-Pad1)") 1591 | (node (ref U8) (pin 1))) 1592 | (net (code 52) (name "Net-(U8-Pad3)") 1593 | (node (ref U8) (pin 3))) 1594 | (net (code 53) (name /DUT_USB_D_N) 1595 | (node (ref U8) (pin 6)) 1596 | (node (ref J2) (pin 2)) 1597 | (node (ref U3) (pin 1))) 1598 | (net (code 54) (name "Net-(C24-Pad1)") 1599 | (node (ref C24) (pin 1)) 1600 | (node (ref X2) (pin 1)) 1601 | (node (ref R12) (pin 1))) 1602 | (net (code 55) (name /VDDCORE) 1603 | (node (ref U1) (pin 29)) 1604 | (node (ref C19) (pin 1))) 1605 | (net (code 56) (name /DUT_USB_VBUS) 1606 | (node (ref J2) (pin 1)) 1607 | (node (ref U4) (pin 12)) 1608 | (node (ref R22) (pin 1)) 1609 | (node (ref U8) (pin 5)) 1610 | (node (ref C28) (pin 1))) 1611 | (net (code 57) (name /DUT_USB_D_P) 1612 | (node (ref U8) (pin 4)) 1613 | (node (ref U3) (pin 2)) 1614 | (node (ref J2) (pin 3))) 1615 | (net (code 58) (name /RST_N) 1616 | (node (ref U5) (pin 5)) 1617 | (node (ref R23) (pin 1)) 1618 | (node (ref U1) (pin 26)) 1619 | (node (ref U3) (pin 26)) 1620 | (node (ref J1) (pin 10))) 1621 | (net (code 59) (name /I2C_SCL) 1622 | (node (ref R10) (pin 2)) 1623 | (node (ref U1) (pin 2)) 1624 | (node (ref U4) (pin 4))) 1625 | (net (code 60) (name /I2C_SDA) 1626 | (node (ref U1) (pin 1)) 1627 | (node (ref U4) (pin 5)) 1628 | (node (ref R9) (pin 2))) 1629 | (net (code 61) (name /PAC_ALERT_N) 1630 | (node (ref U1) (pin 3)) 1631 | (node (ref U4) (pin 1)) 1632 | (node (ref R13) (pin 1))) 1633 | (net (code 62) (name /PAC_PWRDN_N) 1634 | (node (ref U4) (pin 16)) 1635 | (node (ref R11) (pin 2)) 1636 | (node (ref U1) (pin 4))) 1637 | (net (code 63) (name "Net-(Q1-Pad3)") 1638 | (node (ref R18) (pin 2)) 1639 | (node (ref Q1) (pin 3))) 1640 | (net (code 64) (name "Net-(Q2-Pad6)") 1641 | (node (ref R19) (pin 2)) 1642 | (node (ref Q2) (pin 6))) 1643 | (net (code 65) (name "Net-(Q2-Pad3)") 1644 | (node (ref R20) (pin 2)) 1645 | (node (ref Q2) (pin 3))) 1646 | (net (code 66) (name "Net-(C29-Pad1)") 1647 | (node (ref C29) (pin 1)) 1648 | (node (ref J4) (pin 4)) 1649 | (node (ref R18) (pin 1))) 1650 | (net (code 67) (name "Net-(J3-Pad4)") 1651 | (node (ref J3) (pin 4))) 1652 | (net (code 68) (name "Net-(FB1-Pad1)") 1653 | (node (ref J3) (pin 1)) 1654 | (node (ref FB1) (pin 1))) 1655 | (net (code 69) (name "Net-(Q1-Pad6)") 1656 | (node (ref Q1) (pin 6)) 1657 | (node (ref R17) (pin 2))) 1658 | (net (code 70) (name /SWCLK) 1659 | (node (ref J1) (pin 4)) 1660 | (node (ref R21) (pin 2)) 1661 | (node (ref U1) (pin 31))) 1662 | (net (code 71) (name /SWDIO) 1663 | (node (ref J1) (pin 2)) 1664 | (node (ref U1) (pin 32))) 1665 | (net (code 72) (name /SWO) 1666 | (node (ref J1) (pin 6)) 1667 | (node (ref U1) (pin 27))) 1668 | (net (code 73) (name "Net-(C30-Pad1)") 1669 | (node (ref J4) (pin 1)) 1670 | (node (ref R19) (pin 1)) 1671 | (node (ref C30) (pin 1))) 1672 | (net (code 74) (name "Net-(J4-Pad11)") 1673 | (node (ref J4) (pin 11))) 1674 | (net (code 75) (name "Net-(J4-Pad12)") 1675 | (node (ref J4) (pin 12))) 1676 | (net (code 76) (name "Net-(C31-Pad1)") 1677 | (node (ref J4) (pin 3)) 1678 | (node (ref C31) (pin 1)) 1679 | (node (ref R20) (pin 1))) 1680 | (net (code 77) (name /DUT_DISCHARGE) 1681 | (node (ref Q1) (pin 2)) 1682 | (node (ref U1) (pin 12))) 1683 | (net (code 78) (name /DUT_USB_FLAG_N) 1684 | (node (ref U1) (pin 6)) 1685 | (node (ref R14) (pin 1)) 1686 | (node (ref U6) (pin 4))) 1687 | (net (code 79) (name /DUT_USB_EN) 1688 | (node (ref U6) (pin 3)) 1689 | (node (ref U1) (pin 5)) 1690 | (node (ref R15) (pin 2))) 1691 | (net (code 80) (name /OUT1_EN) 1692 | (node (ref Q1) (pin 5)) 1693 | (node (ref U1) (pin 7))) 1694 | (net (code 81) (name /OUT2_EN) 1695 | (node (ref U1) (pin 8)) 1696 | (node (ref Q2) (pin 2))) 1697 | (net (code 82) (name /OUT3_EN) 1698 | (node (ref Q2) (pin 5)) 1699 | (node (ref U1) (pin 11))) 1700 | (net (code 83) (name /XTAL_OUT) 1701 | (node (ref U1) (pin 16)) 1702 | (node (ref R12) (pin 2))) 1703 | (net (code 84) (name /XTAL_IN) 1704 | (node (ref C25) (pin 1)) 1705 | (node (ref X2) (pin 3)) 1706 | (node (ref U1) (pin 15))) 1707 | (net (code 85) (name "Net-(R17-Pad1)") 1708 | (node (ref R22) (pin 2)) 1709 | (node (ref U4) (pin 11)) 1710 | (node (ref R17) (pin 1)) 1711 | (node (ref U6) (pin 6))) 1712 | (net (code 86) (name /USB_D_P) 1713 | (node (ref U7) (pin 4)) 1714 | (node (ref J3) (pin 3)) 1715 | (node (ref U3) (pin 31))))) -------------------------------------------------------------------------------- /hw/upm.pro: -------------------------------------------------------------------------------- 1 | update=2018 September 13, Thursday 19:22:52 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 | [schematic_editor] 35 | version=1 36 | PageLayoutDescrFile= 37 | PlotDirectoryName= 38 | SubpartIdSeparator=0 39 | SubpartFirstId=65 40 | NetFmtName=Pcbnew 41 | SpiceAjustPassiveValues=0 42 | LabSize=50 43 | ERC_TestSimilarLabels=1 44 | -------------------------------------------------------------------------------- /sw/.gdbinit: -------------------------------------------------------------------------------- 1 | target extended-remote /dev/ttyACM0 2 | set mem inaccessible-by-default off 3 | -------------------------------------------------------------------------------- /sw/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for UPM 2 | 3 | TARGET = upm 4 | 5 | CROSS_COMPILE ?= arm-eabi- 6 | 7 | 8 | CC=$(CROSS_COMPILE)gcc 9 | LD=$(CROSS_COMPILE)ld 10 | AR=$(CROSS_COMPILE)ar 11 | SIZE=$(CROSS_COMPILE)size 12 | STRIP=$(CROSS_COMPILE)strip 13 | OBJCOPY=$(CROSS_COMPILE)objcopy 14 | 15 | GIT_VERSION = $(shell git describe --abbrev=4 --dirty --always --tags) 16 | 17 | CFLAGS = -Wall -Wextra -Wunused-result -O0 -g 18 | CFLAGS += -nostdlib -nostartfiles -mthumb -march=armv6-m -mtune=cortex-m0plus 19 | CFLAGS += -I. -I include/ -Wimplicit-fallthrough=0 20 | CFLAGS += -I CMSIS/CMSIS/Include 21 | CFLAGS += -D__STARTUP_CLEAR_BSS -D__NO_SYSTEM_INIT 22 | CFLAGS += -D__HEAP_SIZE=0 -D__STACK_SIZE=0x100 23 | CFLAGS += -DVERSION=\"$(GIT_VERSION)\" 24 | 25 | LDFLAGS = 26 | ASM_SRCS = 27 | C_SRCS = main.c init.c usb.c i2c.c string.c pac193x.c 28 | 29 | LDFLAGS += -Wl,-Tlink.lds -Wl,--build-id=none $(CFLAGS) 30 | 31 | OBJS = $(ASM_SRCS:.S=.o) $(C_SRCS:.c=.o) 32 | 33 | all: $(TARGET).bin 34 | 35 | showsize: 36 | @echo "VERSION = $(GIT_VERSION)" 37 | @$(SIZE) -A $< 38 | 39 | $(TARGET).bin: $(TARGET) 40 | @echo OBJCOPY $< $@ 41 | @$(OBJCOPY) -O binary -R .comment $< $@ 42 | 43 | $(TARGET): $(OBJS) 44 | @echo LINK $@ 45 | @$(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $@ 46 | 47 | %.o: %.S 48 | @echo CC $< 49 | @$(CC) -c $(CFLAGS) $< -o $@ 50 | 51 | %.o: %.c 52 | @echo CC $< 53 | @$(CC) -c $(CFLAGS) $< -o $@ 54 | 55 | clean: 56 | @-rm -rf *.o $(TARGET) $(TARGET).bin *.map out 57 | @-rm -f $(OBJS) 58 | 59 | -------------------------------------------------------------------------------- /sw/i2c.c: -------------------------------------------------------------------------------- 1 | /** 2 | * UPM 3 | * 4 | * Copyright (C) 2018 Jonas Persson 5 | * 6 | * SPDX-License-Identifier: BSD-3-Clause 7 | * 8 | */ 9 | 10 | #include 11 | #include 12 | #include "samd21.h" 13 | #include "upm.h" 14 | #include "i2c.h" 15 | 16 | #define I2C_BUFFER_SIZE 16 17 | 18 | static uint32_t base; 19 | 20 | void i2c_init(uint32_t _base) 21 | { 22 | uint32_t reg; 23 | 24 | base = _base; 25 | /* Set I2C Master mode */ 26 | 27 | write32(base + I2C_CTRLA, 1); 28 | while((read32(base + I2C_CTRLA) & 1) == 1); 29 | 30 | 31 | write32(base + I2C_CTRLB, (1 << 8)); 32 | while (read32(base + I2C_SYNCBUSY) & 7); 33 | 34 | /* Configure baud rate 35 | * 36 | * f_ref = 48MHz, f_Baud = 100kHz 37 | * 38 | * BAUD = f_ref / (2 * f_Baud) - 1 = 239 39 | * 40 | */ 41 | write32(base + I2C_BAUD, 239); 42 | 43 | while (read32(base + I2C_SYNCBUSY) & 7); 44 | 45 | /* Enable I2C Master mode */ 46 | write32(base + I2C_CTRLA, (0x03 << 20) | (0x05 << 2) | (1 << 1)); 47 | 48 | while (read32(base + I2C_SYNCBUSY) & 7); 49 | 50 | reg = read16(base + I2C_STATUS); 51 | reg |= (1 << 4); 52 | write16(base + I2C_STATUS, reg); 53 | 54 | while (read32(base + I2C_SYNCBUSY) & 7); 55 | 56 | /* Enable IRQ's */ 57 | write8(base+I2C_INTSET, 0x03); 58 | while (read32(base + I2C_SYNCBUSY) & 7); 59 | 60 | } 61 | 62 | 63 | uint32_t i2c_start(uint8_t addr) 64 | { 65 | uint32_t reg; 66 | 67 | write8(base + I2C_INTFLAG, I2C_IRQ_ERR); 68 | 69 | write32(base + I2C_ADDR, addr); 70 | 71 | while (!(read8(base + I2C_INTFLAG) & 0x03)); 72 | 73 | reg = read16(base + I2C_STATUS); 74 | 75 | if ( (reg & 0x02) || (reg & 1) ) 76 | { 77 | reg = read32(base + I2C_CTRLB); 78 | reg |= (3 << 16); 79 | write32(base + I2C_CTRLB, reg); 80 | return 1; 81 | } 82 | 83 | return 0; 84 | } 85 | 86 | uint32_t i2c_stop(void) 87 | { 88 | uint32_t reg; 89 | 90 | 91 | if (read8(base + I2C_INTFLAG) & 0x03) 92 | { 93 | reg = read32(base + I2C_CTRLB); 94 | reg |= (3 << 16); 95 | write32(base + I2C_CTRLB, reg); 96 | } 97 | 98 | return 0; 99 | } 100 | 101 | uint32_t i2c_read_byte(uint8_t *b, bool last) 102 | { 103 | uint32_t reg; 104 | 105 | while(1) 106 | { 107 | reg = read8(base + I2C_INTFLAG); 108 | 109 | if (reg & I2C_IRQ_SB) 110 | break; 111 | 112 | if ((reg & I2C_IRQ_MB) || (reg & I2C_IRQ_ERR)) 113 | return 1; 114 | } 115 | 116 | reg = read32(base + I2C_CTRLB); 117 | 118 | if (last) 119 | reg |= (1 << 18) | (3 << 16); 120 | else 121 | reg &= ~(1 << 18); 122 | 123 | write32(base + I2C_CTRLB, reg); 124 | 125 | *b = read8(base + I2C_DATA); 126 | 127 | return 0; 128 | } 129 | 130 | uint32_t i2c_write_byte(uint8_t b) 131 | { 132 | uint32_t reg; 133 | 134 | write32(base + I2C_DATA, b); 135 | 136 | while(1) 137 | { 138 | reg = read8(base + I2C_INTFLAG); 139 | 140 | if (reg & I2C_IRQ_MB) 141 | break; 142 | 143 | if ((reg & I2C_IRQ_SB) || (reg & I2C_IRQ_ERR)) 144 | return 1; 145 | } 146 | 147 | reg = read8(base + I2C_STATUS); 148 | 149 | if (reg & 0x04) 150 | { 151 | reg = read32(base + I2C_CTRLB); 152 | reg |= (3 << 16); 153 | write32(base + I2C_CTRLB, reg); 154 | return 1; 155 | } 156 | 157 | return 0; 158 | } 159 | -------------------------------------------------------------------------------- /sw/i2c.h: -------------------------------------------------------------------------------- 1 | /** 2 | * UPM 3 | * 4 | * Copyright (C) 2018 Jonas Persson 5 | * 6 | * SPDX-License-Identifier: BSD-3-Clause 7 | * 8 | */ 9 | 10 | #ifndef __I2C_H__ 11 | #define __I2C_H__ 12 | 13 | #include 14 | #include 15 | 16 | /* SERCOM / I2C Master */ 17 | 18 | #define I2C_CTRLA 0x00 19 | #define I2C_CTRLB 0x04 20 | #define I2C_BAUD 0x0C 21 | #define I2C_DATA 0x28 22 | #define I2C_STATUS 0x1A 23 | #define I2C_SYNCBUSY 0x1C 24 | #define I2C_ADDR 0x24 25 | #define I2C_INTSET 0x16 26 | #define I2C_INTFLAG 0x18 27 | 28 | #define I2C_IRQ_MB 0x01 29 | #define I2C_IRQ_SB 0x02 30 | #define I2C_IRQ_ERR 0x80 31 | 32 | 33 | void i2c_init(uint32_t _base); 34 | uint32_t i2c_write_byte(uint8_t b); 35 | uint32_t i2c_read_byte(uint8_t *b, bool last); 36 | uint32_t i2c_stop(void); 37 | uint32_t i2c_start(uint8_t addr); 38 | 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /sw/init.c: -------------------------------------------------------------------------------- 1 | /** 2 | * UPM 3 | * 4 | * Copyright (C) 2018 Jonas Persson 5 | * 6 | * SPDX-License-Identifier: BSD-3-Clause 7 | * 8 | */ 9 | 10 | #include 11 | #include "samd21.h" 12 | 13 | extern uint32_t _etext; 14 | extern uint32_t _srelocate; 15 | extern uint32_t _erelocate; 16 | extern uint32_t _sbss; 17 | extern uint32_t _ebss; 18 | extern uint32_t _sstack; 19 | extern uint32_t _estack; 20 | 21 | extern int main(void); 22 | 23 | #ifndef __STACK_SIZE 24 | #define __STACK_SIZE 1024 25 | #endif 26 | 27 | uint8_t stack[__STACK_SIZE] __attribute__ ((section(".stack"))); 28 | 29 | /* Default empty handler */ 30 | void dummy_handler(void); 31 | 32 | /* Cortex-M0+ core handlers */ 33 | void nmi_handler ( void ) __attribute__ ((weak, alias("dummy_handler"))); 34 | void hardfault_handler ( void ) __attribute__ ((weak, alias("dummy_handler"))); 35 | void svc_handler ( void ) __attribute__ ((weak, alias("dummy_handler"))); 36 | void pendsv_handler ( void ) __attribute__ ((weak, alias("dummy_handler"))); 37 | void systick_handler ( void ) __attribute__ ((weak, alias("dummy_handler"))); 38 | 39 | /* Peripherals handlers */ 40 | void pm_handler ( void ) __attribute__ ((weak, alias("dummy_handler"))); 41 | void sysctrl_handler ( void ) __attribute__ ((weak, alias("dummy_handler"))); 42 | void wdt_handler ( void ) __attribute__ ((weak, alias("dummy_handler"))); 43 | void rtc_handler ( void ) __attribute__ ((weak, alias("dummy_handler"))); 44 | void eic_handler ( void ) __attribute__ ((weak, alias("dummy_handler"))); 45 | void nvmctrl_handler ( void ) __attribute__ ((weak, alias("dummy_handler"))); 46 | void dmac_handler ( void ) __attribute__ ((weak, alias("dummy_handler"))); 47 | void usb_handler ( void ) __attribute__ ((weak, alias("dummy_handler"))); 48 | void evsys_handler ( void ) __attribute__ ((weak, alias("dummy_handler"))); 49 | void sercom0_handler ( void ) __attribute__ ((weak, alias("dummy_handler"))); 50 | void sercom1_handler ( void ) __attribute__ ((weak, alias("dummy_handler"))); 51 | void sercom2_handler ( void ) __attribute__ ((weak, alias("dummy_handler"))); 52 | void sercom3_handler ( void ) __attribute__ ((weak, alias("dummy_handler"))); 53 | void sercom4_handler ( void ) __attribute__ ((weak, alias("dummy_handler"))); 54 | void sercom5_handler ( void ) __attribute__ ((weak, alias("dummy_handler"))); 55 | void tcc0_handler ( void ) __attribute__ ((weak, alias("dummy_handler"))); 56 | void tcc1_handler ( void ) __attribute__ ((weak, alias("dummy_handler"))); 57 | void tcc2_handler ( void ) __attribute__ ((weak, alias("dummy_handler"))); 58 | void tc3_handler ( void ) __attribute__ ((weak, alias("dummy_handler"))); 59 | void tc4_handler ( void ) __attribute__ ((weak, alias("dummy_handler"))); 60 | void tc5_handler ( void ) __attribute__ ((weak, alias("dummy_handler"))); 61 | void tc6_handler ( void ) __attribute__ ((weak, alias("dummy_handler"))); 62 | void tc7_handler ( void ) __attribute__ ((weak, alias("dummy_handler"))); 63 | void adc_handler ( void ) __attribute__ ((weak, alias("dummy_handler"))); 64 | void ac_handler ( void ) __attribute__ ((weak, alias("dummy_handler"))); 65 | void dac_handler ( void ) __attribute__ ((weak, alias("dummy_handler"))); 66 | void ptc_handler ( void ) __attribute__ ((weak, alias("dummy_handler"))); 67 | void i2s_handler ( void ) __attribute__ ((weak, alias("dummy_handler"))); 68 | 69 | void dummy_handler(void) 70 | { 71 | while(1) 72 | asm("nop"); 73 | } 74 | 75 | void reset_handler(void) 76 | { 77 | uint32_t *pSrc, *pDest; 78 | uint32_t reg; 79 | 80 | /* Initialize the relocate segment */ 81 | pSrc = &_etext; 82 | pDest = &_srelocate; 83 | 84 | if (pSrc != pDest) { 85 | for (; pDest < &_erelocate;) { 86 | *pDest++ = *pSrc++; 87 | } 88 | } 89 | 90 | /* Clear the zero segment */ 91 | for (pDest = &_sbss; pDest < &_ebss;) { 92 | *pDest++ = 0; 93 | } 94 | 95 | /* Configure flash wait state */ 96 | write32(NVMCTRL+NVMCTRL_CTRLB, (1 << 1)); /* 1 WS at 48MHz*/ 97 | 98 | /* Reset SYSCTRL INT Status */ 99 | write32(SYSCTRL+SYSCTRL_INTFLAG, 0xFFFFFFFF); 100 | 101 | /* Enable XOSC, with gain setting for a 16 MHz */ 102 | reg = (0x07 << 12) | /* Start-up delay */ 103 | (0x03 << 8 ) | /* Gain setting */ 104 | (0x01 << 6) | /* Ondemand*/ 105 | (0x01 << 2 ); /* XTALEN */ 106 | 107 | write32(SYSCTRL+SYSCTRL_XOSC, reg); 108 | 109 | reg |= (1 << 1); /* Enable oscillator */ 110 | 111 | write32(SYSCTRL+SYSCTRL_XOSC, reg); 112 | 113 | 114 | /* Wait for oscillator ready */ 115 | while (!(read32(SYSCTRL+SYSCTRL_PCLKSR) & 0x01)); 116 | 117 | 118 | /* Disable DPLL */ 119 | write32(SYSCTRL+SYSCTRL_DPLLCTRLA, 0); 120 | 121 | /** 122 | * fdpll96m_ref = f_xosc * ( 1 / (2 * (DIV + 1))) = 123 | * = 16E6 * (1/(2*(7 + 1))) = 1 MHz 124 | * DIV = 7 125 | */ 126 | 127 | write32(SYSCTRL+SYSCTRL_DPLLCTRLB, (7 << 16) | /* DIV */ 128 | (1 << 4)); /* Refclk = XOSC*/ 129 | 130 | /** 131 | * fdpll96m = fdpll96m_ref * (LDR + 1 + LDFRAC/16) = 132 | * = 1e6 * (47 + 1 + 0/16) = 48 MHz 133 | * 134 | */ 135 | 136 | write32(SYSCTRL+SYSCTRL_DPLLRATIO, 47); 137 | 138 | /* Enable DPLL */ 139 | 140 | write32(SYSCTRL+SYSCTRL_DPLLCTRLA, (1 << 6) | 2); 141 | 142 | /* Wait for PLL lock */ 143 | 144 | while (read32(SYSCTRL+SYSCTRL_DPLLSTATUS) != 0x0F); 145 | 146 | 147 | write32(GCLK+GCLK_GENCTRL, (1 << 16) | 148 | (0x08 << 8)); /* SRC = FDPLL96 */ 149 | 150 | main(); 151 | 152 | while (1); 153 | } 154 | 155 | __attribute__ ((section(".vectors"))) 156 | const void * exception_vectors[] = { 157 | (void *) &stack[__STACK_SIZE-1], 158 | (void *) &reset_handler, 159 | (void*) nmi_handler, 160 | (void*) hardfault_handler, 161 | (void*) (0ul), /* reserved */ 162 | (void*) (0ul), /* reserved */ 163 | (void*) (0ul), /* reserved */ 164 | (void*) (0ul), /* reserved */ 165 | (void*) (0ul), /* reserved */ 166 | (void*) (0ul), /* reserved */ 167 | (void*) (0ul), /* reserved */ 168 | (void*) svc_handler, 169 | (void*) (0ul), /* reserved */ 170 | (void*) (0ul), /* reserved */ 171 | (void*) pendsv_handler, 172 | (void*) systick_handler, 173 | 174 | /* configurable interrupts */ 175 | (void*) pm_handler, /* 0 power manager */ 176 | (void*) sysctrl_handler, /* 1 system control */ 177 | (void*) wdt_handler, /* 2 watchdog timer */ 178 | (void*) rtc_handler, /* 3 real-time counter */ 179 | (void*) eic_handler, /* 4 external interrupt controller */ 180 | (void*) nvmctrl_handler, /* 5 non-volatile memory controller */ 181 | (void*) dmac_handler, /* 6 direct memory access controller */ 182 | (void*) usb_handler, /* 7 universal serial bus */ 183 | (void*) evsys_handler, /* 8 event system interface */ 184 | (void*) sercom0_handler, /* 9 serial communication interface 0 */ 185 | (void*) sercom1_handler, /* 10 serial communication interface 1 */ 186 | (void*) sercom2_handler, /* 11 serial communication interface 2 */ 187 | (void*) sercom3_handler, /* 12 serial communication interface 3 */ 188 | (void*) sercom4_handler, /* 13 serial communication interface 4 */ 189 | (void*) sercom5_handler, /* 14 serial communication interface 5 */ 190 | (void*) tcc0_handler, /* 15 timer counter control 0 */ 191 | (void*) tcc1_handler, /* 16 timer counter control 1 */ 192 | (void*) tcc2_handler, /* 17 timer counter control 2 */ 193 | (void*) tc3_handler, /* 18 basic timer counter 0 */ 194 | (void*) tc4_handler, /* 19 basic timer counter 1 */ 195 | (void*) tc5_handler, /* 20 basic timer counter 2 */ 196 | (void*) tc6_handler, /* 21 basic timer counter 3 */ 197 | (void*) tc7_handler, /* 22 basic timer counter 4 */ 198 | (void*) adc_handler, /* 23 analog digital converter */ 199 | (void*) ac_handler, /* 24 analog comparators */ 200 | (void*) dac_handler, /* 25 digital analog converter */ 201 | (void*) ptc_handler, /* 26 peripheral touch controller */ 202 | (void*) i2s_handler /* 27 inter-ic sound interface */ 203 | }; 204 | -------------------------------------------------------------------------------- /sw/link.lds: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf32-littlearm") 2 | OUTPUT_ARCH("arm") 3 | 4 | MEMORY 5 | { 6 | flash (rw) : ORIGIN = 0x00000000, LENGTH = 32K 7 | sram (rwx) : ORIGIN = 0x20000000, LENGTH = 4K 8 | } 9 | 10 | ENTRY(reset_handler) 11 | 12 | SECTIONS 13 | { 14 | . = ORIGIN(flash); 15 | 16 | .vectors : 17 | { 18 | KEEP(*(.vectors .vectors.*)) 19 | } > flash 20 | 21 | .text : 22 | { 23 | _stext = .; 24 | *(.rodata .rodata*); 25 | *(.text .text*); 26 | . = ALIGN(4); 27 | _etext = .; 28 | } > flash 29 | 30 | . = ALIGN(4); 31 | 32 | .relocate : AT(_etext) 33 | { 34 | _srelocate = .; 35 | *(.data .data.*); 36 | . = ALIGN(4); 37 | _erelocate = .; 38 | } > sram 39 | 40 | . = ALIGN(4); 41 | 42 | .bss (NOLOAD) : 43 | { 44 | _sbss = .; 45 | *(.bss .bss.*) 46 | . = ALIGN(4); 47 | _ebss = .; 48 | } > sram 49 | 50 | .stack (NOLOAD): 51 | { 52 | . = ALIGN(8); 53 | _sstack = .; 54 | KEEP(*(.stack* .stack.*)) 55 | _estack = .; 56 | } > sram 57 | 58 | } 59 | -------------------------------------------------------------------------------- /sw/main.c: -------------------------------------------------------------------------------- 1 | /** 2 | * UPM 3 | * 4 | * Copyright (C) 2018 Jonas Persson 5 | * 6 | * SPDX-License-Identifier: BSD-3-Clause 7 | * 8 | */ 9 | #include 10 | 11 | #include "samd21.h" 12 | #include "usb.h" 13 | #include "upm.h" 14 | #include "i2c.h" 15 | #include "protocol.h" 16 | #include "pac193x.h" 17 | 18 | int main(void) 19 | { 20 | uint32_t reg; 21 | 22 | /* Unused PIN Configuration */ 23 | write32(PORT + PORT_DIRSET, UNUSED_PINS); 24 | write32(PORT + PORT_OUTCLR, UNUSED_PINS); 25 | 26 | /* Configure outputs */ 27 | write32(PORT + PORT_DIRSET, PIN_DUT_USB_EN); 28 | write32(PORT + PORT_DIRSET, PIN_PACPWRDN_N); 29 | write32(PORT + PORT_DIRSET, PIN_OUT1_EN); 30 | write32(PORT + PORT_DIRSET, PIN_OUT2_EN); 31 | write32(PORT + PORT_DIRSET, PIN_OUT3_EN); 32 | write32(PORT + PORT_DIRSET, PIN_DUT_DISCHARGE); 33 | 34 | /* Configure inputs */ 35 | write32(PORT + PORT_DIRCLR, PIN_PAC_ALERT_N); 36 | write32(PORT + PORT_DIRCLR, PIN_DUT_USB_FLAG_N); 37 | 38 | 39 | /* Set output default values */ 40 | write32(PORT + PORT_OUTSET, PIN_DUT_USB_EN); 41 | write32(PORT + PORT_OUTSET, PIN_PACPWRDN_N); 42 | write32(PORT + PORT_OUTCLR, PIN_OUT1_EN); 43 | write32(PORT + PORT_OUTCLR, PIN_OUT2_EN); 44 | write32(PORT + PORT_OUTCLR, PIN_OUT3_EN); 45 | write32(PORT + PORT_OUTCLR, PIN_DUT_DISCHARGE); 46 | 47 | /* PAD Mux */ 48 | 49 | /* PA1 = Sercom1/pad1, PA0 = Sercom1/pad0 */ 50 | 51 | write32(PORT + PORT_WRCONFIG, (1 << 30) | (1 << 28) | 52 | (MUX_D << 24) | 53 | (1 << 16) | 54 | (1 << 0) | 55 | (1 << 1)); 56 | 57 | /* PA25 = USB_DP, PA24 = USB_DM */ 58 | 59 | write32(PORT + PORT_WRCONFIG, (1 << 31) | (1 << 30) | (1 << 28) | 60 | (MUX_G << 24) | 61 | (1 << 16) | 62 | (1 << 8) | 63 | (1 << 9)); 64 | 65 | 66 | /* Enable SERCOM 1 clock */ 67 | reg = read32(PM + PM_APBCMASK); 68 | reg |= (1 << 3); 69 | write32(PM + PM_APBCMASK, reg); 70 | 71 | write16(GCLK + GCLK_CLKCTRL, (1 << 14) | GCLK_ID_SERCOMx_SLOW); 72 | write16(GCLK + GCLK_CLKCTRL, (1 << 14) | GCLK_ID_SERCOM1_CORE); 73 | 74 | //write32(NVIC_ISER, (1 << SERCOM1_IRQn)); 75 | 76 | i2c_init(SERCOM1); 77 | 78 | 79 | /* Enable and connect USB clock to generator 0 */ 80 | write16(GCLK + GCLK_CLKCTRL, (1 << 14) | GCLK_ID_USB); 81 | 82 | pac193x_init(0x20); 83 | 84 | usb_init(USB); 85 | struct upm_in in; 86 | 87 | while(1) 88 | { 89 | usb_task(); 90 | 91 | if (usb_enumerated()) 92 | { 93 | 94 | pac193x_refresh(); 95 | 96 | for (uint32_t i = 0; i < 0xfff; i++) 97 | asm("nop"); 98 | 99 | for (uint32_t i = 0; i < 4; i++) 100 | { 101 | in.Vbus[i] = pac193x_vbus(i); 102 | in.Vsns[i] = pac193x_vsns(i); 103 | pac193x_pwr(i, in.Ereg[i]); 104 | } 105 | 106 | usb_send((uint8_t *) &in, sizeof(struct upm_in)); 107 | 108 | if (usb_has_data()) 109 | { 110 | struct upm_out *out = (struct upm_out *) usb_get_buf(); 111 | 112 | if (out->outputs_set & (1 << 0)) 113 | { 114 | in.outputs |= (1 << 0); 115 | write32(PORT + PORT_OUTCLR, PIN_DUT_DISCHARGE); 116 | write32(PORT + PORT_OUTSET, PIN_DUT_USB_EN); 117 | } 118 | 119 | if (out->outputs_clr & (1 << 0)) 120 | { 121 | in.outputs &= ~(1 << 0); 122 | write32(PORT + PORT_OUTSET, PIN_DUT_DISCHARGE); 123 | write32(PORT + PORT_OUTCLR, PIN_DUT_USB_EN); 124 | } 125 | 126 | 127 | if (out->outputs_set & (1 << 1)) 128 | { 129 | in.outputs |= (1 << 1); 130 | write32(PORT + PORT_OUTSET, PIN_OUT1_EN); 131 | } 132 | 133 | 134 | if (out->outputs_clr & (1 << 1)) 135 | { 136 | in.outputs &= ~(1 << 1); 137 | write32(PORT + PORT_OUTCLR, PIN_OUT1_EN); 138 | } 139 | 140 | 141 | if (out->outputs_set & (1 << 2)) 142 | { 143 | in.outputs |= (1 << 2); 144 | write32(PORT + PORT_OUTSET, PIN_OUT2_EN); 145 | } 146 | 147 | 148 | if (out->outputs_clr & (1 << 2)) 149 | { 150 | in.outputs &= ~(1 << 2); 151 | write32(PORT + PORT_OUTCLR, PIN_OUT2_EN); 152 | } 153 | 154 | 155 | if (out->outputs_set & (1 << 3)) 156 | { 157 | in.outputs |= (1 << 3); 158 | write32(PORT + PORT_OUTSET, PIN_OUT3_EN); 159 | } 160 | 161 | 162 | if (out->outputs_clr & (1 << 3)) 163 | { 164 | in.outputs &= ~(1 << 3); 165 | write32(PORT + PORT_OUTCLR, PIN_OUT3_EN); 166 | } 167 | 168 | if (out->counter_reset & (1 << 0)) 169 | { 170 | pac193x_reset_counters(); 171 | } 172 | 173 | } 174 | 175 | } 176 | } 177 | } 178 | -------------------------------------------------------------------------------- /sw/pac193x.c: -------------------------------------------------------------------------------- 1 | /** 2 | * UPM 3 | * 4 | * Copyright (C) 2018 Jonas Persson 5 | * 6 | * SPDX-License-Identifier: BSD-3-Clause 7 | * 8 | */ 9 | 10 | #include 11 | #include "samd21.h" 12 | #include "upm.h" 13 | #include "pac193x.h" 14 | #include "i2c.h" 15 | 16 | static uint8_t addr; 17 | 18 | uint32_t pac193x_init(uint8_t _addr) 19 | { 20 | 21 | addr = _addr; 22 | 23 | /* PAC1934 needs 14ms before it is possible to communicate */ 24 | for (uint32_t i = 0; i < 0xfffff; i++) 25 | asm("nop"); 26 | 27 | i2c_start(addr); 28 | i2c_write_byte(0x01); 29 | i2c_start(addr); 30 | i2c_write_byte(0); 31 | i2c_stop(); 32 | 33 | 34 | i2c_start(addr); 35 | i2c_write_byte(0x1E); 36 | i2c_stop(); 37 | return 0; 38 | } 39 | 40 | void pac193x_refresh(void) 41 | { 42 | i2c_start(addr); 43 | i2c_write_byte(0x1F); 44 | i2c_stop(); 45 | } 46 | 47 | 48 | void pac193x_reset_counters(void) 49 | { 50 | i2c_start(addr); 51 | i2c_write_byte(0x00); 52 | i2c_stop(); 53 | } 54 | 55 | 56 | uint16_t pac193x_vbus(uint8_t ch) 57 | { 58 | uint8_t b0, b1; 59 | 60 | i2c_start(addr); 61 | i2c_write_byte(0x0f + (ch & 0x03)); 62 | i2c_start(addr | 1); 63 | i2c_read_byte(&b0, false); 64 | i2c_read_byte(&b1, true); 65 | i2c_stop(); 66 | 67 | return (b0 << 8) | b1; 68 | } 69 | 70 | uint16_t pac193x_vsns(uint8_t ch) 71 | { 72 | uint8_t b0, b1; 73 | 74 | i2c_start(addr); 75 | i2c_write_byte(0x13 + (ch & 0x03)); 76 | i2c_start(addr | 1); 77 | i2c_read_byte(&b0, false); 78 | i2c_read_byte(&b1, true); 79 | i2c_stop(); 80 | 81 | return (b0 << 8) | b1; 82 | } 83 | 84 | void pac193x_pwr(uint8_t ch, uint8_t *out) 85 | { 86 | 87 | i2c_start(addr); 88 | i2c_write_byte(0x03 + (ch & 0x03)); 89 | i2c_start(addr | 1); 90 | i2c_read_byte(&out[5], false); 91 | i2c_read_byte(&out[4], false); 92 | i2c_read_byte(&out[3], false); 93 | i2c_read_byte(&out[2], false); 94 | i2c_read_byte(&out[1], false); 95 | i2c_read_byte(&out[0], true); 96 | i2c_stop(); 97 | 98 | } 99 | -------------------------------------------------------------------------------- /sw/pac193x.h: -------------------------------------------------------------------------------- 1 | /** 2 | * UPM 3 | * 4 | * Copyright (C) 2018 Jonas Persson 5 | * 6 | * SPDX-License-Identifier: BSD-3-Clause 7 | * 8 | */ 9 | 10 | #ifndef __PAC193X_H__ 11 | #define __PAC193X_H__ 12 | 13 | #include 14 | 15 | uint32_t pac193x_init(uint8_t _addr); 16 | void pac193x_refresh(void); 17 | uint16_t pac193x_vbus(uint8_t ch); 18 | uint16_t pac193x_vsns(uint8_t ch); 19 | void pac193x_pwr(uint8_t ch, uint8_t *out); 20 | void pac193x_reset_counters(void); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /sw/protocol.h: -------------------------------------------------------------------------------- 1 | /** 2 | * UPM 3 | * 4 | * Copyright (C) 2018 Jonas Persson 5 | * 6 | * SPDX-License-Identifier: BSD-3-Clause 7 | * 8 | */ 9 | 10 | #ifndef __PROTOCOL_H__ 11 | #define __PROTOCOL_H__ 12 | 13 | #include 14 | 15 | struct upm_out { 16 | uint32_t counter_reset; 17 | uint32_t outputs_set; 18 | uint32_t outputs_clr; 19 | } __attribute__ ((packed)); 20 | 21 | struct upm_in { 22 | uint16_t Vbus[4]; 23 | uint16_t Vsns[4]; 24 | uint8_t Ereg[4][6]; 25 | uint32_t outputs; 26 | } __attribute__ ((packed)); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /sw/samd21.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * UPM 4 | * 5 | * Copyright (C) 2018 Jonas Persson 6 | * 7 | * SPDX-License-Identifier: BSD-3-Clause 8 | * 9 | */ 10 | #ifndef __SAMD21_H__ 11 | #define __SAMD21_H__ 12 | 13 | #include 14 | 15 | static inline void write32(uint32_t reg, uint32_t val) 16 | { 17 | *((volatile uint32_t *) reg) = val; 18 | } 19 | 20 | static inline uint32_t read32(uint32_t reg) 21 | { 22 | return *((volatile uint32_t *)reg); 23 | } 24 | 25 | 26 | static inline void write16(uint32_t reg, uint16_t val) 27 | { 28 | *((volatile uint16_t *) reg) = val; 29 | } 30 | 31 | static inline uint16_t read16(uint32_t reg) 32 | { 33 | return *((volatile uint16_t *)reg); 34 | } 35 | 36 | 37 | static inline void write8(uint32_t reg, uint8_t val) 38 | { 39 | *((volatile uint8_t *) reg) = val; 40 | } 41 | 42 | static inline uint8_t read8(uint32_t reg) 43 | { 44 | return *((volatile uint8_t *)reg); 45 | } 46 | 47 | /* Cortex M0+ Registers */ 48 | 49 | #define SCS_BASE (0xE000E000) 50 | #define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */ 51 | #define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */ 52 | #define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ 53 | 54 | #define NVIC_ISER (NVIC_BASE + 0x000) 55 | #define NVIC_ICER (NVIC_BASE + 0x080) 56 | #define NVIC_ISPR (NVIC_BASE + 0x100) 57 | #define NVIC_ICPR (NVIC_BASE + 0x180) 58 | #define NVIC_IP (NVIC_BASE + 0x300) 59 | 60 | /* SAMD21 Registers */ 61 | 62 | #define AC (0x42004400) /**< \brief (AC) APB Base Address */ 63 | #define ADC (0x42004000) /**< \brief (ADC) APB Base Address */ 64 | #define DAC (0x42004800) /**< \brief (DAC) APB Base Address */ 65 | #define DMAC (0x41004800) /**< \brief (DMAC) APB Base Address */ 66 | #define DSU (0x41002000) /**< \brief (DSU) APB Base Address */ 67 | #define EIC (0x40001800) /**< \brief (EIC) APB Base Address */ 68 | #define EVSYS (0x42000400) /**< \brief (EVSYS) APB Base Address */ 69 | #define GCLK (0x40000C00) /**< \brief (GCLK) APB Base Address */ 70 | #define SBMATRIX (0x41007000) /**< \brief (SBMATRIX) APB Base Address */ 71 | #define I2S (0x42005000) /**< \brief (I2S) APB Base Address */ 72 | #define MTB (0x41006000) /**< \brief (MTB) APB Base Address */ 73 | #define NVMCTRL_AUX3 (0x0080A000) /**< \brief (NVMCTRL) AUX3 Base Address */ 74 | #define NVMCTRL (0x41004000) /**< \brief (NVMCTRL) APB Base Address */ 75 | #define NVMCTRL_CAL (0x00800000) /**< \brief (NVMCTRL) CAL Base Address */ 76 | #define NVMCTRL_LOCKBIT (0x00802000) /**< \brief (NVMCTRL) LOCKBIT Base Address */ 77 | #define NVMCTRL_OTP1 (0x00806000) /**< \brief (NVMCTRL) OTP1 Base Address */ 78 | #define NVMCTRL_OTP2 (0x00806008) /**< \brief (NVMCTRL) OTP2 Base Address */ 79 | #define NVMCTRL_OTP4 (0x00806020) /**< \brief (NVMCTRL) OTP4 Base Address */ 80 | #define NVMCTRL_TEMP_LOG (0x00806030) /**< \brief (NVMCTRL) TEMP_LOG Base Address */ 81 | #define NVMCTRL_USER (0x00804000) /**< \brief (NVMCTRL) USER Base Address */ 82 | #define PAC0 (0x40000000) /**< \brief (PAC0) APB Base Address */ 83 | #define PAC1 (0x41000000) /**< \brief (PAC1) APB Base Address */ 84 | #define PAC2 (0x42000000) /**< \brief (PAC2) APB Base Address */ 85 | #define PM (0x40000400) /**< \brief (PM) APB Base Address */ 86 | #define PORT (0x41004400) /**< \brief (PORT) APB Base Address */ 87 | #define PORT_IOBUS (0x60000000) /**< \brief (PORT) IOBUS Base Address */ 88 | #define PTC (0x42004C00) /**< \brief (PTC) APB Base Address */ 89 | #define RTC (0x40001400) /**< \brief (RTC) APB Base Address */ 90 | #define SERCOM0 (0x42000800) /**< \brief (SERCOM0) APB Base Address */ 91 | #define SERCOM1 (0x42000C00) /**< \brief (SERCOM1) APB Base Address */ 92 | #define SERCOM2 (0x42001000) /**< \brief (SERCOM2) APB Base Address */ 93 | #define SERCOM3 (0x42001400) /**< \brief (SERCOM3) APB Base Address */ 94 | #define SYSCTRL (0x40000800) /**< \brief (SYSCTRL) APB Base Address */ 95 | #define TC3 (0x42002C00) /**< \brief (TC3) APB Base Address */ 96 | #define TC4 (0x42003000) /**< \brief (TC4) APB Base Address */ 97 | #define TC5 (0x42003400) /**< \brief (TC5) APB Base Address */ 98 | #define TCC0 (0x42002000) /**< \brief (TCC0) APB Base Address */ 99 | #define TCC1 (0x42002400) /**< \brief (TCC1) APB Base Address */ 100 | #define TCC2 (0x42002800) /**< \brief (TCC2) APB Base Address */ 101 | #define USB (0x41005000) /**< \brief (USB) APB Base Address */ 102 | #define WDT (0x40001000) /**< \brief (WDT) APB Base Address */ 103 | 104 | /* GCLK */ 105 | 106 | #define GCLK_CTRL 0x00 107 | #define GCLK_STATUS 0x01 108 | #define GCLK_CLKCTRL 0x02 109 | #define GCLK_GENCTRL 0x04 110 | #define GCLK_GENDIV 0x08 111 | 112 | #define GCLK_ID_SERCOMx_SLOW 0x13 113 | #define GCLK_ID_SERCOM1_CORE 0x15 114 | #define GCLK_ID_USB 0x06 115 | 116 | /* SYSCTRL */ 117 | 118 | #define SYSCTRL_XOSC 0x10 119 | #define SYSCTRL_PCLKSR 0x0C 120 | #define SYSCTRL_DPLLCTRLA 0x44 121 | #define SYSCTRL_DPLLCTRLB 0x4C 122 | #define SYSCTRL_DPLLRATIO 0x48 123 | #define SYSCTRL_DPLLSTATUS 0x50 124 | #define SYSCTRL_INTFLAG 0x08 125 | 126 | /* NVMCTRL */ 127 | 128 | #define NVMCTRL_CTRLB 0x04 129 | 130 | /* PORT */ 131 | 132 | #define PORT_DIRSET 0x08 133 | #define PORT_DIRCLR 0x04 134 | #define PORT_OUTSET 0x18 135 | #define PORT_OUTCLR 0x14 136 | #define PORT_WRCONFIG 0x28 137 | 138 | #define PORT_PMUX0 0x30 139 | #define PORT_PMUX1 0x31 140 | #define PORT_PMUX2 0x32 141 | #define PORT_PMUX3 0x33 142 | #define PORT_PMUX4 0x34 143 | #define PORT_PMUX5 0x35 144 | #define PORT_PMUX6 0x36 145 | #define PORT_PMUX7 0x37 146 | #define PORT_PMUX8 0x38 147 | #define PORT_PMUX9 0x39 148 | #define PORT_PMUX10 0x3A 149 | #define PORT_PMUX11 0x3B 150 | #define PORT_PMUX12 0x3C 151 | #define PORT_PMUX13 0x3D 152 | #define PORT_PMUX14 0x3E 153 | #define PORT_PMUX15 0x3F 154 | 155 | #define MUX_A 0x00 156 | #define MUX_B 0x01 157 | #define MUX_C 0x02 158 | #define MUX_D 0x03 159 | #define MUX_E 0x04 160 | #define MUX_F 0x05 161 | #define MUX_G 0x06 162 | #define MUX_H 0x07 163 | #define MUX_I 0x08 164 | 165 | #define PIN_PA0 (1 << 0) 166 | #define PIN_PA1 (1 << 1) 167 | #define PIN_PA2 (1 << 2) 168 | #define PIN_PA3 (1 << 3) 169 | #define PIN_PA4 (1 << 4) 170 | #define PIN_PA5 (1 << 5) 171 | #define PIN_PA6 (1 << 6) 172 | #define PIN_PA7 (1 << 7) 173 | #define PIN_PA8 (1 << 8) 174 | #define PIN_PA9 (1 << 9) 175 | #define PIN_PA10 (1 << 10) 176 | #define PIN_PA11 (1 << 11) 177 | #define PIN_PA14 (1 << 14) 178 | #define PIN_PA15 (1 << 15) 179 | #define PIN_PA16 (1 << 16) 180 | #define PIN_PA17 (1 << 17) 181 | #define PIN_PA18 (1 << 18) 182 | #define PIN_PA19 (1 << 19) 183 | #define PIN_PA22 (1 << 22) 184 | #define PIN_PA23 (1 << 23) 185 | #define PIN_PA24 (1 << 24) 186 | #define PIN_PA25 (1 << 25) 187 | #define PIN_PA27 (1 << 27) 188 | #define PIN_PA28 (1 << 28) 189 | #define PIN_PA30 (1 << 30) 190 | #define PIN_PA31 (1 << 31) 191 | 192 | #define SERCOM1_IRQn 10 193 | 194 | /* PM */ 195 | 196 | #define PM_APBCMASK 0x20 197 | 198 | 199 | 200 | 201 | #endif 202 | -------------------------------------------------------------------------------- /sw/string.c: -------------------------------------------------------------------------------- 1 | /** 2 | * UPM 3 | * 4 | * Copyright (C) 2018 Jonas Persson 5 | * 6 | * SPDX-License-Identifier: BSD-3-Clause 7 | * 8 | */ 9 | 10 | 11 | #include 12 | #include 13 | 14 | void* memcpy(void *dest, const void *src, size_t sz) 15 | { 16 | uint8_t *p1 = (uint8_t*) dest; 17 | uint8_t *p2 = (uint8_t*) src; 18 | 19 | for (uint32_t i = 0; i < sz; i++) 20 | *p1++ = *p2++; 21 | 22 | return dest; 23 | } 24 | 25 | int memcmp(const void *s1, const void *s2, size_t n) 26 | { 27 | uint8_t *p1 = (uint8_t*) s1; 28 | uint8_t *p2 = (uint8_t*) s2; 29 | 30 | for (uint32_t i = 0; i < n; i++) 31 | if (*p1++ != *p2++) 32 | return -1; 33 | return 0; 34 | } 35 | 36 | void *memset(void *s, int c, size_t n) 37 | { 38 | uint8_t *ptr = (uint8_t *) s; 39 | 40 | while(n--) 41 | *ptr++ = (uint8_t) c; 42 | 43 | return s; 44 | } 45 | -------------------------------------------------------------------------------- /sw/tools/upm/30-upm.rules: -------------------------------------------------------------------------------- 1 | SUBSYSTEM=="usb", ATTRS{idVendor}=="ffff", ATTRS{idProduct}=="0003", GROUP="adm", MODE="0666" 2 | -------------------------------------------------------------------------------- /sw/tools/upm/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # UPM CLI 3 | # 4 | # Copyright (C) 2018 Jonas Persson 5 | # 6 | # SPDX-License-Identifier: BSD-3-Clause 7 | # 8 | # 9 | 10 | 11 | # Makefile for UPM CLI 12 | 13 | TARGET = upm 14 | PREFIX ?= /usr 15 | 16 | CC=$(CROSS_COMPILE)gcc 17 | LD=$(CROSS_COMPILE)ld 18 | AR=$(CROSS_COMPILE)ar 19 | SIZE=$(CROSS_COMPILE)size 20 | OBJCOPY=$(CROSS_COMPILE)objcopy 21 | 22 | GIT_VERSION = $(shell git describe --abbrev=4 --dirty --always --tags) 23 | PKG_CONFIG ?= pkg-config 24 | CFLAGS = -Wall -O2 25 | CFLAGS += -I. -I include/ -I ../../ 26 | CFLAGS += -DVERSION=\"$(GIT_VERSION)\" 27 | CFLAGS += `$(PKG_CONFIG) --cflags libusb-1.0` 28 | CFLAGS += `$(PKG_CONFIG) --cflags ncurses` 29 | 30 | LIBS = `$(PKG_CONFIG) --libs libusb-1.0` -luuid 31 | LIBS += `$(PKG_CONFIG) --libs ncurses` -luuid 32 | 33 | LDFLAGS = 34 | 35 | ASM_SRCS = 36 | C_SRCS = $(TARGET).c 37 | 38 | OBJS = $(ASM_SRCS:.S=.o) $(C_SRCS:.c=.o) 39 | 40 | all: $(TARGET) 41 | 42 | $(TARGET): $(OBJS) 43 | @echo LINK $@ $(LDFLAGS) 44 | @$(CC) $(LDFLAGS) $(CFLAGS) $(OBJS) $(LIBS) -o $@ 45 | 46 | %.o: %.S 47 | @echo CC $< 48 | @$(CC) -c $(CFLAGS) $< -o $@ 49 | %.o: %.c 50 | @echo CC $< 51 | @$(CC) -c $(CFLAGS) $< -o $@ 52 | 53 | install: 54 | @install -m 755 $(TARGET) $(PREFIX)/bin 55 | 56 | clean: 57 | @-rm -rf *.o $(TARGET) *.map out 58 | 59 | -------------------------------------------------------------------------------- /sw/tools/upm/README.md: -------------------------------------------------------------------------------- 1 | 2 | Install udev rules: 3 | 4 | copy '30-upm.rules' to /etc/udev/rules.d/ 5 | 6 | Reload udev rules: 7 | 8 | udevadm control --reload-rules && udevadm trigger 9 | -------------------------------------------------------------------------------- /sw/tools/upm/gui.txt: -------------------------------------------------------------------------------- 1 | 2 | dx - disable channel x 3 | ex - enable channel x 4 | rx - reset counter for channel x 5 | 6 | Aa - enable/disable out 0 7 | Ss -//- 8 | Dd -//- 9 | Ff -//- 10 | 11 | 0 USB XX.XXX V, YYYY.YY mA, ZZZZZZ mAh | Out 0 : ON 12 | 1 IN1 XX.XXX V, YYYY.YY mA, ZZZZZZ mAh | Out 1 : OFF 13 | 2 IN2 XX.XXX V, YYYY.YY mA, ZZZZZZ mAh | Out 2 : OFF 14 | 3 IN3 --.--- V, ----.-- mA, ------ mAh | Out 3 : OFF 15 | -------------------------------------------------------------------------------- /sw/tools/upm/upm.c: -------------------------------------------------------------------------------- 1 | /** 2 | * UPM cli 3 | * 4 | * Copyright (C) 2018 Jonas Persson 5 | * 6 | * SPDX-License-Identifier: BSD-3-Clause 7 | * 8 | */ 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | #include "protocol.h" 25 | 26 | static libusb_context *ctx = NULL; 27 | 28 | static libusb_device * find_device(libusb_device **devs) 29 | { 30 | libusb_device *dev; 31 | int i = 0; 32 | 33 | while ((dev = devs[i++]) != NULL) { 34 | struct libusb_device_descriptor desc; 35 | int r = libusb_get_device_descriptor(dev, &desc); 36 | if (r < 0) { 37 | return NULL; 38 | } 39 | 40 | if ( (desc.idVendor == 0xffff) && (desc.idProduct == 0x0003)) { 41 | return dev; 42 | } 43 | 44 | } 45 | 46 | return NULL; 47 | } 48 | 49 | 50 | #define CTRL_IN LIBUSB_ENDPOINT_IN |LIBUSB_REQUEST_TYPE_CLASS|LIBUSB_RECIPIENT_INTERFACE 51 | #define CTRL_OUT LIBUSB_ENDPOINT_OUT|LIBUSB_REQUEST_TYPE_CLASS|LIBUSB_RECIPIENT_INTERFACE 52 | 53 | float raw2mWh(uint8_t *in) 54 | { 55 | uint64_t d = 0; 56 | memcpy(&d, in, 6); 57 | 58 | float mWh = (float) d / 0x10000000; 59 | mWh *= 32.0; 60 | mWh /= 1024; 61 | mWh *= 1/3.6 * 100; 62 | 63 | return mWh; 64 | } 65 | 66 | int main(int argc, char **argv) { 67 | libusb_device_handle *h; 68 | libusb_device **devs; 69 | libusb_device *dev; 70 | int r; 71 | ssize_t cnt; 72 | int err; 73 | 74 | 75 | r = libusb_init(&ctx); 76 | if (r < 0) 77 | return r; 78 | 79 | 80 | cnt = libusb_get_device_list(NULL, &devs); 81 | if (cnt < 0) 82 | return (int) cnt; 83 | 84 | dev = find_device(devs); 85 | libusb_free_device_list(devs, 1); 86 | 87 | if (dev == NULL) { 88 | printf ("Could not find device\n\r"); 89 | libusb_exit (NULL); 90 | return -1; 91 | } 92 | 93 | 94 | h = libusb_open_device_with_vid_pid(ctx, 0xffff, 0x0003); 95 | 96 | if (libusb_kernel_driver_active(h, 0)) 97 | libusb_detach_kernel_driver(h, 0); 98 | 99 | err = libusb_claim_interface(h, 0); 100 | 101 | if (err != 0) { 102 | printf ("Claim interface failed (%i)\n", err); 103 | return -1; 104 | } 105 | 106 | if (h == NULL) { 107 | printf ("Could not open device\n"); 108 | return -1; 109 | } 110 | 111 | //upm_write(h,0,0,0); 112 | 113 | WINDOW *w = initscr(); 114 | cbreak(); 115 | nodelay(w, true); 116 | noecho(); 117 | curs_set(0); 118 | 119 | bool flag_run = true; 120 | uint32_t i = 0; 121 | struct upm_in in; 122 | struct upm_out out; 123 | int rx_sz; 124 | 125 | memset(&out, 0, sizeof(struct upm_out)); 126 | 127 | while(flag_run) 128 | { 129 | char c = getch(); 130 | 131 | err = libusb_interrupt_transfer(h, 132 | LIBUSB_ENDPOINT_IN|3, 133 | (uint8_t *) &in, sizeof (struct upm_in) , &rx_sz, 10000); 134 | 135 | if (err < 0) { 136 | clear(); 137 | refresh(); 138 | endwin(); 139 | 140 | printf ("upm_read: %i %i\n", err,rx_sz); 141 | goto err_out; 142 | } 143 | 144 | if (c == 'q') 145 | break; 146 | 147 | if (c == 'A') 148 | out.outputs_set = (1 << 0); 149 | if (c == 'a') 150 | out.outputs_clr = (1 << 0); 151 | 152 | if (c == 'S') 153 | out.outputs_set = (1 << 1); 154 | if (c == 's') 155 | out.outputs_clr = (1 << 1); 156 | 157 | if (c == 'D') 158 | out.outputs_set = (1 << 2); 159 | if (c == 'd') 160 | out.outputs_clr = (1 << 2); 161 | 162 | if (c == 'F') 163 | out.outputs_set = (1 << 3); 164 | if (c == 'f') 165 | out.outputs_clr = (1 << 3); 166 | 167 | if (c == 'r') 168 | out.counter_reset = (1 << 0); 169 | 170 | err = libusb_interrupt_transfer(h, 171 | 0x02, 172 | (uint8_t *) &out, sizeof (struct upm_out) , &rx_sz, 10000); 173 | 174 | if (err < 0) { 175 | clear(); 176 | refresh(); 177 | endwin(); 178 | 179 | printf ("upm_write: %i %i\n", err,rx_sz); 180 | goto err_out; 181 | } 182 | 183 | out.outputs_set = 0; 184 | out.outputs_clr = 0; 185 | out.counter_reset = 0; 186 | 187 | float V_usb = (float) in.Vbus[0]/0xFFFF * 32.0; 188 | float I_usb = (float) in.Vsns[0]/0xFFFF * 1000.0; 189 | float mWh_usb = raw2mWh(in.Ereg[0]); 190 | 191 | float V_in1 = (float) in.Vbus[1]/0xFFFF * 32.0; 192 | float I_in1 = (float) in.Vsns[1]/0xFFFF * 1000.0; 193 | float mWh_in1 = raw2mWh(in.Ereg[1]); 194 | 195 | 196 | float V_in2 = (float) in.Vbus[2]/0xFFFF * 32.0; 197 | float I_in2 = (float) in.Vsns[2]/0xFFFF * 1000.0; 198 | float mWh_in2 = raw2mWh(in.Ereg[2]); 199 | 200 | float V_in3 = (float) in.Vbus[3]/0xFFFF * 32.0; 201 | float I_in3 = (float) in.Vsns[3]/0xFFFF * 1000.0; 202 | float mWh_in3 = raw2mWh(in.Ereg[3]); 203 | 204 | i = i + 1; 205 | mvwprintw(w, 0, 0, "0 USB %6.3f V, %7.2f mA, %6.1f mWh | Out 0 : %s", 206 | V_usb,I_usb,mWh_usb,in.outputs & (1 << 0)?"ON ":"OFF"); 207 | mvwprintw(w, 1, 0, "1 IN1 %6.3f V, %7.2f mA, %6.1f mWh | Out 1 : %s", 208 | V_in1,I_in1,mWh_in1,in.outputs & (1 << 1)?"ON ":"OFF"); 209 | mvwprintw(w, 2, 0, "2 IN2 %6.3f V, %7.2f mA, %6.1f mWh | Out 2 : %s", 210 | V_in2,I_in2,mWh_in2,in.outputs & (1 << 2)?"ON ":"OFF"); 211 | mvwprintw(w, 3, 0, "3 IN3 %6.3f V, %7.2f mA, %6.1f mWh | Out 3 : %s", 212 | V_in3,I_in3,mWh_in3,in.outputs & (1 << 3)?"ON ":"OFF"); 213 | 214 | } 215 | 216 | clear(); 217 | refresh(); 218 | endwin(); 219 | err_out: 220 | libusb_exit(NULL); 221 | return 0; 222 | } 223 | -------------------------------------------------------------------------------- /sw/upm.h: -------------------------------------------------------------------------------- 1 | /** 2 | * UPM 3 | * 4 | * Copyright (C) 2018 Jonas Persson 5 | * 6 | * SPDX-License-Identifier: BSD-3-Clause 7 | * 8 | */ 9 | 10 | #ifndef __UPM_H__ 11 | #define __UPM_H__ 12 | 13 | #define PIN_SDA PIN_PA0 14 | #define PIN_SCL PIN_PA1 15 | #define PIN_PAC_ALERT_N PIN_PA2 16 | #define PIN_PACPWRDN_N PIN_PA3 17 | #define PIN_DUT_USB_EN PIN_PA4 18 | #define PIN_DUT_USB_FLAG_N PIN_PA5 19 | #define PIN_OUT1_EN PIN_PA6 20 | #define PIN_OUT2_EN PIN_PA7 21 | #define PIN_OUT3_EN PIN_PA8 22 | #define PIN_DUT_DISCHARGE PIN_PA9 23 | #define PIN_XTAL_IN PIN_PA14 24 | #define PIN_XTAL_OUT PIN_PA15 25 | #define PIN_USB_DM PIN_PA24 26 | #define PIN_USB_DP PIN_PA25 27 | #define PIN_SWO PIN_PA28 28 | #define PIN_SWCLK PIN_PA30 29 | #define PIN_SWDIO PIN_PA31 30 | 31 | #define UNUSED_PINS ( PIN_PA10 | \ 32 | PIN_PA11 | \ 33 | PIN_PA16 | \ 34 | PIN_PA17 | \ 35 | PIN_PA18 | \ 36 | PIN_PA19 | \ 37 | PIN_PA22 | \ 38 | PIN_PA23 | \ 39 | PIN_PA27) 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /sw/usb.c: -------------------------------------------------------------------------------- 1 | /** 2 | * UPM 3 | * 4 | * Copyright (C) 2018 Jonas Persson 5 | * 6 | * SPDX-License-Identifier: BSD-3-Clause 7 | * 8 | */ 9 | 10 | #include 11 | #include 12 | #include "samd21.h" 13 | #include "usb.h" 14 | 15 | #define USB_NO_EPS 8 16 | #define USB_EP0_SIZE 64 17 | 18 | static uint32_t base; 19 | static struct usb_samd21_device_descriptor eps[USB_NO_EPS*2]; 20 | uint32_t ep0_buf_in[16] __attribute__((__aligned__(4))); 21 | uint32_t ep0_buf_out[16] __attribute__((__aligned__(4))); 22 | static uint16_t device_status; 23 | uint32_t ep2_buf_out[16] __attribute__((__aligned__(4))); 24 | uint32_t ep3_buf_in[16] __attribute__((__aligned__(4))); 25 | static bool _enumerated = false; 26 | 27 | static const uint8_t qf_descriptor[] = { 28 | 0x0A, //USB_DEV_QUALIFIER_DESC_LEN, 29 | 0x06, //USB_DEV_QUALIFIER_DESC_TYPE, 30 | 0x00, //USB_DEV_DESC_SPEC_LB, 31 | 0x02, //USB_DEV_DESC_SPEC_HB, 32 | 0x00, //USB_DEV_DESC_DEV_CLASS, 33 | 0x00, //USB_DEV_DESC_DEV_SUBCLASS, 34 | 0x00, //USB_DEV_DESC_DEV_PROTOCOL, 35 | 0x40, //USB_DEV_DESC_EP0_MAXPACKETSIZE, 36 | 0x01, //USB_DEV_DESC_NUM_OT_SPEED_CONF, 37 | 0 //USB_DEV_DESC_RESERVED 38 | }; 39 | 40 | /** 41 | * 42 | * Endpoint 0 <--> USB Configuration endpoint 43 | * Endpoint 2 <--> INTR OUT, used for commands from host -> device 44 | * Endpoint 3 <--> INTR IN, used for responses from device -> host 45 | * 46 | */ 47 | 48 | static const struct usb_descriptors descriptors = { 49 | .device = { 50 | .bLength = 0x12, // length of this descriptor 51 | .bDescriptorType = 0x01, // Device descriptor 52 | .bcdUSB = 0x0200, // USB version 2.0 53 | .bDeviceClass = 0x00, // Device class (specified in interface descriptor) 54 | .bDeviceSubClass = 0x00, // Device Subclass (specified in interface descriptor) 55 | .bDeviceProtocol = 0x00, // Device Protocol (specified in interface descriptor) 56 | .bMaxPacketSize = 0x40, // Max packet size for control endpoint 57 | .idVendor = 0xffff, // Freescale Vendor ID. -- DO NOT USE IN A PRODUCT 58 | .idProduct = 0x0003, // Decvice ID -- DO NOT USE IN A PRODUCT 59 | .bcdDevice = 0x0000, // Device revsion 60 | .iManufacturer = 0x01, // Index of Manufacturer string descriptor 61 | .iProduct = 0x01, // Index of Product string descriptor 62 | .iSerialNumber = 0x01, // Index of serial number string descriptor 63 | .bNumConfigurations = 0x01, // Number of configurations 64 | }, 65 | .config = { 66 | .bLength = 0x09, // 67 | .bDescriptorType = 0x02, // Configuration descriptor 68 | .wTotalLength = 32, 69 | .bNumInterfaces = 0x01, // Number of interfaces 70 | .bConfigurationValue = 0x01, // Number to select for this configuration 71 | .iConfiguration = 0x00, // No string descriptor 72 | .bmAttributes = 0x80, // Self powered, No remote wakeup 73 | .MaxPower = 0xfa 74 | }, 75 | .interface = { 76 | .bLength = 0x09, 77 | .bDescriptorType = 0x04, // Interface descriptor 78 | .bInterfaceNumber = 0x00, // This interface = #0 79 | .bAlternateSetting = 0x00, // Alternate setting 80 | .bNumEndpoints = 0x02, // Number of endpoints for this interface 81 | .bInterfaceClass = 0xFF, 82 | .bInterfaceSubClass = 0xFF, 83 | .bInterfaceProtocol = 0xFF, 84 | .iInterface = 0, // No string descriptor 85 | }, 86 | .endpoint_intr_out = { 87 | .bLength = 0x07, 88 | .bDescriptorType = 0x05, // Endpoint descriptor 89 | .bEndpointAddress = 0x02, 90 | .bmAttributes = 0x3, 91 | .wMaxPacketSize = 0x0040, 92 | .bInterval = 0x05, 93 | }, 94 | .endpoint_intr_in = { 95 | .bLength = 0x07, 96 | .bDescriptorType = 0x05, // Endpoint descriptor 97 | .bEndpointAddress = 0x83, 98 | .bmAttributes = 0x3, 99 | .wMaxPacketSize = 0x0040, 100 | .bInterval = 0x05, 101 | } 102 | }; 103 | 104 | static const uint8_t usb_string_id[] = 105 | {0x16,3,'U',0,'P',0,'M',0}; 106 | 107 | 108 | void usb_handler(void) 109 | { 110 | while(1); 111 | } 112 | 113 | void usb_init(uint32_t _base) 114 | { 115 | uint32_t caldata; 116 | base = _base; 117 | 118 | memset(eps, 0, USB_NO_EPS*sizeof(struct usb_samd21_device_descriptor)); 119 | 120 | /* Reset USB */ 121 | write8(base + USB_CTRLA, 1); 122 | while (read8(base + USB_SYNCBUSY) & 1); 123 | 124 | /* Enable */ 125 | write8(base + USB_CTRLA, (1 << 1) | (1 << 2)); 126 | while(read8(base + USB_SYNCBUSY) & 2); 127 | 128 | /** 129 | * Load calibration data from NVM 130 | * 131 | * Bit ranges adjusted to reflect that we start reading 32 bit's in. 132 | * 133 | * USB_TRANSN 17:13 134 | * USB_TRANSP 22:18 135 | * USB_TRIM 25:23 136 | * 137 | */ 138 | caldata = read32(NVMCTRL_OTP4 + 0x04); 139 | 140 | uint8_t usb_cal_transn = (caldata >> 13) & 0x1F; 141 | uint8_t usb_cal_transp = (caldata >> 18) & 0x1F; 142 | uint8_t usb_cal_trim = (caldata >> 23) & 0x07; 143 | 144 | write16(base + USB_PADCAL, (usb_cal_trim << 12) | 145 | (usb_cal_transn << 6) | 146 | (usb_cal_transp)); 147 | 148 | write32(base + USB_DESCADDR, (uint32_t) eps); 149 | 150 | write16(base + USB_INTFLAG, 0xffff); 151 | write16(base + USB_INTENSET, (1 << 3)); 152 | write8(base + USB_DADD, (1 << 7)); 153 | write16(base + USB_CTRLB, (1 << 9) |1); 154 | 155 | usb_reset(); 156 | } 157 | 158 | void usb_reset(void) 159 | { 160 | _enumerated = false; 161 | 162 | write8(base + USB_DADD, (1 << 7) ); 163 | /* EP0 setup */ 164 | eps[0].addr = (uint32_t) ep0_buf_out; 165 | eps[0].pcksize = (0x03 << 28); 166 | eps[1].addr = (uint32_t) ep0_buf_in; 167 | eps[1].pcksize = (0x03 << 28); 168 | 169 | write8(base + USB_EPINTENSET(0), (1 << 4)); 170 | /* Configure EP0 in/out as Control in / Control setup, out */ 171 | write8(base + USB_EPCFG(0), (1 << 4) | 1); 172 | //write8(base + USB_EPSTATUSCLR(0), (1 << 7) | (1 << 5) | (1 << 1) | 1); 173 | write8(base + USB_EPSTATUSCLR(0), 0xff); 174 | write8(base + USB_EPSTATUSSET(0), 1); 175 | write16(base + USB_CTRLB, 0); 176 | 177 | /* Configure EP2 & EP3 */ 178 | 179 | eps[4].addr = (uint32_t) ep2_buf_out; 180 | eps[4].pcksize = (0x03 << 28); 181 | eps[7].addr = (uint32_t) ep3_buf_in; 182 | eps[7].pcksize = (0x03 << 28); 183 | 184 | write8(base + USB_EPCFG(2), 0x04); 185 | write8(base + USB_EPCFG(3), (0x04 << 4)); 186 | 187 | write8(base + USB_EPSTATUSCLR(2), 0xff); 188 | } 189 | 190 | uint32_t usb_send_ep0(uint8_t *data, uint32_t sz) 191 | { 192 | 193 | 194 | memcpy(ep0_buf_in, data, sz); 195 | eps[1].addr = (uint32_t) ep0_buf_in; 196 | eps[1].pcksize = (0x03 << 28) | sz; 197 | eps[1].extreg = 0; 198 | eps[1].status_bk = 0; 199 | 200 | write8(base + USB_EPINTFLAG(0), (1 << 1)); 201 | write8(base + USB_EPSTATUSSET(0), (1 << 7)); 202 | 203 | while ((read8(base + USB_EPINTFLAG(0)) & (1 << 1)) == 0); 204 | return 0; 205 | } 206 | 207 | uint32_t usb_send(uint8_t *data, uint32_t sz) 208 | { 209 | uint32_t timeout = 0xffff; 210 | 211 | memcpy(ep3_buf_in, data, sz); 212 | eps[7].addr = (uint32_t) ep3_buf_in; 213 | eps[7].pcksize = (0x03 << 28) | sz; 214 | eps[7].extreg = 0; 215 | eps[7].status_bk = 0; 216 | 217 | write8(base + USB_EPINTFLAG(3), (1 << 1)); 218 | write8(base + USB_EPSTATUSSET(3), (1 << 7)); 219 | 220 | while ((read8(base + USB_EPINTFLAG(3)) & (1 << 1)) == 0) 221 | { 222 | timeout--; 223 | if (!timeout) 224 | return 255; 225 | } 226 | return 0; 227 | } 228 | 229 | static void usb_enumerate(void) 230 | { 231 | struct usb_setup_packet *setup = (struct usb_setup_packet*) ep0_buf_out; 232 | uint32_t sz; 233 | uint16_t request; 234 | 235 | request = (setup->bRequestType << 8) | setup->bRequest; 236 | 237 | switch (request) 238 | { 239 | case USB_GET_DESCRIPTOR: 240 | if(setup->wValue == 0x0600) 241 | { 242 | usb_send_ep0((uint8_t *) qf_descriptor, 243 | sizeof(qf_descriptor)); 244 | } else if (setup->wValue == 0x0100) { 245 | 246 | sz = sizeof(struct usb_device_descriptor); 247 | 248 | if (setup->wLength <= sz) 249 | sz = setup->wLength; 250 | 251 | 252 | usb_send_ep0((uint8_t *) &descriptors.device, sz); 253 | 254 | } else if (setup->wValue == 0x0200) { 255 | uint16_t desc_tot_sz = descriptors.config.wTotalLength; 256 | 257 | sz = desc_tot_sz; 258 | 259 | if (setup->wLength <= sz) 260 | sz = setup->wLength; 261 | 262 | usb_send_ep0((uint8_t *) &descriptors.config, sz); 263 | } else if (setup->wValue == 0x0300) { 264 | const uint8_t _usb_data[] = "\x04\x03\x04\x09"; 265 | usb_send_ep0((uint8_t *) _usb_data, 4); 266 | } else if(setup->wValue == 0x0301) { 267 | 268 | sz = setup->wLength > sizeof(usb_string_id)? 269 | sizeof(usb_string_id): setup->wLength; 270 | 271 | usb_send_ep0((uint8_t *) usb_string_id, sz); 272 | 273 | } else if (setup->wValue == 0x0A00) { 274 | uint16_t desc_tot_sz = descriptors.interface.bLength; 275 | 276 | sz = desc_tot_sz; 277 | 278 | if (setup->wLength < sz) 279 | sz = setup->wLength; 280 | 281 | usb_send_ep0((uint8_t *) &descriptors.interface, sz); 282 | 283 | } else { 284 | while(1); 285 | } 286 | break; 287 | case USB_SET_ADDRESS: 288 | { 289 | uint8_t addr = setup->wValue & 0x7f; 290 | usb_send_ep0(NULL,0); 291 | write8(base + USB_DADD, (1 << 7) | addr); 292 | } 293 | break; 294 | case USB_SET_CONFIGURATION: 295 | _enumerated = true; 296 | usb_send_ep0(NULL, 0); 297 | break; 298 | case USB_SET_IDLE: 299 | usb_send_ep0(NULL,0); 300 | break; 301 | case USB_GET_STATUS: 302 | usb_send_ep0((uint8_t *) &device_status, 2); 303 | usb_send_ep0(NULL,0); 304 | break; 305 | default: 306 | break; 307 | } 308 | 309 | 310 | } 311 | 312 | bool usb_enumerated(void) 313 | { 314 | return _enumerated; 315 | } 316 | 317 | bool usb_has_data(void) 318 | { 319 | uint8_t ep2_int = read8(base + USB_EPINTFLAG(2)); 320 | 321 | write8(base + USB_EPINTFLAG(2), ep2_int); 322 | return (ep2_int & 1); 323 | } 324 | 325 | uint8_t * usb_get_buf(void) 326 | { 327 | 328 | write8(base + USB_EPSTATUSCLR(2), (1 << 6)); 329 | return (uint8_t *) ep2_buf_out; 330 | } 331 | 332 | void usb_task(void) 333 | { 334 | uint16_t status = read16(base + USB_INTFLAG); 335 | uint8_t ep0_int = read8(base + USB_EPINTFLAG(0)); 336 | 337 | if (status & ( 1 << 3)) 338 | { 339 | write16(base + USB_INTFLAG, (1 << 3)); 340 | usb_reset(); 341 | } 342 | 343 | /* Process setup packet on EP0 */ 344 | if (ep0_int & (1 << 4)) 345 | { 346 | write8(base + USB_EPINTFLAG(0), (1 << 4)); 347 | write8(base + USB_EPSTATUSCLR(0), (1 << 6)); 348 | usb_enumerate(); 349 | } 350 | 351 | write16(base + USB_INTFLAG, status); 352 | write8(base + USB_EPINTFLAG(0), ep0_int); 353 | 354 | } 355 | -------------------------------------------------------------------------------- /sw/usb.h: -------------------------------------------------------------------------------- 1 | /** 2 | * UPM 3 | * 4 | * Copyright (C) 2018 Jonas Persson 5 | * 6 | * SPDX-License-Identifier: BSD-3-Clause 7 | * 8 | */ 9 | 10 | #ifndef __USB_H__ 11 | #define __USB_H__ 12 | 13 | #include 14 | #include 15 | 16 | /* Standard USB structures */ 17 | 18 | struct usb_setup_packet { 19 | uint8_t bRequestType; // Characteristics of request 20 | uint8_t bRequest; // Specific request 21 | uint16_t wValue; // Word-sized field that varies according to request 22 | uint16_t wIndex; // Index 23 | uint16_t wLength; // Number of bytes to transfer 24 | } __attribute__ ((packed)); 25 | 26 | struct usb_device_descriptor { 27 | uint8_t bLength; // Size of this descriptor in bytes 28 | uint8_t bDescriptorType; // DEVICE Descriptor Type 29 | uint16_t bcdUSB; // USB Specification Release Number 30 | uint8_t bDeviceClass; // Class code 31 | uint8_t bDeviceSubClass; // Subclass code 32 | uint8_t bDeviceProtocol; // Protocol code 33 | uint8_t bMaxPacketSize; // Maximum packet size for endpoint zero 34 | uint16_t idVendor; // Vendor ID 35 | uint16_t idProduct; // Product ID 36 | uint16_t bcdDevice; // Device release number 37 | uint8_t iManufacturer; // Index of string descriptor describing manufacturer 38 | uint8_t iProduct; // Index of string descriptor describing product 39 | uint8_t iSerialNumber; // Index of string descriptor describing the device's serial number 40 | uint8_t bNumConfigurations; // Number of possible configurations 41 | } __attribute__ ((packed)); 42 | 43 | struct usb_configuration_descriptor { 44 | uint8_t bLength; // Size of descriptor 45 | uint8_t bDescriptorType; // CONFIGURATION Descriptor Type 46 | uint16_t wTotalLength; // Total length of data returned for this configuration 47 | uint8_t bNumInterfaces; // Number of interfaces supported by this configuration 48 | uint8_t bConfigurationValue; // Value to use as an argument to the to select this configuration 49 | uint8_t iConfiguration; // Index of string descriptor describing this configuration 50 | uint8_t bmAttributes; // Configuration characteristics 51 | uint8_t MaxPower; // Maximum power consumption of the USB device 52 | } __attribute__ ((packed)); 53 | 54 | struct usb_interface_descriptor { 55 | uint8_t bLength; // Size of this descriptor in bytes 56 | uint8_t bDescriptorType; // INTERFACE Descriptor Type 57 | uint8_t bInterfaceNumber; // Number of this interface 58 | uint8_t bAlternateSetting; // Value used to select this alternate setting 59 | uint8_t bNumEndpoints; // Number of endpoints used by this interface 60 | uint8_t bInterfaceClass; // Class code 61 | uint8_t bInterfaceSubClass; // Subclass code 62 | uint8_t bInterfaceProtocol; // Protocol code 63 | uint8_t iInterface; // Index of string descriptor describing this interface 64 | } __attribute__ ((packed)); 65 | 66 | 67 | struct usb_endpoint_descriptor { 68 | uint8_t bLength; // Size of this descriptor in bytes 69 | uint8_t bDescriptorType; // ENDPOINT Descriptor Type 70 | uint8_t bEndpointAddress; // The address of the endpoint on the USB device described by this descriptor 71 | uint8_t bmAttributes; // The endpoint'ss attributes 72 | uint16_t wMaxPacketSize; // Maximum packet size 73 | uint8_t bInterval; // Interval for polling endpoint for data transfers 74 | } __attribute__ ((packed)); 75 | 76 | 77 | struct usb_descriptors { 78 | const struct usb_device_descriptor device; 79 | const struct usb_configuration_descriptor config; 80 | const struct usb_interface_descriptor interface; 81 | const struct usb_endpoint_descriptor endpoint_intr_out; 82 | const struct usb_endpoint_descriptor endpoint_intr_in; 83 | } __attribute__ ((packed)); 84 | 85 | /* Defines for commands in setup packets */ 86 | #define USB_GET_DESCRIPTOR 0x8006 87 | #define USB_SET_CONFIGURATION 0x0009 88 | #define USB_SET_IDLE 0x210A 89 | #define USB_SET_FEATURE 0x0003 90 | #define USB_SET_ADDRESS 0x0005 91 | #define USB_GET_STATUS 0x8000 92 | 93 | 94 | 95 | 96 | /* SAMD21 Specific structures */ 97 | 98 | struct usb_samd21_device_descriptor { 99 | uint32_t addr; 100 | uint32_t pcksize; 101 | uint16_t extreg; 102 | uint8_t status_bk; 103 | uint8_t __rz[0x05]; 104 | } __attribute__((packed)); 105 | 106 | 107 | /* USB Device register offset's */ 108 | 109 | #define USB_CTRLA 0x00 110 | #define USB_SYNCBUSY 0x02 111 | #define USB_QOSCTRL 0x03 112 | #define USB_FSMSTATUS 0x0D 113 | #define USB_DESCADDR 0x24 114 | #define USB_PADCAL 0x28 115 | #define USB_CTRLB 0x08 116 | #define USB_DADD 0x0A 117 | #define USB_STATUS 0x0C 118 | #define USB_FNUM 0x10 119 | #define USB_INTENCLR 0x14 120 | #define USB_INTENSET 0x18 121 | #define USB_INTFLAG 0x1C 122 | #define USB_EPINTSMRY 0x20 123 | 124 | #define USB_EPCFG(n) (0x100+n*0x20) 125 | #define USB_EPSTATUSCLR(n) (0x104+n*0x20) 126 | #define USB_EPSTATUSSET(n) (0x105+n*0x20) 127 | #define USB_EPSTATUS(n) (0x106+n*0x20) 128 | #define USB_EPINTFLAG(n) (0x107+n*0x20) 129 | #define USB_EPINTENCLR(n) (0x108+n*0x20) 130 | #define USB_EPINTENSET(n) (0x109+n*0x20) 131 | 132 | 133 | 134 | void usb_init(uint32_t _base); 135 | void usb_task(void); 136 | void usb_reset(void); 137 | uint32_t usb_send(uint8_t *data, uint32_t sz); 138 | bool usb_enumerated(void); 139 | 140 | uint8_t * usb_get_buf(void); 141 | bool usb_has_data(void); 142 | #endif 143 | --------------------------------------------------------------------------------